diff options
author | Dave Hylands <dhylands@gmail.com> | 2016-02-10 21:20:14 -0800 |
---|---|---|
committer | Dave Hylands <dhylands@gmail.com> | 2016-02-10 21:20:14 -0800 |
commit | 7bb501ef9f724e9ecd209d1fa46b640214928d2a (patch) | |
tree | 1e5da9d24e428432f7f755b81b636650f4e8da17 /stmhal/pin.h | |
parent | e372e83b3042cb48fbe5706522d92f7aa5404ae6 (diff) | |
download | micropython-7bb501ef9f724e9ecd209d1fa46b640214928d2a.tar.gz micropython-7bb501ef9f724e9ecd209d1fa46b640214928d2a.zip |
stmhal: Add a function for setting the pin alternate function
mp_hal_gpio_set_af will search for a given function and unit
and set the alternate function to the alternate function index
found.
Diffstat (limited to 'stmhal/pin.h')
-rw-r--r-- | stmhal/pin.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/stmhal/pin.h b/stmhal/pin.h index 492803871f..df7df0ce2e 100644 --- a/stmhal/pin.h +++ b/stmhal/pin.h @@ -24,10 +24,14 @@ * THE SOFTWARE. */ +#ifndef __MICROPY_INCLUDED_STMHAL_PIN_H__ +#define __MICROPY_INCLUDED_STMHAL_PIN_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 +#include "py/obj.h" typedef struct { mp_obj_base_t base; @@ -93,3 +97,5 @@ const pin_obj_t *pin_find_named_pin(const mp_obj_dict_t *named_pins, mp_obj_t na const pin_af_obj_t *pin_find_af(const pin_obj_t *pin, uint8_t fn, uint8_t unit); const pin_af_obj_t *pin_find_af_by_index(const pin_obj_t *pin, mp_uint_t af_idx); const pin_af_obj_t *pin_find_af_by_name(const pin_obj_t *pin, const char *name); + +#endif // __MICROPY_INCLUDED_STMHAL_PIN_H__ |