|
Serial Peripheral Interface Reusable Driver v1.1
This project implements SPI reusable driver that can be adapted to various microcontrollers.
|
This module contains interface definitions for the SPI configuration. This is the header file for the definition of the interface for retrieving the Serial Peripheral interface configuration table. More...
#include <stdio.h>

Go to the source code of this file.
Data Structures | |
| struct | SpiConfig_t |
Macros | |
| #define | SPI_PORTS_NUMBER 4U |
Enumerations | |
| enum | SpiChannel_t { SPI_CHANNEL1 , SPI_CHANNEL2 , SPI_CHANNEL3 , SPI_CHANNEL4 , SPI_MAX_CHANNEL } |
| enum | SpiMode_t { SPI_MODE0 , SPI_MODE1 , SPI_MODE2 , SPI_MODE3 , SPI_MAX_MODE } |
| enum | SpiHierarchy_t { SPI_SLAVE , SPI_MASTER , SPI_MAX_HIERARCHY } |
| enum | SpiBaudRate_t { SPI_FPCLK2 , SPI_FPCLK4 , SPI_FPCLK8 , SPI_FPCLK16 , SPI_FPCLK32 , SPI_FPCLK64 , SPI_FPCLK128 , SPI_FPCLK256 , SPI_MAX_FPCLK } |
| enum | SpiSlaveSelect_t { SPI_SOFTWARE_NSS , SPI_HARDWARE_NSS_ENABLED , SPI_HARDWARE_NSS_DISABLED , SPI_MAX_NSS } |
| enum | SpiFrameFormat_t { SPI_MSB , SPI_LSB , SPI_MAX_FF } |
| enum | SpiTypeTransfer_t { SPI_FULL_DUPLEX , SPI_RECEIVE_MODE , SPI_MAX_DF } |
| enum | SpiDataSize_t { SPI_8BITS , SPI_16BITS , SPI_MAX_BITS } |
Functions | |
| const SpiConfig_t *const | SPI_ConfigGet (void) |
| size_t | SPI_configSizeGet (void) |
This module contains interface definitions for the SPI configuration. This is the header file for the definition of the interface for retrieving the Serial Peripheral interface configuration table.
| #define SPI_PORTS_NUMBER 4U |
Defines the number of ports on the processor.
| enum SpiBaudRate_t |
Define the baud rate control.
| enum SpiChannel_t |
| enum SpiDataSize_t |
| enum SpiFrameFormat_t |
| enum SpiHierarchy_t |
| enum SpiMode_t |
| enum SpiSlaveSelect_t |
Define the slave select pin management (NSS input). The slave
selector could be configured by software or hardware. SW_NSS: Slave select is driven internally. NSS pin remains free. HW_NSS_ENABLED: Device operates in master mode (NSS pin is used). HW_NSS_DISABLED: Device operates in slave mode (NSS pin is used).
| enum SpiTypeTransfer_t |
| const SpiConfig_t *const SPI_ConfigGet | ( | void | ) |
Description: This function is used to initialize the SPI based on the configuration table defined in spi_cfg module.
PRE-CONDITION: configuration table needs to be populated (sizeof > 0).
POST-CONDITION: A constant pointer to the first member of the configuration table will be returned.
Example:
| size_t SPI_configSizeGet | ( | void | ) |
Description: This function is used to get the size of the configuration table.
PRE-CONDITION: configuration table needs to be populated (sizeof > 0)
POST-CONDITION: The size of the configuration table will be returned.
Example: