2016-04-12 13:53:04 +01:00
|
|
|
#ifndef __MICROPY_INCLUDED_ESP8266_MODPYB_H__
|
|
|
|
#define __MICROPY_INCLUDED_ESP8266_MODPYB_H__
|
|
|
|
|
|
|
|
#include "py/obj.h"
|
|
|
|
|
2015-02-13 22:21:44 +00:00
|
|
|
extern const mp_obj_type_t pyb_pin_type;
|
2016-03-02 13:37:27 +00:00
|
|
|
extern const mp_obj_type_t pyb_pwm_type;
|
2015-05-18 17:35:56 +01:00
|
|
|
extern const mp_obj_type_t pyb_adc_type;
|
2015-06-22 23:03:17 +01:00
|
|
|
extern const mp_obj_type_t pyb_rtc_type;
|
2016-04-06 17:45:52 +01:00
|
|
|
extern const mp_obj_type_t pyb_uart_type;
|
2016-02-11 12:43:41 +00:00
|
|
|
extern const mp_obj_type_t pyb_i2c_type;
|
2016-12-08 03:41:58 +00:00
|
|
|
extern const mp_obj_type_t machine_hspi_type;
|
2015-12-29 00:19:23 +00:00
|
|
|
|
2016-10-18 01:06:20 +01:00
|
|
|
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_info_obj);
|
2016-04-28 12:23:55 +01:00
|
|
|
|
2016-02-11 11:41:58 +00:00
|
|
|
typedef struct _pyb_pin_obj_t {
|
|
|
|
mp_obj_base_t base;
|
|
|
|
uint16_t phys_port;
|
|
|
|
uint16_t func;
|
2016-04-13 22:38:44 +01:00
|
|
|
uint32_t periph;
|
2016-02-11 11:41:58 +00:00
|
|
|
} pyb_pin_obj_t;
|
|
|
|
|
2016-04-22 10:04:12 +01:00
|
|
|
const pyb_pin_obj_t pyb_pin_obj[16 + 1];
|
|
|
|
|
2016-04-14 11:15:43 +01:00
|
|
|
void pin_init0(void);
|
|
|
|
void pin_intr_handler_iram(void *arg);
|
|
|
|
void pin_intr_handler(uint32_t);
|
|
|
|
|
2015-12-29 00:19:23 +00:00
|
|
|
uint mp_obj_get_pin(mp_obj_t pin_in);
|
2016-02-11 11:41:58 +00:00
|
|
|
pyb_pin_obj_t *mp_obj_get_pin_obj(mp_obj_t pin_in);
|
2015-12-29 00:19:23 +00:00
|
|
|
int pin_get(uint pin);
|
|
|
|
void pin_set(uint pin, int value);
|
2016-04-12 13:53:04 +01:00
|
|
|
|
2016-11-05 22:30:19 +00:00
|
|
|
extern uint32_t pyb_rtc_alarm0_wake;
|
|
|
|
extern uint64_t pyb_rtc_alarm0_expiry;
|
|
|
|
|
|
|
|
void pyb_rtc_set_us_since_2000(uint64_t nowus);
|
|
|
|
uint64_t pyb_rtc_get_us_since_2000();
|
|
|
|
void rtc_prepare_deepsleep(uint64_t sleep_us);
|
|
|
|
|
2016-04-12 13:53:04 +01:00
|
|
|
#endif // __MICROPY_INCLUDED_ESP8266_MODPYB_H__
|