Add beginTransaction to HAL SPI (#9019)

This commit is contained in:
revilor
2018-01-03 12:12:25 +01:00
committed by Scott Lahteine
parent fc67c64b8f
commit 959a2d2527
6 changed files with 122 additions and 3 deletions

View File

@@ -55,6 +55,14 @@
#define SPI_SPEED_5 5 // Set SCK rate to 1/32 of max rate
#define SPI_SPEED_6 6 // Set SCK rate to 1/64 of max rate
#define SPI_LSBFIRST 0
#define SPI_MSBFIRST 1
#define SPI_DATAMODE_0 0x00
#define SPI_DATAMODE_1 0x04
#define SPI_DATAMODE_2 0x08
#define SPI_DATAMODE_3 0x0C
// Standard SPI functions
/** Initialise SPI bus */
void spiBegin(void);
@@ -68,5 +76,7 @@ uint8_t spiRec(void);
void spiRead(uint8_t* buf, uint16_t nbyte);
/** Write token and then write from 512 byte buffer to SPI (for SD card) */
void spiSendBlock(uint8_t token, const uint8_t* buf);
/** Begin SPI transaction, set clock, bit order, data mode */
void spiBeginTransaction(uint32_t spiClock, uint8_t bitOrder, uint8_t dataMode);
#endif // _SPI_H_