diff options
| author | Daniel Campora | 2015-08-18 14:07:19 +0200 |
|---|---|---|
| committer | Daniel Campora | 2015-09-10 07:59:03 +0200 |
| commit | e3f8777ee8b50ef8ed45493812a6c0bf94ed38fa (patch) | |
| tree | d4a0e692b1c9b313549f66fecc464014e0a74c38 /cc3200/mods/pybpin.h | |
| parent | ec8589e4c9e99dc28ff8c1fc981bcb9af591a1dc (diff) | |
cc3200: Implement new Pin API.
Diffstat (limited to 'cc3200/mods/pybpin.h')
| -rw-r--r-- | cc3200/mods/pybpin.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/cc3200/mods/pybpin.h b/cc3200/mods/pybpin.h index 6f969d0a4..cefc6e03b 100644 --- a/cc3200/mods/pybpin.h +++ b/cc3200/mods/pybpin.h @@ -28,8 +28,6 @@ #ifndef PYBPIN_H_ #define PYBPIN_H_ -#define PYBPIN_ANALOG_TYPE 0xFF - enum { PORT_A0 = GPIOA0_BASE, PORT_A1 = GPIOA1_BASE, @@ -41,12 +39,13 @@ typedef struct { const mp_obj_base_t base; const qstr name; const uint32_t port; - uint16_t type; + uint16_t pull; const uint8_t bit; const uint8_t pin_num; - uint8_t af; + int8_t af; uint8_t strength; - uint8_t mode; + uint8_t mode; // this is now a combination of type and mode + int8_t value; // -1 means no defined value bool isused; } pin_obj_t; @@ -63,11 +62,11 @@ typedef struct { const pin_named_pin_t *named_pins; } pin_named_pins_obj_t; -extern const mp_obj_type_t pin_cpu_pins_obj_type; -extern const mp_obj_dict_t pin_cpu_pins_locals_dict; +extern const mp_obj_type_t pin_board_pins_obj_type; +extern const mp_obj_dict_t pin_board_pins_locals_dict; void pin_init0(void); -void pin_config(pin_obj_t *self, uint af, uint mode, uint type, uint strength); +void pin_config(pin_obj_t *self, int af, uint mode, uint type, int value, uint strength); pin_obj_t *pin_find(mp_obj_t user_obj); pin_obj_t *pin_find_named_pin(const mp_obj_dict_t *named_pins, mp_obj_t name); pin_obj_t *pin_find_pin_by_port_bit (const mp_obj_dict_t *named_pins, uint port, uint bit); |
