micropython/esp8266/modpyb.h

28 lines
759 B
C
Raw Normal View History

#ifndef __MICROPY_INCLUDED_ESP8266_MODPYB_H__
#define __MICROPY_INCLUDED_ESP8266_MODPYB_H__
#include "py/obj.h"
extern const mp_obj_type_t pyb_pin_type;
extern const mp_obj_type_t pyb_pwm_type;
2015-05-19 00:35:56 +08:00
extern const mp_obj_type_t pyb_adc_type;
extern const mp_obj_type_t pyb_rtc_type;
extern const mp_obj_type_t pyb_uart_type;
extern const mp_obj_type_t pyb_i2c_type;
extern const mp_obj_type_t pyb_spi_type;
typedef struct _pyb_pin_obj_t {
mp_obj_base_t base;
uint16_t pin_id;
uint16_t phys_port;
uint32_t periph;
uint16_t func;
} pyb_pin_obj_t;
uint mp_obj_get_pin(mp_obj_t pin_in);
pyb_pin_obj_t *mp_obj_get_pin_obj(mp_obj_t pin_in);
int pin_get(uint pin);
void pin_set(uint pin, int value);
#endif // __MICROPY_INCLUDED_ESP8266_MODPYB_H__