Replacement for regular GPIO (DigitalIn, DigitalOut, DigitalInOut) classes which has superior speed. (modified for use opendrain in stm32)
Fork of FastIO by
Diff: FastIO_Unsupported.h
- Revision:
- 2:1a6ed4b84590
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FastIO_Unsupported.h Fri Jul 04 17:28:45 2014 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + +typedef struct { + DigitalInOut *_pin; +} fastio_vars; + +#define INIT_PIN container._pin = new DigitalInOut(pin) +#define DESTROY_PIN delete(container._pin) + +#define SET_DIR_INPUT container._pin->input() +#define SET_DIR_OUTPUT container._pin->output() +#define SET_MODE(pull) container._pin->mode(pull) + +#define WRITE_PIN_SET container._pin->write(1) +#define WRITE_PIN_CLR container._pin->write(0) + +#define READ_PIN container._pin->read() +