1 #ifndef MICROPY_INCLUDED_HAAS_MODMACHINE_H
2 #define MICROPY_INCLUDED_HAAS_MODMACHINE_H
3 
4 #include "py/obj.h"
5 
6 typedef enum {
7     // MACHINE_WAKE_IDLE=0x01,
8     MACHINE_WAKE_SLEEP=0x02,
9     MACHINE_WAKE_DEEPSLEEP=0x04,
10     SLEEP_WAKEUP_EXT0,
11     SLEEP_WAKEUP_EXT1,
12     SLEEP_WAKEUP_TIMER,
13     SLEEP_WAKEUP_TOUCHPAD,
14     SLEEP_WAKEUP_ULP,
15 
16     PWR_MODE_ACTIVE,
17     PWR_MODE_LPDS,
18     PWR_MODE_HIBERNATE,
19     SLP_PWRON_RESET,
20     SLP_HARD_RESET,
21     SLP_WDT_RESET,
22     SLP_HIB_RESET,
23     SLP_SOFT_RESET,
24     SLP_WAKED_BY_WLAN,
25     SLP_WAKED_BY_GPIO,
26     SLP_WAKED_BY_RTC,
27 
28     MP_HARD_RESET,
29     MP_PWRON_RESET,
30     MP_WDT_RESET,
31     MP_DEEPSLEEP_RESET,
32     MP_SOFT_RESET
33 } wake_type_t;
34 
35 
36 extern const mp_obj_type_t machine_pin_type;
37 extern const mp_obj_type_t mp_machine_soft_i2c_type;
38 extern const mp_obj_type_t mp_machine_soft_spi_type;
39 extern const mp_obj_type_t mp_machine_soft_timer_type;
40 extern const mp_obj_type_t machine_sdcard_type;
41 extern const mp_obj_type_t machine_hw_i2c_type;
42 extern const mp_obj_type_t machine_hw_spi_type;
43 
44 extern const mp_obj_type_t machine_adc_type;
45 extern const mp_obj_type_t machine_pwm_type;
46 extern const mp_obj_type_t machine_uart_type;
47 extern const mp_obj_type_t machine_rtc_type;
48 extern const mp_obj_type_t machine_timer_type;
49 extern const mp_obj_type_t machine_can_type;
50 #if MICROPY_PY_MACHINE_HW_PWM
51 extern const mp_obj_type_t machine_dac_type;
52 #endif
53 extern const mp_obj_type_t machine_wdt_type;
54 
55 void machine_init(void);
56 void machine_deinit(void);
57 void machine_pins_init(void);
58 void machine_pins_deinit(void);
59 void machine_timer_deinit_all(void);
60 
61 #endif // MICROPY_INCLUDED_HAAS_MODMACHINE_H
62