G32R430 Device Driver Layer v1.0.4
G32R4xx Device Driver Layer API Reference

Functions

__STATIC_INLINE void DDL_SPI_Enable (SPI_TypeDef *SPIx)
 Enable SPI peripheral.
__STATIC_INLINE void DDL_SPI_Disable (SPI_TypeDef *SPIx)
 Disable SPI peripheral.
__STATIC_INLINE uint32_t DDL_SPI_IsEnabled (SPI_TypeDef *SPIx)
 Check if SPI peripheral is enabled.
__STATIC_INLINE void DDL_SPI_SetMode (SPI_TypeDef *SPIx, uint32_t Mode)
 Set SPI operation mode to Master or Slave.
__STATIC_INLINE uint32_t DDL_SPI_GetMode (SPI_TypeDef *SPIx)
 Get SPI operation mode (Master or Slave).
__STATIC_INLINE void DDL_SPI_SetStandard (SPI_TypeDef *SPIx, uint32_t Standard)
 Set serial protocol used.
__STATIC_INLINE uint32_t DDL_SPI_GetStandard (SPI_TypeDef *SPIx)
 Get serial protocol used.
__STATIC_INLINE void DDL_SPI_SetClockPhase (SPI_TypeDef *SPIx, uint32_t ClockPhase)
 Set clock phase.
__STATIC_INLINE uint32_t DDL_SPI_GetClockPhase (SPI_TypeDef *SPIx)
 Get clock phase.
__STATIC_INLINE void DDL_SPI_SetClockPolarity (SPI_TypeDef *SPIx, uint32_t ClockPolarity)
 Set clock polarity.
__STATIC_INLINE uint32_t DDL_SPI_GetClockPolarity (SPI_TypeDef *SPIx)
 Get clock polarity.
__STATIC_INLINE void DDL_SPI_SetBaudRatePrescaler (SPI_TypeDef *SPIx, uint32_t BaudRate)
 Set baud rate prescaler.
__STATIC_INLINE uint32_t DDL_SPI_GetBaudRatePrescaler (SPI_TypeDef *SPIx)
 Get baud rate prescaler.
__STATIC_INLINE void DDL_SPI_SetTransferBitOrder (SPI_TypeDef *SPIx, uint32_t BitOrder)
 Set transfer bit order.
__STATIC_INLINE uint32_t DDL_SPI_GetTransferBitOrder (SPI_TypeDef *SPIx)
 Get transfer bit order.
__STATIC_INLINE void DDL_SPI_SetTransferDirection (SPI_TypeDef *SPIx, uint32_t TransferDirection)
 Set transfer direction mode.
__STATIC_INLINE uint32_t DDL_SPI_GetTransferDirection (SPI_TypeDef *SPIx)
 Get transfer direction mode.
__STATIC_INLINE void DDL_SPI_SetDataWidth (SPI_TypeDef *SPIx, uint32_t DataWidth)
 Set frame data width.
__STATIC_INLINE uint32_t DDL_SPI_GetDataWidth (SPI_TypeDef *SPIx)
 Get frame data width.

Detailed Description

Function Documentation

◆ DDL_SPI_Disable()

__STATIC_INLINE void DDL_SPI_Disable ( SPI_TypeDef * SPIx)

Disable SPI peripheral.

Note
When disabling the SPI, follow the procedure described in the Reference Manual.
Parameters
SPIxSPI Instance
Return values
None

Definition at line 331 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_Enable()

__STATIC_INLINE void DDL_SPI_Enable ( SPI_TypeDef * SPIx)

Enable SPI peripheral.

Parameters
SPIxSPI Instance
Return values
None

Definition at line 320 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_GetBaudRatePrescaler()

__STATIC_INLINE uint32_t DDL_SPI_GetBaudRatePrescaler ( SPI_TypeDef * SPIx)

◆ DDL_SPI_GetClockPhase()

__STATIC_INLINE uint32_t DDL_SPI_GetClockPhase ( SPI_TypeDef * SPIx)

Get clock phase.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:

Definition at line 420 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_GetClockPolarity()

__STATIC_INLINE uint32_t DDL_SPI_GetClockPolarity ( SPI_TypeDef * SPIx)

Get clock polarity.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:

Definition at line 447 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_GetDataWidth()

