Alex Borisevich
/
OpenBCI
OpenBCI 32bit board variation with STM32L476 mircocontroller and mbed support
PlatformDefs.h@0:2cb59ea20ace, 2016-12-04 (annotated)
- Committer:
- akpc806a
- Date:
- Sun Dec 04 03:38:44 2016 +0000
- Revision:
- 0:2cb59ea20ace
- Child:
- 1:4683702d7ad8
OpenBCI 32bit board variation with STM32L476 mircocontroller and mbed support
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
akpc806a | 0:2cb59ea20ace | 1 | // these are definitions to port OpenBCI code to STM32 mbed framework |
akpc806a | 0:2cb59ea20ace | 2 | //#define DSPI0 int |
akpc806a | 0:2cb59ea20ace | 3 | |
akpc806a | 0:2cb59ea20ace | 4 | #define boolean unsigned char |
akpc806a | 0:2cb59ea20ace | 5 | #define byte unsigned char |
akpc806a | 0:2cb59ea20ace | 6 | |
akpc806a | 0:2cb59ea20ace | 7 | |
akpc806a | 0:2cb59ea20ace | 8 | |
akpc806a | 0:2cb59ea20ace | 9 | #define HIGH 1 |
akpc806a | 0:2cb59ea20ace | 10 | #define LOW 0 |
akpc806a | 0:2cb59ea20ace | 11 | |
akpc806a | 0:2cb59ea20ace | 12 | #include "mbed.h" |
akpc806a | 0:2cb59ea20ace | 13 | #define delay(ms) wait_ms(ms) |
akpc806a | 0:2cb59ea20ace | 14 | #define delayMicroseconds(us) wait_us(us) |
akpc806a | 0:2cb59ea20ace | 15 | |
akpc806a | 0:2cb59ea20ace | 16 | #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) |
akpc806a | 0:2cb59ea20ace | 17 | |
akpc806a | 0:2cb59ea20ace | 18 | #define lowByte(w) ((uint8_t) ((w) & 0xff)) |
akpc806a | 0:2cb59ea20ace | 19 | #define highByte(w) ((uint8_t) ((w) >> 8)) |
akpc806a | 0:2cb59ea20ace | 20 | |
akpc806a | 0:2cb59ea20ace | 21 | #define bitRead(value, bit) (((value) >> (bit)) & 0x01) |
akpc806a | 0:2cb59ea20ace | 22 | #define bitSet(value, bit) ((value) |= (1UL << (bit))) |
akpc806a | 0:2cb59ea20ace | 23 | #define bitClear(value, bit) ((value) &= ~(1UL << (bit))) |
akpc806a | 0:2cb59ea20ace | 24 | #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) |
akpc806a | 0:2cb59ea20ace | 25 | |
akpc806a | 0:2cb59ea20ace | 26 | #include "PlatformUart.h" |
akpc806a | 0:2cb59ea20ace | 27 | extern platformUart Serial0; |
akpc806a | 0:2cb59ea20ace | 28 | |
akpc806a | 0:2cb59ea20ace | 29 | #include "PlatformSPI.h" |
akpc806a | 0:2cb59ea20ace | 30 | |
akpc806a | 0:2cb59ea20ace | 31 | #include "PlatformGPIO.h" |
akpc806a | 0:2cb59ea20ace | 32 | |
akpc806a | 0:2cb59ea20ace | 33 | // TODO: SD card stuff |
akpc806a | 0:2cb59ea20ace | 34 | #define stampSD(x) |
akpc806a | 0:2cb59ea20ace | 35 | #define writeDataToSDcard(x) |
akpc806a | 0:2cb59ea20ace | 36 | #define setupSDcard(x) 1 |
akpc806a | 0:2cb59ea20ace | 37 | #define closeSDfile(x) 0 |