STM32G0 MCAL 0.0.1
Tiny MCAL for educational purpose.
Loading...
Searching...
No Matches
Spi_Types.h File Reference

Spi Driver More...

#include "Registers.h"

Go to the source code of this file.

Data Structures

struct  _Spi_ConfigType
 Hardware unit configuration structure More...
 
struct  _Spi_HwUnit
 Hardware control unit structure More...
 

Macros

#define SPI_STATIC   static
 
#define SPI_ID_INIT   0x00u
 
#define SPI_ID_DE_INIT   0x01u
 
#define SPI_ID_WRITE_IB   0x02u
 
#define SPI_ID_ASYNC_TRANSMIT   0x03u
 
#define SPI_ID_READ_IB   0x04u
 
#define SPI_ID_SET_UP_EB   0x05u
 
#define SPI_ID_GET_STATUS   0x06u
 
#define SPI_ID_GET_JOB_RESULT   0x07u
 
#define SPI_ID_GET_SEQUENCE_RESULT   0x08u
 
#define SPI_ID_GET_VERSION_INFO   0x09u
 
#define SPI_ID_SYNC_TRANSMIT   0x0Au
 
#define SPI_ID_GET_HWUNIT_STATUS   0x0Bu
 
#define SPI_ID_CANCEL   0x0Cu
 
#define SPI_ID_SET_ASYNC_MODE   0x0Du
 
#define SPI_E_PARAM_CHANNEL   0x0Au
 
#define SPI_E_PARAM_JOB   0x0Bu
 
#define SPI_E_PARAM_SEQ   0x0Cu
 
#define SPI_E_PARAM_LENGTH   0x0Du
 
#define SPI_E_PARAM_UNIT   0x0Eu
 
#define SPI_E_PARAM_POINTER   0x10u
 
#define SPI_E_UNINIT   0x1Au
 
#define SPI_E_ALREADY_INITIALIZED   0x4Au
 

Typedefs

typedef enum _Spi_StatusType Spi_StatusType
 States of the controller SPI.
 
typedef enum _Spi_JobResultType Spi_JobResultType
 States of the Jobs for the SPI.
 
typedef enum _Spi_SeqResultType Spi_SeqResultType
 States of the Sequence for the SPI.
 
typedef uint8 Spi_ChannelType
 Spi Channel Type.
 
typedef uint16 Spi_JobType
 Spi Job Type.
 
typedef uint8 Spi_SequenceType
 Spi Sequence Type.
 
typedef uint8 Spi_HWUnitType
 Spi HWUnit Type.
 
typedef struct _Spi_ConfigType Spi_ConfigType
 Hardware unit configuration structure
 
typedef struct _Spi_HwUnit Spi_HwUnit
 Hardware control unit structure
 
typedef uint8 Spi_DataBufferType
 Spi Data Buffer Type.
 
typedef uint16 Spi_NumberOfDataType
 Spi Number Of Data Type.
 
typedef enum _Spi_AsyncModeType Spi_AsyncModeType
 States of the Asynchronoe Mode for the SPI.
 

Enumerations

enum  _Spi_StatusType { SPI_UNINIT , SPI_IDLE , SPI_BUSY }
 States of the controller SPI. More...
 
enum  _Spi_JobResultType { SPI_JOB_OK , SPI_JOB_PENDING , SPI_JOB_FAILED , SPI_JOB_QUEUED }
 States of the Jobs for the SPI. More...
 
enum  _Spi_SeqResultType { SPI_SEQ_OK , SPI_SEQ_PENDING , SPI_SEQ_FAILED , SPI_SEQ_CANCELED }
 States of the Sequence for the SPI. More...
 
enum  _Spi_AsyncModeType { SPI_POLLING_MODE , SPI_INTERRUPT_MODE }
 States of the Asynchronoe Mode for the SPI. More...
 

Detailed Description

Spi Driver

Author
Manuel Alejandro Ascencio Ysordia

The header contains the type definitions that are used by the Spi module. The file is implemnted as a means of abstraction from the hardware, this way we can avoid to include Arch headers in the actual driver header, making the low level interfaces available for upper layers.

Typedef Documentation

◆ Spi_AsyncModeType

