|
Serial Peripheral Interface Reusable Driver v1.1
This project implements SPI reusable driver that can be adapted to various microcontrollers.
|
This module contains the implementation for the Serial Peripheral Interface (SPI). More...
#include "spi_cfg.h"
Functions | |
| const SpiConfig_t *const | SPI_ConfigGet (void) |
| size_t | SPI_configSizeGet (void) |
Variables | |
| const SpiConfig_t | SpiConfig [] |
This module contains the implementation for the Serial Peripheral Interface (SPI).
| 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:
| const SpiConfig_t SpiConfig[] |
The following array contains the configuration data for each Serial Peripheral Interface. Each row represent a single SPI configuration. Each column is representing a member of the SpiConfig_t structure. This table is read in by SPI_Init, where each channel is then set up based on this table. The SPI_CHANNELS_NUMBER constant should be agreed with the number of row.