|
|
@ -66,8 +66,14 @@ void ets_event_poll(void); |
|
|
|
#define mp_hal_pin_obj_t uint32_t |
|
|
|
#define mp_hal_get_pin_obj(o) mp_obj_get_pin(o) |
|
|
|
void mp_hal_pin_config_od(mp_hal_pin_obj_t pin); |
|
|
|
#define mp_hal_pin_low(p) gpio_output_set(0, 1 << (p), 1 << (p), 0) |
|
|
|
#define mp_hal_pin_od_high(p) gpio_output_set(1 << (p), 0, 1 << (p), 0) |
|
|
|
#define mp_hal_pin_read(p) GPIO_INPUT_GET(GPIO_ID_PIN((p))) |
|
|
|
#define mp_hal_pin_low(p) do { \ |
|
|
|
if ((p) == 16) { WRITE_PERI_REG(RTC_GPIO_ENABLE, (READ_PERI_REG(RTC_GPIO_ENABLE) & ~1) | 1); } \ |
|
|
|
else { gpio_output_set(0, 1 << (p), 1 << (p), 0); } \ |
|
|
|
} while (0) |
|
|
|
#define mp_hal_pin_od_high(p) do { \ |
|
|
|
if ((p) == 16) { WRITE_PERI_REG(RTC_GPIO_ENABLE, (READ_PERI_REG(RTC_GPIO_ENABLE) & ~1)); } \ |
|
|
|
else { gpio_output_set(1 << (p), 0, 1 << (p), 0); } \ |
|
|
|
} while (0) |
|
|
|
#define mp_hal_pin_read(p) pin_get(p) |
|
|
|
|
|
|
|
#endif // _INCLUDED_MPHAL_H_
|
|
|
|