Cleanups for STM32F7

This commit is contained in:
Scott Lahteine
2018-01-15 02:28:39 -06:00
parent a0246c5c96
commit 42933c804a
18 changed files with 988 additions and 1293 deletions

View File

@@ -26,10 +26,10 @@
* These use GPIO functions instead of Direct Port Manipulation, as on AVR.
*/
#ifndef _FASTIO_STM32F7_H
#define _FASTIO_STM32F7_H
#ifndef _FASTIO_STM32F7_H
#define _FASTIO_STM32F7_H
#define _BV(bit) (1 << (bit))
#define _BV(bit) (1 << (bit))
#define READ(IO) digitalRead(IO)
#define WRITE(IO, v) digitalWrite(IO,v)
@@ -38,17 +38,17 @@
#define _GET_MODE(IO)
#define _SET_MODE(IO,M) pinMode(IO, M)
#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */
#define _SET_OUTPUT(IO) pinMode(IO, OUTPUT) /*!< Output Push Pull Mode & GPIO_NOPULL */
#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */
#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */
#define SET_INPUT_PULLDOW(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */
#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); WRITE(IO, LOW); }while(0)
#define SET_INPUT(IO) _SET_MODE(IO, INPUT) /*!< Input Floating Mode */
#define SET_INPUT_PULLUP(IO) _SET_MODE(IO, INPUT_PULLUP) /*!< Input with Pull-up activation */
#define SET_INPUT_PULLDOW(IO) _SET_MODE(IO, INPUT_PULLDOWN) /*!< Input with Pull-down activation */
#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); WRITE(IO, LOW); }while(0)
#define GET_INPUT(IO)
#define GET_OUTPUT(IO)
#define GET_TIMER(IO)
#define GET_INPUT(IO)
#define GET_OUTPUT(IO)
#define GET_TIMER(IO)
#define OUT_WRITE(IO, v) { _SET_OUTPUT(IO); WRITE(IO, v); }
#endif /* _FASTIO_STM32F7_H */
#endif // _FASTIO_STM32F7_H