#include <halSpi.h>
Go to the source code of this file.
Functions | |
int | HAL_OpenSpi (HAL_SpiMode_t *spiMode, void(*callback)()) |
Opens USART in MSPI mode. fields of HAL_SpiMode_t structure SpiClockMode_t clockMode - spi clock mode (set by user). Must be chosen from: SPI_CLOCK_MODE0 SPI_CLOCK_MODE1 SPI_CLOCK_MODE2 SPI_CLOCK_MODE3 SpiDataOrder_t dataOrder - spi data order (set by user). Must be chosen from: SPI_DATA_MSB_FIRST SPI_DATA_LSB_FIRST SpiBaudRate_t baudRate - spi clock rate (set by user). Must be chosen from: SPI_CLOCK_RATE_62 SPI_CLOCK_RATE_125 SPI_CLOCK_RATE_250 SPI_CLOCK_RATE_500 . | |
int | HAL_CloseSpi (void) |
Releases the channel and pins. | |
int | HAL_WriteSpi (uint8_t *buffer, uint8_t length) |
Writes a number of bytes to the SPI. Callback function will be used to notify when the transmission is finished. The data read are placed to the buffer. |
Definition in file spi.h.
int HAL_CloseSpi | ( | void | ) |
Releases the channel and pins.
int HAL_OpenSpi | ( | HAL_SpiMode_t * | spiMode, | |
void(*)() | callback | |||
) |
Opens USART in MSPI mode.
fields of HAL_SpiMode_t structure
SpiClockMode_t clockMode - spi clock mode (set by user). Must be chosen from:
SPI_CLOCK_MODE0
SPI_CLOCK_MODE1
SPI_CLOCK_MODE2
SPI_CLOCK_MODE3
SpiDataOrder_t dataOrder - spi data order (set by user). Must be chosen from:
SPI_DATA_MSB_FIRST
SPI_DATA_LSB_FIRST
SpiBaudRate_t baudRate - spi clock rate (set by user). Must be chosen from:
SPI_CLOCK_RATE_62
SPI_CLOCK_RATE_125
SPI_CLOCK_RATE_250
SPI_CLOCK_RATE_500
.
[in] | spiMode | - SPI parametrs (baud rate and frame format). |
[in] | callback | - address of the function to notify the application when a transmission was completed. When the synchronous method is used, callback must be NULL. |
int HAL_WriteSpi | ( | uint8_t * | buffer, | |
uint8_t | length | |||
) |
Writes a number of bytes to the SPI.
Callback function will be used to notify when the transmission is finished.
The data read are placed to the buffer.
[in] | buffer | - pointer to the application data buffer |
[in] | length | - number of bytes to transfer |