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-03-01 22:53:23 +00:00
|
|
|
extern const mp_obj_type_t pyb_spi_type;
|
2015-12-29 00:19:23 +00: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;
|
|
|
|
|
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
|
|
|
|
|
|
|
#endif // __MICROPY_INCLUDED_ESP8266_MODPYB_H__
|