diff options
| author | Daniel Campora | 2015-05-02 22:57:51 +0200 |
|---|---|---|
| committer | Daniel Campora | 2015-05-03 11:26:56 +0200 |
| commit | 8c8d7f3c60ff10e90243b47172a6979bdf2b9fd1 (patch) | |
| tree | 5471689adaed9d228912646c49c4f388928ddb1e /cc3200/mods/pybpin.h | |
| parent | e4c899a08cdd8ed36e2e9a1ae3fbe362ab73563f (diff) | |
cc3200: Clean up pyb.Pin
Remove unused and unneeded functions, also create Pin.get_config() that
returns the whole configuration of the pin.
This reduces code size by ~500 bytes.
Diffstat (limited to 'cc3200/mods/pybpin.h')
| -rw-r--r-- | cc3200/mods/pybpin.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/cc3200/mods/pybpin.h b/cc3200/mods/pybpin.h index 417e91bf6..a31a41528 100644 --- a/cc3200/mods/pybpin.h +++ b/cc3200/mods/pybpin.h @@ -28,13 +28,15 @@ #ifndef PYBPIN_H_ #define PYBPIN_H_ -// This file requires pin_defs_xxx.h (which has port specific enums and -// defines, so we include it here. It should never be included directly - -#include MICROPY_PIN_DEFS_PORT_H - #define PYBPIN_ANALOG_TYPE 0xFF +enum { + PORT_A0 = GPIOA0_BASE, + PORT_A1 = GPIOA1_BASE, + PORT_A2 = GPIOA2_BASE, + PORT_A3 = GPIOA3_BASE +}; + typedef struct { const mp_obj_base_t base; const qstr name; @@ -70,7 +72,6 @@ void pin_config(pin_obj_t *self, uint af, uint mode, uint type, uint strength); void pin_extint_register(pin_obj_t *self, uint32_t intmode, uint32_t priority); 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(const mp_obj_dict_t *named_pins, uint pin_num); pin_obj_t *pin_find_pin_by_port_bit (const mp_obj_dict_t *named_pins, uint port, uint bit); uint32_t pin_get_mode(const pin_obj_t *self); uint32_t pin_get_type(const pin_obj_t *self); |
