circuitpython/stmhal/usrsw.h
Damien George 6125ba4a7f stmhal: Make switch a class, to follow suit of all other modules.
Instead of pyb.switch() as a function, it's more consistent (with
respect to all the other modules and peripherals) to have
pyb.Switch() create a switch object.  This then generalises to having
multiple switches.  Call the object to get its state.  Use sw.callback
to set the callback function for when the switch is pressed.
2014-04-21 18:23:50 +01:00

5 lines
92 B
C

void switch_init0(void);
int switch_get(void);
extern const mp_obj_type_t pyb_switch_type;