STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
|
Spi Driver More...
#include "Spi_Cfg.h"
Go to the source code of this file.
Functions | |
void | Spi_Init (const Spi_ConfigType *Config) |
Spi Initialization | |
Std_ReturnType | Spi_DeInit (void) |
Spi De-Initialization | |
Std_ReturnType | Spi_WriteIB (Spi_ChannelType Channel, const Spi_DataBufferType *DataBufferPtr) |
Spi Write in the Internal Buffer | |
Std_ReturnType | Spi_AsyncTransmit (Spi_SequenceType Sequence) |
Spi Asynchronous Transmit | |
Std_ReturnType | Spi_ReadIB (Spi_ChannelType Channel, const Spi_DataBufferType *DataBufferPtr) |
Spi Read in the Internal Buffer | |
Std_ReturnType | Spi_SetupEB (Spi_ChannelType Channel, const Spi_DataBufferType *SrcDataBufferPtr, Spi_DataBufferType *DesDataBufferPtr, Spi_NumberOfDataType Length) |
Spi set up external buffer | |
Spi_StatusType | Spi_GetStatus (void) |
Spi get status | |
Spi_JobResultType | Spi_GetJobResult (Spi_JobType Job) |
Spi get job result | |
Spi_SeqResultType | Spi_GetSequenceResult (Spi_SequenceType Sequence) |
Spi get sequence result | |
void | Spi_GetVersionInfo (Std_VersionInfoType *versioninfo) |
Spi get version information | |
Std_ReturnType | Spi_SyncTransmit (Spi_SequenceType Sequence) |
Spi synchronous transmit | |
Spi_StatusType | Spi_GetHWUnitStatus (Spi_HWUnitType HWUnit) |
Spi get Hardware microcontroller peripheral Unit Status | |
void | Spi_Cancel (Spi_SequenceType Sequence) |
Spi cancel | |
Std_ReturnType | Spi_SetAsyncMode (Spi_AsyncModeType Mode) |
Spi set asynchronous mode | |
Spi Driver
The SPI module provides services to initiate transmissions with a terminal buffer and call callback functions to notify events. Additionally, you have the option of having an external buffer to have more memory capacity. This module has the possibility of several JOBs, Channels and sequences.
Std_ReturnType Spi_AsyncTransmit | ( | Spi_SequenceType | Sequence | ) |
Spi Asynchronous Transmit
Service to transmit data on the SPI bus.
Sequence | Sequence ID |
E_OK | Transmission command has been accepted E_NOT_OK: Transmission command has not been accepted |
void Spi_Cancel | ( | Spi_SequenceType | Sequence | ) |
Spi cancel
Service cancels the specified on-going sequence transmission.
Sequence | Sequence ID |
Std_ReturnType Spi_DeInit | ( | void | ) |
Spi De-Initialization
Service for SPI de-initialization.
E_OK | de-initialisation command has been accepted E_NOT_OK: de-initialisation command has not been accepted |
Spi_StatusType Spi_GetHWUnitStatus | ( | Spi_HWUnitType | HWUnit | ) |
Spi get Hardware microcontroller peripheral Unit Status
This service returns the status of the specified SPI Hardware microcontroller peripheral.
HWUnit | SPI Hardware microcontroller peripheral (unit) ID. |
Spi_StatusType | Spi_StatusType |
Spi_JobResultType Spi_GetJobResult | ( | Spi_JobType | Job | ) |
Spi get job result
This service returns the last transmission result of the specified Job.
Job | Job ID. An invalid job ID will return an undefined result |
Spi_JobResultType | Spi_JobResultType |
Spi_SeqResultType Spi_GetSequenceResult | ( | Spi_SequenceType | Sequence | ) |
Spi get sequence result
This service returns the last transmission result of the specified Sequence.
Sequence | Sequence ID. An invalid sequence ID will return an undefined result |
Spi_SeqResultType | Spi_SeqResultType |
Spi_StatusType Spi_GetStatus | ( | void | ) |
Spi get status
Service returns the SPI Handler/Driver software module status.
Spi_StatusType | Spi_StatusType |
void Spi_GetVersionInfo | ( | Std_VersionInfoType * | versioninfo | ) |
Spi get version information
This service returns the version information of this module.
versioninfo | Pointer to where to store the version information of this module |
void Spi_Init | ( | const Spi_ConfigType * | ConfigPtr | ) |
Spi Initialization
Service for SPI initialization.
ConfigPtr | Pointer to configuration set |
Std_ReturnType Spi_ReadIB | ( | Spi_ChannelType | Channel, |
const Spi_DataBufferType * | DataBufferPtr ) |
Spi Read in the Internal Buffer
Service for reading synchronously one or more data from an IB SPI Handler/Driver Channel specified by parameter.
Channel | Channel ID |
DataBufferPtr | Pointer to destination data buffer in RAM |
E_OK | read command has been accepted E_NOT_OK: read command has not been accepted |
Std_ReturnType Spi_SetAsyncMode | ( | Spi_AsyncModeType | Mode | ) |
Spi set asynchronous mode
Service to set the asynchronous mechanism mode for SPI busses handled asynchronously.
Mode | New mode required. |
E_OK | Setting command has been done E_NOT_OK: setting command has not been accepted |
Std_ReturnType Spi_SetupEB | ( | Spi_ChannelType | Channel, |
const Spi_DataBufferType * | SrcDataBufferPtr, | ||
Spi_DataBufferType * | DesDataBufferPtr, | ||
Spi_NumberOfDataType | Length ) |
Spi set up external buffer
Service to setup the buffers and the length of data for the EB SPI Handler/Driver Channel specified.
Channel | Channel ID |
SrcDataBufferPtr | Pointer to source data buffer |
Length | Length (number of data elements) of the data to be transmitted from SrcDataBufferPtr and/or received from DesDataBufferPtr Min.: 1 Max.: Max of data specified at configuration for this channel |
DesDataBufferPtr | Pointer to destination data buffer in RAM |
E_OK | Setup command has been accepted E_NOT_OK: Setup command has not been accepted |
Std_ReturnType Spi_SyncTransmit | ( | Spi_SequenceType | Sequence | ) |
Spi synchronous transmit
Service to transmit data on the SPI bus.
Sequence | Sequence ID |
E_OK | Transmission has been successful E_NOT_OK: Transmission failed |
Std_ReturnType Spi_WriteIB | ( | Spi_ChannelType | Channel, |
const Spi_DataBufferType * | DataBufferPtr ) |
Spi Write in the Internal Buffer
Service for writing one or more data to an IB SPI Handler/Driver Channel specified by parameter.
Channel | Channel ID |
DataBufferPtr | Pointer to source data buffer. If this pointer is null, it is assumed that the data to be transmitted is not relevant and the default transmit value of this channel will be used instead. |
E_OK | write command has been accepted E_NOT_OK: write command has not been accepted |