Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches

Serial Peripheral Interface (SPI) CLIENT Driver using dsPIC MCUs. More...

+ Collaboration diagram for SPI Client Driver:

Files

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.
 

Data Structures

struct  SPI_CLIENT_INTERFACE
 Structure containing the function pointers of SPI CLIENT driver. More...
 
struct  SPI1_CONFIG
 Defines the SPI1 configuration. More...
 

Enumerations

enum  SPI1_CLIENT_USER_CONFIG { CLIENT_CONFIG }
 Enum list is the Custom names for the SPI1 CLIENT multiple configuration, configured by user in MCC Melody user interface. More...
 

Functions

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.
 

Variables

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.
 

Detailed Description

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ 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
none
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()

void SPI1_Close ( void )
Precondition
The SPI1_Open function must be called before calling this function.
Parameters
none
Returns
none

Definition at line 139 of file spi1.c.

+ Here is the caller graph for this function:

◆ SPI1_Deinitialize()

void SPI1_Deinitialize ( void )
Parameters
none
Returns
none

Definition at line 126 of file spi1.c.

+ Here is the call graph for this function:

◆ SPI1_Initialize()

void SPI1_Initialize ( void )
Parameters
none
Returns
none

Definition at line 86 of file spi1.c.

+ Here is the caller graph for this function:

◆ SPI1_IsRxReady()

bool SPI1_IsRxReady ( void )
Precondition
The SPI1_Open function must be called before calling this function.
Parameters
none
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
none
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.

Variable Documentation

◆ SPI1_Client

const struct SPI_CLIENT_INTERFACE SPI1_Client
extern

Definition at line 53 of file spi1.c.