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 extern const mp_obj_type_t machine_pin_type;
36 extern const mp_obj_type_t mp_machine_soft_i2c_type;
37 extern const mp_obj_type_t mp_machine_soft_spi_type;
38 extern const mp_obj_type_t mp_machine_soft_timer_type;
39 extern const mp_obj_type_t machine_sdcard_type;
40 extern const mp_obj_type_t machine_hw_i2c_type;
41 extern const mp_obj_type_t machine_hw_spi_type;
42 
43 extern const mp_obj_type_t machine_adc_type;
44 extern const mp_obj_type_t machine_pwm_type;
45 extern const mp_obj_type_t machine_uart_type;
46 extern const mp_obj_type_t machine_rtc_type;
47 extern const mp_obj_type_t machine_timer_type;
48 extern const mp_obj_type_t machine_can_type;
49 #if MICROPY_PY_MACHINE_DAC
50 extern const mp_obj_type_t machine_dac_type;
51 #endif
52 extern const mp_obj_type_t machine_wdt_type;
53 
54 void machine_init(void);
55 void machine_deinit(void);
56 void machine_pins_init(void);
57 void machine_pins_deinit(void);
58 void machine_timer_deinit_all(void);
59 
60 #endif  // MICROPY_INCLUDED_HAAS_MODMACHINE_H
61