|
PER Firmware
|
G4 SPI. More...
Functions | |
| bool | PHAL_SPI_init (SPI_InitConfig_t *cfg) |
| Initilize SPI peripheral with the configuired structure. | |
| bool | PHAL_SPI_transfer_noDMA (SPI_InitConfig_t *spi, const uint8_t *out_data, uint32_t txlen, uint32_t rxlen, uint8_t *in_data) |
| SPI handle. | |
| bool | PHAL_SPI_transfer (SPI_InitConfig_t *spi, const uint8_t *out_data, const uint32_t data_len, uint8_t *in_data) |
| bool | PHAL_SPI_busy (SPI_InitConfig_t *cfg) |
| Check for current SPI transaction to complete. | |
| void | PHAL_SPI_ForceReset (SPI_InitConfig_t *spi) |
| __attribute__ ((weak)) | |
| uint8_t | PHAL_SPI_readByte (SPI_InitConfig_t *spi, uint8_t address, bool skipDummy) |
| Blocking function to read a single byte from a SPI device. Useful for Initilization functions that just need to read a single byte in a blocking function. | |
| uint8_t | PHAL_SPI_writeByte (SPI_InitConfig_t *spi, uint8_t address, uint8_t writeDat) |
| Blocking function to write a single byte to a SPI device. Useful for Initilization functions that just need to write a single byte in a blocking function. | |
Variables | |
| uint32_t | APB2ClockRateHz |
| uint32_t | APB1ClockRateHz |
G4 SPI.
| bool PHAL_SPI_busy | ( | SPI_InitConfig_t * | cfg | ) |
Check for current SPI transaction to complete.
| cfg | Spi config |
| bool PHAL_SPI_init | ( | SPI_InitConfig_t * | handle | ) |
Initilize SPI peripheral with the configuired structure.
| handle | SPI handle to configure. |
| uint8_t PHAL_SPI_readByte | ( | SPI_InitConfig_t * | spi, |
| uint8_t | address, | ||
| bool | skipDummy ) |
Blocking function to read a single byte from a SPI device. Useful for Initilization functions that just need to read a single byte in a blocking function.
| spi | Spi handle |
| address | Address of data to read |
| skipDummy | Return the 3rd byte read instead of the 2nd byte |
| bool PHAL_SPI_transfer_noDMA | ( | SPI_InitConfig_t * | spi, |
| const uint8_t * | out_data, | ||
| uint32_t | txlen, | ||
| uint32_t | rxlen, | ||
| uint8_t * | in_data ) |
SPI handle.
| spi | SPI handle |
| out_data | Address of data buffer to put on MOSI line |
| txlen | Number of SPI Packets to Send |
| rxlen | Number of SPI Packets to Receive |
| in_data | Address of data buffer to put data coming in MISO line |
| uint8_t PHAL_SPI_writeByte | ( | SPI_InitConfig_t * | spi, |
| uint8_t | address, | ||
| uint8_t | writeDat ) |
Blocking function to write a single byte to a SPI device. Useful for Initilization functions that just need to write a single byte in a blocking function.
| spi | Spi handle |
| address | Address of data to read |
| writeDat | Data to write to address |