Alex Borisevich
/
OpenBCI
OpenBCI 32bit board variation with STM32L476 mircocontroller and mbed support
PlatformDefs.h@1:4683702d7ad8, 2017-01-22 (annotated)
- Committer:
- akpc806a
- Date:
- Sun Jan 22 04:10:11 2017 +0000
- Revision:
- 1:4683702d7ad8
- Parent:
- 0:2cb59ea20ace
OpenBCI 32bit board variation with STM32L476 mircocontroller and mbed support. Version V2 of firmware, forked from the same official version for the PIC32 board.
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 | 1:4683702d7ad8 | 7 | #define __USER_ISR |
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 | 1:4683702d7ad8 | 28 | extern platformUart_Dummy Serial1; |
akpc806a | 0:2cb59ea20ace | 29 | |
akpc806a | 0:2cb59ea20ace | 30 | #include "PlatformSPI.h" |
akpc806a | 0:2cb59ea20ace | 31 | |
akpc806a | 0:2cb59ea20ace | 32 | #include "PlatformGPIO.h" |
akpc806a | 0:2cb59ea20ace | 33 | |
akpc806a | 0:2cb59ea20ace | 34 | // TODO: SD card stuff |
akpc806a | 0:2cb59ea20ace | 35 | #define stampSD(x) |
akpc806a | 0:2cb59ea20ace | 36 | #define writeDataToSDcard(x) |
akpc806a | 0:2cb59ea20ace | 37 | #define setupSDcard(x) 1 |
akpc806a | 0:2cb59ea20ace | 38 | #define closeSDfile(x) 0 |
akpc806a | 1:4683702d7ad8 | 39 | |
akpc806a | 1:4683702d7ad8 | 40 | #define setIntVector(x,y) |
akpc806a | 1:4683702d7ad8 | 41 | #define setIntPriority(x,y,z) |
akpc806a | 1:4683702d7ad8 | 42 | #define clearIntFlag(x) |
akpc806a | 1:4683702d7ad8 | 43 | //#define setIntEnable(x) |
akpc806a | 1:4683702d7ad8 | 44 | |
akpc806a | 1:4683702d7ad8 | 45 | #define PORTA 0 |
akpc806a | 1:4683702d7ad8 | 46 | #define _EXTERNAL_4_IRQ 0 |
akpc806a | 1:4683702d7ad8 | 47 | |
akpc806a | 1:4683702d7ad8 | 48 | #define millis() time(NULL) |
akpc806a | 1:4683702d7ad8 | 49 | |
akpc806a | 1:4683702d7ad8 | 50 | #define OPENBCI_SOP_SYMBOL 0xA0//'A' |