States of the Asynchronoe Mode for the SPI.

Specifies the asynchronous mechanism mode for SPI busses handled asynchronously.

Requirement
SWS_Spi_00382

◆ Spi_ChannelType

Spi Channel Type.

Specifies the identification (ID) for a Channel.

Requirement
SWS_Spi_00378

◆ Spi_ConfigType

Hardware unit configuration structure

This type of the external data structure shall contain the initialization data for the SPI Handler/Driver.

Requirement
SWS_Spi_00372

◆ Spi_DataBufferType

Spi Data Buffer Type.

Type of application data buffer elements.

Requirement
SWS_Spi_00376

◆ Spi_HwUnit

typedef struct _Spi_HwUnit Spi_HwUnit

Hardware control unit structure

This structure contains the hardware unit configuration and the state of the hardware unit pointers to controller structures.

◆ Spi_HWUnitType

Spi HWUnit Type.

Specifies the identification (ID) for a SPI Hardware microcontroller peripheral (unit).

Requirement
SWS_Spi_00381

◆ Spi_JobResultType

States of the Jobs for the SPI.

This type defines a range of specific Jobs status for SPI Handler/Driver.

Requirement
SWS_Spi_00374

◆ Spi_JobType

Spi Job Type.

Specifies the identification (ID) for a Job.

Requirement
SWS_Spi_00379

◆ Spi_NumberOfDataType

Spi Number Of Data Type.

Type for defining the number of data elements to send and / or receive by Channel.

Requirement
SWS_Spi_00377

◆ Spi_SeqResultType

States of the Sequence for the SPI.

This type defines a range of specific Sequences status for SPI Handler/Driver.

Requirement
SWS_Spi_00375

◆ Spi_SequenceType

Spi Sequence Type.

Specifies the identification (ID) for a sequence of jobs.

Requirement
SWS_Spi_00380

◆ Spi_StatusType

States of the controller SPI.

This type defines a range of specific status for SPI Handler/Driver.

Requirement
SWS_Spi_00373

Enumeration Type Documentation

◆ _Spi_AsyncModeType

States of the Asynchronoe Mode for the SPI.

Specifies the asynchronous mechanism mode for SPI busses handled asynchronously.

Requirement
SWS_Spi_00382
Enumerator
SPI_POLLING_MODE 

The asynchronous mechanism is ensured by polling, so interrupts related to SPI busses handled asynchronously are disabled.

SPI_INTERRUPT_MODE 

The asynchronous mechanism is ensured by interrupt, so interrupts related to SPI busses handled asynchronously are enabled.

◆ _Spi_JobResultType

States of the Jobs for the SPI.

This type defines a range of specific Jobs status for SPI Handler/Driver.

Requirement
SWS_Spi_00374
Enumerator
SPI_JOB_OK 

The last transmission of the Job has been finished successfully.

SPI_JOB_PENDING 

The SPI Handler/Driver is performing a SPI Job. The meaning of this status is equal to SPI_BUSY.

SPI_JOB_FAILED 

The last transmission of the Job has failed.

SPI_JOB_QUEUED 

An asynchronous transmit Job has been accepted, while actual transmission for this Job has not started yet.

◆ _Spi_SeqResultType

States of the Sequence for the SPI.

This type defines a range of specific Sequences status for SPI Handler/Driver.

Requirement
SWS_Spi_00375
Enumerator
SPI_SEQ_OK 

The last transmission of the Job has been finished successfully.

SPI_SEQ_PENDING 

The SPI Handler/Driver is performing a SPI Sequence. The meaning of this status is equal to SPI_BUSY.

SPI_SEQ_FAILED 

The last transmission of the Sequence has failed.

SPI_SEQ_CANCELED 

The last transmission of the Sequence has been canceled by user.

◆ _Spi_StatusType

States of the controller SPI.

This type defines a range of specific status for SPI Handler/Driver.

Requirement
SWS_Spi_00373
Enumerator
SPI_UNINIT 

The SPI Handler/Driver is not initialized or not usable.

SPI_IDLE 

The SPI Handler/Driver is not currently transmitting any Job.

SPI_BUSY 

The SPI Handler/Driver is performing a SPI Job (transmit).