__STATIC_INLINE uint32_t DDL_SPI_GetDataWidth ( SPI_TypeDef * SPIx)

Get frame data width.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:

Definition at line 567 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_GetMode()

__STATIC_INLINE uint32_t DDL_SPI_GetMode ( SPI_TypeDef * SPIx)

Get SPI operation mode (Master or Slave).

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:

Definition at line 367 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_GetStandard()

__STATIC_INLINE uint32_t DDL_SPI_GetStandard ( SPI_TypeDef * SPIx)

Get serial protocol used.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:

Definition at line 393 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_GetTransferBitOrder()

__STATIC_INLINE uint32_t DDL_SPI_GetTransferBitOrder ( SPI_TypeDef * SPIx)

Get transfer bit order.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:

Definition at line 511 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_GetTransferDirection()

__STATIC_INLINE uint32_t DDL_SPI_GetTransferDirection ( SPI_TypeDef * SPIx)

Get transfer direction mode.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:

Definition at line 542 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_IsEnabled()

__STATIC_INLINE uint32_t DDL_SPI_IsEnabled ( SPI_TypeDef * SPIx)

Check if SPI peripheral is enabled.

Parameters
SPIxSPI Instance
Return values
Stateof bit (1 or 0).

Definition at line 341 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetBaudRatePrescaler()

__STATIC_INLINE void DDL_SPI_SetBaudRatePrescaler ( SPI_TypeDef * SPIx,
uint32_t BaudRate )

Set baud rate prescaler.

Note
These bits should not be changed when communication is ongoing. SPI BaudRate = fPCLK/Prescaler.
Parameters
SPIxSPI Instance
BaudRateThis parameter can be one of the following values:
Return values
None

Definition at line 467 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetClockPhase()

__STATIC_INLINE void DDL_SPI_SetClockPhase ( SPI_TypeDef * SPIx,
uint32_t ClockPhase )

Set clock phase.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode.
Parameters
SPIxSPI Instance
ClockPhaseThis parameter can be one of the following values:
Return values
None

Definition at line 408 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetClockPolarity()

__STATIC_INLINE void DDL_SPI_SetClockPolarity ( SPI_TypeDef * SPIx,
uint32_t ClockPolarity )

Set clock polarity.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode.
Parameters
SPIxSPI Instance
ClockPolarityThis parameter can be one of the following values:
Return values
None

Definition at line 435 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetDataWidth()

__STATIC_INLINE void DDL_SPI_SetDataWidth ( SPI_TypeDef * SPIx,
uint32_t DataWidth )

Set frame data width.

Parameters
SPIxSPI Instance
DataWidthThis parameter can be one of the following values:
Return values
None

Definition at line 555 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetMode()

__STATIC_INLINE void DDL_SPI_SetMode ( SPI_TypeDef * SPIx,
uint32_t Mode )

Set SPI operation mode to Master or Slave.

Note
This bit should not be changed when communication is ongoing.
Parameters
SPIxSPI Instance
ModeThis parameter can be one of the following values:
Return values
None

Definition at line 355 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetStandard()

__STATIC_INLINE void DDL_SPI_SetStandard ( SPI_TypeDef * SPIx,
uint32_t Standard )

Set serial protocol used.

Note
This bit should be written only when SPI is disabled (SPE = 0) for correct operation.
Parameters
SPIxSPI Instance
StandardThis parameter can be one of the following values:
Return values
None

Definition at line 381 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetTransferBitOrder()

__STATIC_INLINE void DDL_SPI_SetTransferBitOrder ( SPI_TypeDef * SPIx,
uint32_t BitOrder )

Set transfer bit order.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode.
Parameters
SPIxSPI Instance
BitOrderThis parameter can be one of the following values:
Return values
None

Definition at line 499 of file g32r4xx_ddl_spi.h.

◆ DDL_SPI_SetTransferDirection()

__STATIC_INLINE void DDL_SPI_SetTransferDirection ( SPI_TypeDef * SPIx,
uint32_t TransferDirection )

Set transfer direction mode.

Note
For Half-Duplex mode, Rx Direction is set by default. In master mode, the MOSI pin is used and in slave mode, the MISO pin is used for Half-Duplex.
Parameters
SPIxSPI Instance
TransferDirectionThis parameter can be one of the following values:
Return values
None

Definition at line 528 of file g32r4xx_ddl_spi.h.