@ -26,6 +26,8 @@
# ifndef MICROPY_INCLUDED_LIB_UTILS_MPIRQ_H
# define MICROPY_INCLUDED_LIB_UTILS_MPIRQ_H
# include "py/obj.h"
/******************************************************************************
DEFINE CONSTANTS
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@ -41,20 +43,17 @@ enum {
DEFINE TYPES
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
typedef mp_obj_t ( * mp_irq_init_t ) ( size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) ;
typedef mp_uint_t ( * mp_irq_uint_method_one_uint_para_t ) ( mp_obj_t self , mp_uint_t trigger ) ;
typedef mp_uint_t ( * mp_irq_int_method_one_para_t ) ( mp_obj_t self , mp_uint_t info_type ) ;
typedef mp_uint_t ( * mp_irq_trigger_fun_t ) ( mp_obj_t self , mp_uint_t trigger ) ;
typedef mp_uint_t ( * mp_irq_info_fun_t ) ( mp_obj_t self , mp_uint_t info_type ) ;
enum {
MP_IRQ_INFO_FLAGS ,
MP_IRQ_INFO_TRIGGERS ,
MP_IRQ_INFO_CNT
} ;
typedef struct _mp_irq_methods_t {
mp_irq_init_t init ;
mp_irq_uint_method_one_uint_para_t trigger ;
mp_irq_int_method_one_para_t info ;
mp_irq_trigger_fun_t trigger ;
mp_irq_info_fun_t info ;
} mp_irq_methods_t ;
typedef struct _mp_irq_obj_t {
@ -77,6 +76,7 @@ extern const mp_obj_type_t mp_irq_type;
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
mp_irq_obj_t * mp_irq_new ( const mp_irq_methods_t * methods , mp_obj_t parent ) ;
void mp_irq_init ( mp_irq_obj_t * self , const mp_irq_methods_t * methods , mp_obj_t parent ) ;
void mp_irq_handler ( mp_irq_obj_t * self ) ;
# endif // MICROPY_INCLUDED_LIB_UTILS_MPIRQ_H