Serial Peripheral Interface (SPI) CLIENT Driver using dsPIC MCUs.
More...
|
file | spi1.h |
| This is the generated driver header file for the SPI1 driver.
|
|
file | spi1.c |
| This is the generated driver source file for SPI1 driver.
|
|
|
void | SPI1_Initialize (void) |
| Initializes SPI1 module, using the given initialization data. This function must be called before any other SPI1 function is called.
|
|
void | SPI1_Deinitialize (void) |
| Deinitializes the SPI1 to POR values.
|
|
void | SPI1_Close (void) |
| Disables the SPI1 module.
|
|
bool | SPI1_Open (uint8_t spiConfigIndex) |
| Configures SPI1 module with user defined unique configuration.
|
|
uint8_t | SPI1_ByteExchange (uint8_t byteData) |
| Exchanges one byte of data. This is a blocking function.
|
|
void | SPI1_ByteWrite (uint8_t byteData) |
| Writes one byte of data.
|
|
uint8_t | SPI1_ByteRead (void) |
| Reads one byte of data from SPI1.
|
|
bool | SPI1_IsRxReady (void) |
| Returns a boolean value if data is available to read.
|
|
bool | SPI1_IsTxReady (void) |
| Returns a boolean value if data can be written.
|
|
|
const struct SPI_CLIENT_INTERFACE | SPI1_Client |
| Structure object of type SPI_CLIENT_INTERFACE assigned with name displayed in the Melody Driver User interface. A structure pointer can be used to achieve portability across the SPI CLIENT having same interface structure.
|
|
◆ SPI1_CLIENT_USER_CONFIG
- Note
- The enum list in the Help document might be just a reference to illustrate multiple configuration. Generated enum list is based on the configuration done by user in the MCC Melody user interface
Enumerator |
---|
CLIENT_CONFIG | Custom name for configuration setting: SPI Mode : Mode 3
|
Definition at line 114 of file spi1.h.
◆ SPI1_ByteExchange()
uint8_t SPI1_ByteExchange |
( |
uint8_t | byteData | ) |
|
- Precondition
- The SPI1_IsTxReady function must be called before calling this function.
- Parameters
-
[in] | data- | Data byte to be exchanged.
|
- Returns
- none
Definition at line 157 of file spi1.c.
◆ SPI1_ByteRead()
uint8_t SPI1_ByteRead |
( |
void | | ) |
|
- Precondition
- The SPI1_IsRxReady function must be called before calling this function. Also note that byte read must be after byte write sequence.
- Parameters
-
- Returns
- Data read from SPI1.
Definition at line 184 of file spi1.c.
◆ SPI1_ByteWrite()
void SPI1_ByteWrite |
( |
uint8_t | byteData | ) |
|
- Precondition
- The SPI1_IsTxReady function must be called before calling this function. Also note that every byte write has to be followed by a byte read.
- Parameters
-
[in] | byteData | - Data to be written.
|
- Returns
- none
Definition at line 174 of file spi1.c.
◆ SPI1_Close()
- Precondition
- The SPI1_Open function must be called before calling this function.
- Parameters
-
- Returns
- none
Definition at line 139 of file spi1.c.
◆ SPI1_Deinitialize()
void SPI1_Deinitialize |
( |
void | | ) |
|
- Parameters
-
- Returns
- none
Definition at line 126 of file spi1.c.
◆ SPI1_Initialize()
void SPI1_Initialize |
( |
void | | ) |
|
- Parameters
-
- Returns
- none
Definition at line 86 of file spi1.c.
◆ SPI1_IsRxReady()
bool SPI1_IsRxReady |
( |
void | | ) |
|
- Precondition
- The SPI1_Open function must be called before calling this function.
- Parameters
-
- Returns
- true - Data available to read
-
false - Data not available to read
Definition at line 194 of file spi1.c.
◆ SPI1_IsTxReady()
bool SPI1_IsTxReady |
( |
void | | ) |
|
- Precondition
- The SPI1_Open function must be called before calling this function.
- Parameters
-
- Returns
- true - Data can be written
-
false - Data buffer is full
Definition at line 199 of file spi1.c.
◆ SPI1_Open()
bool SPI1_Open |
( |
uint8_t | spiConfigIndex | ) |
|
- Parameters
-
[in] | spiConfigIndex | - SPI1_USER_CONFIG Enum value |
- Returns
- bool true - SPI1 is configured successfully.
-
bool false - SPI1 is not configured successfully.
Definition at line 144 of file spi1.c.
◆ SPI1_Client