G32R430 Device Driver Layer v1.0.4
G32R4xx Device Driver Layer API Reference
g32r4xx_ddl_i2c.h File Reference

Header file of I2C DDL module. More...

#include "g32r4xx.h"

Go to the source code of this file.

Data Structures

struct  DDL_I2C_InitTypeDef

Macros

#define DDL_I2C_MAX_SPEED_STANDARD   100000U
#define DDL_I2C_MAX_SPEED_FAST   400000U
#define DDL_I2C_STS1_STARTFLG   I2C_STS1_STARTFLG
#define DDL_I2C_STS1_ADDRFLG   I2C_STS1_ADDRFLG
#define DDL_I2C_STS1_BTCFLG   I2C_STS1_BTCFLG
#define DDL_I2C_STS1_ADDR10FLG   I2C_STS1_ADDR10FLG
#define DDL_I2C_STS1_STOPFLG   I2C_STS1_STOPFLG
#define DDL_I2C_STS1_RXBNEFLG   I2C_STS1_RXBNEFLG
#define DDL_I2C_STS1_TXBEFLG   I2C_STS1_TXBEFLG
#define DDL_I2C_STS1_BERRFLG   I2C_STS1_BERRFLG
#define DDL_I2C_STS1_ALFLG   I2C_STS1_ALFLG
#define DDL_I2C_STS1_AEFLG   I2C_STS1_AEFLG
#define DDL_I2C_STS1_OVRURFLG   I2C_STS1_OVRURFLG
#define DDL_I2C_STS1_PECEFLG   I2C_ISR_PECERR
#define DDL_I2C_STS1_TTEFLG   I2C_ISR_TIMEOUT
#define DDL_I2C_STS1_SMALERT   I2C_ISR_SMALERT
#define DDL_I2C_STS2_MSFLG   I2C_STS2_MSFLG
#define DDL_I2C_STS2_BUSBSYFLG   I2C_STS2_BUSBSYFLG
#define DDL_I2C_STS2_TRFLG   I2C_STS2_TRFLG
#define DDL_I2C_STS2_GENCALLFLG   I2C_STS2_GENCALLFLG
#define DDL_I2C_STS2_SMBDADDRFLG   I2C_STS2_SMBDADDRFLG
#define DDL_I2C_STS2_SMMHADDR   I2C_STS2_SMMHADDR
#define DDL_I2C_STS2_DUALADDRFLG   I2C_STS2_DUALADDRFLG
#define DDL_I2C_EVENT_MASTER_MODE_SELECT   0x00030001u /* BUSBSYFLG, MSFLG and STARTFLG flag */
#define DDL_I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED   0x00070082u /* BUSBSYFLG, MSFLG, ADDRFLG, TXBEFLG and TRFLG flags */
#define DDL_I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED   0x00030002u /* BUSBSYFLG, MSFLG and ADDRFLG flags */
#define DDL_I2C_EVENT_MASTER_MODE_ADDRESS10   0x00030008u /* BUSBSYFLG, MSFLG and ADDR10FLG flags */
#define DDL_I2C_EVENT_MASTER_BYTE_RECEIVED   0x00030040u /* BUSBSYFLG, MSFLG and RXBNEFLG flags */
#define DDL_I2C_EVENT_MASTER_BYTE_TRANSMITTING   0x00070080u /* TRFLG, BUSBSYFLG, MSFLG, TXBEFLG flags */
#define DDL_I2C_EVENT_MASTER_BYTE_TRANSMITTED   0x00070084u /* TRFLG, BUSBSYFLG, MSFLG, TXBEFLG and BTCFLG flags */
#define DDL_I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED   0x00020002u /* BUSBSYFLG and ADDRFLG flags */
#define DDL_I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED   0x00060082u /* TRFLG, BUSBSYFLG, TXBEFLG and ADDRFLG flags */
#define DDL_I2C_EVENT_SLAVE_RECEIVER_SECONDADDRESS_MATCHED   0x00820000u /* DUALF and BUSBSYFLG flags */
#define DDL_I2C_EVENT_SLAVE_TRANSMITTER_SECONDADDRESS_MATCHED   0x00860080u /* DUALF, TRFLG, BUSBSYFLG and TXBEFLG flags */
#define DDL_I2C_EVENT_SLAVE_GENERALCALLADDRESS_MATCHED   0x00120000u /* GENCALL and BUSBSYFLG flags */
#define DDL_I2C_EVENT_SLAVE_BYTE_RECEIVED   0x00020040u /* BUSBSYFLG and RXBNEFLG flags */
#define DDL_I2C_EVENT_SLAVE_BYTE_RECEIVED1   0x00820040u /* DUALADDRFLG, BUSBSYFLG and RXBNEFLG flags */
#define DDL_I2C_EVENT_SLAVE_BYTE_RECEIVED2   0x00120040u /* GENCALLFLG, BUSBSYFLG and RXBNEFLG flags */
#define DDL_I2C_EVENT_SLAVE_STOP_DETECTED   0x00000010u /* STOPFLG flag */
#define DDL_I2C_EVENT_SLAVE_BYTE_TRANSMITTED   0x00060084u /* TRFLG, BUSBSYFLG, TXBEFLG and BTCFLG flags */
#define DDL_I2C_EVENT_SLAVE_BYTE_TRANSMITTED1   0x00860084u /* DUALADDRFLG, TRFLG, BUSBSYFLG, TXBEFLG and BTCFLG flags */
#define DDL_I2C_EVENT_SLAVE_BYTE_TRANSMITTED2   0x00160084u /* GENCALLFLG, TRFLG, BUSBSYFLG, TXBEFLG and BTCFLG flags */
#define DDL_I2C_EVENT_SLAVE_BYTE_TRANSMITTING   0x00060080u /* TRFLG, BUSBSYFLG and TXBEFLG flags */
#define DDL_I2C_EVENT_SLAVE_ACK_FAILURE   0x00000400u /* AEFLG flag */
#define DDL_I2C_CTRL2_EVIEN   I2C_CTRL2_EVIEN
#define DDL_I2C_CTRL2_BUFIEN   I2C_CTRL2_BUFIEN
#define DDL_I2C_CTRL2_ERRIEN   I2C_CTRL2_ERRIEN
#define DDL_I2C_ANALOGFILTER_ENABLE   0x00000000U
#define DDL_I2C_ANALOGFILTER_DISABLE   I2C_FILTER_ANFDIS
#define DDL_I2C_OWNADDRESS1_7BIT   0x00004000U
#define DDL_I2C_OWNADDRESS1_10BIT   (uint32_t)(I2C_SADDR1_ADDRLEN | 0x00004000U)
#define DDL_I2C_DUTYCYCLE_2   0x00000000U
#define DDL_I2C_DUTYCYCLE_16_9   I2C_CLKCTRL_FDUTYCFG
#define DDL_I2C_CLOCK_SPEED_STANDARD_MODE   0x00000000U
#define DDL_I2C_CLOCK_SPEED_FAST_MODE   I2C_CLKCTRL_SPEEDCFG
#define DDL_I2C_MODE_I2C   0x00000000U
#define DDL_I2C_MODE_SMBUS_HOST   (uint32_t)(I2C_CTRL1_SMBEN | I2C_CTRL1_SMBTCFG | I2C_CTRL1_ARPEN)
#define DDL_I2C_MODE_SMBUS_DEVICE   I2C_CTRL1_SMBEN
#define DDL_I2C_MODE_SMBUS_DEVICE_ARP   (uint32_t)(I2C_CTRL1_SMBEN | I2C_CTRL1_ARPEN)
#define DDL_I2C_ACK   I2C_CTRL1_ACKEN
#define DDL_I2C_NACK   0x00000000U
#define DDL_I2C_DIRECTION_WRITE   I2C_STS2_TRFLG
#define DDL_I2C_DIRECTION_READ   0x00000000U
#define DDL_I2C_WriteReg(__INSTANCE__, __REG__, __VALUE__)
 Write a value in I2C register.
#define DDL_I2C_ReadReg(__INSTANCE__, __REG__)
 Read a value in I2C register.
#define __DDL_I2C_FREQ_HZ_TO_MHZ(__PCLK__)
 Convert Peripheral Clock Frequency in Mhz.
#define __DDL_I2C_FREQ_MHZ_TO_HZ(__PCLK__)
 Convert Peripheral Clock Frequency in Hz.
#define __DDL_I2C_RISE_TIME(__FREQRANGE__, __SPEED__)
 Compute I2C Clock rising time.
#define __DDL_I2C_SPEED_TO_CCR(__PCLK__, __SPEED__, __DUTYCYCLE__)
 Compute Speed clock range to a Clock Control Register (I2C_CLKCTRL_CLKS) value.
#define __DDL_I2C_SPEED_STANDARD_TO_CCR(__PCLK__, __SPEED__)
 Compute Speed Standard clock range to a Clock Control Register (I2C_CLKCTRL_CLKS) value.
#define __DDL_I2C_SPEED_FAST_TO_CCR(__PCLK__, __SPEED__, __DUTYCYCLE__)
 Compute Speed Fast clock range to a Clock Control Register (I2C_CLKCTRL_CLKS) value.
#define __DDL_I2C_10BIT_ADDRESS(__ADDRESS__)
 Get the Least significant bits of a 10-Bits address.
#define __DDL_I2C_10BIT_HEADER_WRITE(__ADDRESS__)
 Convert a 10-Bits address to a 10-Bits header with Write direction.
#define __DDL_I2C_10BIT_HEADER_READ(__ADDRESS__)
 Convert a 10-Bits address to a 10-Bits header with Read direction.

Functions

__STATIC_INLINE void DDL_I2C_Enable (I2C_TypeDef *I2Cx)
 Enable I2C peripheral (PE = 1).
__STATIC_INLINE void DDL_I2C_Disable (I2C_TypeDef *I2Cx)
 Disable I2C peripheral (PE = 0).
__STATIC_INLINE uint32_t DDL_I2C_IsEnabled (I2C_TypeDef *I2Cx)
 Check if the I2C peripheral is enabled or disabled.
__STATIC_INLINE void DDL_I2C_ConfigFilters (I2C_TypeDef *I2Cx, uint32_t AnalogFilter, uint32_t DigitalFilter)
 Configure Noise Filters (Analog and Digital).
__STATIC_INLINE void DDL_I2C_SetDigitalFilter (I2C_TypeDef *I2Cx, uint32_t DigitalFilter)
 Configure Digital Noise Filter.
__STATIC_INLINE uint32_t DDL_I2C_GetDigitalFilter (I2C_TypeDef *I2Cx)
 Get the current Digital Noise Filter configuration.
__STATIC_INLINE void DDL_I2C_EnableAnalogFilter (I2C_TypeDef *I2Cx)
 Enable Analog Noise Filter.
__STATIC_INLINE void DDL_I2C_DisableAnalogFilter (I2C_TypeDef *I2Cx)
 Disable Analog Noise Filter.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledAnalogFilter (I2C_TypeDef *I2Cx)
 Check if Analog Noise Filter is enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableClockStretching (I2C_TypeDef *I2Cx)
 Enable Clock stretching.
__STATIC_INLINE void DDL_I2C_DisableClockStretching (I2C_TypeDef *I2Cx)
 Disable Clock stretching.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledClockStretching (I2C_TypeDef *I2Cx)
 Check if Clock stretching is enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableGeneralCall (I2C_TypeDef *I2Cx)
 Enable General Call.
__STATIC_INLINE void DDL_I2C_DisableGeneralCall (I2C_TypeDef *I2Cx)
 Disable General Call.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledGeneralCall (I2C_TypeDef *I2Cx)
 Check if General Call is enabled or disabled.
__STATIC_INLINE void DDL_I2C_SetOwnAddress1 (I2C_TypeDef *I2Cx, uint32_t OwnAddress1, uint32_t OwnAddrSize)
 Set the Own Address1.
__STATIC_INLINE void DDL_I2C_SetOwnAddress2 (I2C_TypeDef *I2Cx, uint32_t OwnAddress2)
 Set the 7bits Own Address2.
__STATIC_INLINE void DDL_I2C_EnableOwnAddress2 (I2C_TypeDef *I2Cx)
 Enable acknowledge on Own Address2 match address.
__STATIC_INLINE void DDL_I2C_DisableOwnAddress2 (I2C_TypeDef *I2Cx)
 Disable acknowledge on Own Address2 match address.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledOwnAddress2 (I2C_TypeDef *I2Cx)
 Check if Own Address1 acknowledge is enabled or disabled.
__STATIC_INLINE void DDL_I2C_SetPeriphClock (I2C_TypeDef *I2Cx, uint32_t PeriphClock)
 Configure the Peripheral clock frequency.
__STATIC_INLINE uint32_t DDL_I2C_GetPeriphClock (I2C_TypeDef *I2Cx)
 Get the Peripheral clock frequency.
__STATIC_INLINE void DDL_I2C_SetDutyCycle (I2C_TypeDef *I2Cx, uint32_t DutyCycle)
 Configure the Duty cycle (Fast mode only).
__STATIC_INLINE uint32_t DDL_I2C_GetDutyCycle (I2C_TypeDef *I2Cx)
 Get the Duty cycle (Fast mode only).
__STATIC_INLINE void DDL_I2C_SetClockSpeedMode (I2C_TypeDef *I2Cx, uint32_t ClockSpeedMode)
 Configure the I2C master clock speed mode.
__STATIC_INLINE uint32_t DDL_I2C_GetClockSpeedMode (I2C_TypeDef *I2Cx)
 Get the the I2C master speed mode.
__STATIC_INLINE void DDL_I2C_SetRiseTime (I2C_TypeDef *I2Cx, uint32_t RiseTime)
 Configure the SCL, SDA rising time.
__STATIC_INLINE uint32_t DDL_I2C_GetRiseTime (I2C_TypeDef *I2Cx)
 Get the SCL, SDA rising time.
__STATIC_INLINE void DDL_I2C_SetClockPeriod (I2C_TypeDef *I2Cx, uint32_t ClockPeriod)
 Configure the SCL high and low period.
__STATIC_INLINE uint32_t DDL_I2C_GetClockPeriod (I2C_TypeDef *I2Cx)
 Get the SCL high and low period.
__STATIC_INLINE void DDL_I2C_ConfigSpeed (I2C_TypeDef *I2Cx, uint32_t PeriphClock, uint32_t ClockSpeed, uint32_t DutyCycle)
 Configure the SCL speed.
__STATIC_INLINE void DDL_I2C_SetMode (I2C_TypeDef *I2Cx, uint32_t PeripheralMode)
 Configure peripheral mode.
__STATIC_INLINE uint32_t DDL_I2C_GetMode (I2C_TypeDef *I2Cx)
 Get peripheral mode.
__STATIC_INLINE void DDL_I2C_EnableSMBusAlert (I2C_TypeDef *I2Cx)
 Enable SMBus alert (Host or Device mode).
__STATIC_INLINE void DDL_I2C_DisableSMBusAlert (I2C_TypeDef *I2Cx)
 Disable SMBus alert (Host or Device mode).
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledSMBusAlert (I2C_TypeDef *I2Cx)
 Check if SMBus alert (Host or Device mode) is enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableSMBusPEC (I2C_TypeDef *I2Cx)
 Enable SMBus Packet Error Calculation (PEC).
__STATIC_INLINE void DDL_I2C_DisableSMBusPEC (I2C_TypeDef *I2Cx)
 Disable SMBus Packet Error Calculation (PEC).
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledSMBusPEC (I2C_TypeDef *I2Cx)
 Check if SMBus Packet Error Calculation (PEC) is enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableDMAReq_TX (I2C_TypeDef *I2Cx)
 Enable DMA transmission requests.
__STATIC_INLINE void DDL_I2C_DisableDMAReq_TX (I2C_TypeDef *I2Cx)
 Disable DMA transmission requests.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledDMAReq_TX (I2C_TypeDef *I2Cx)
 Check if DMA transmission requests are enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableDMAReq_RX (I2C_TypeDef *I2Cx)
 Enable DMA reception requests.
__STATIC_INLINE void DDL_I2C_DisableDMAReq_RX (I2C_TypeDef *I2Cx)
 Disable DMA reception requests.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledDMAReq_RX (I2C_TypeDef *I2Cx)
 Check if DMA reception requests are enabled or disabled.
__STATIC_INLINE uint32_t DDL_I2C_DMA_GetRegAddr (I2C_TypeDef *I2Cx)
 Get the data register address used for DMA transfer.
__STATIC_INLINE void DDL_I2C_EnableIT_TX (I2C_TypeDef *I2Cx)
 Enable TXE interrupt.
__STATIC_INLINE void DDL_I2C_DisableIT_TX (I2C_TypeDef *I2Cx)
 Disable TXE interrupt.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledIT_TX (I2C_TypeDef *I2Cx)
 Check if the TXE Interrupt is enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableIT_RX (I2C_TypeDef *I2Cx)
 Enable RXNE interrupt.
__STATIC_INLINE void DDL_I2C_DisableIT_RX (I2C_TypeDef *I2Cx)
 Disable RXNE interrupt.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledIT_RX (I2C_TypeDef *I2Cx)
 Check if the RXNE Interrupt is enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableIT_EVT (I2C_TypeDef *I2Cx)
 Enable Events interrupts.
__STATIC_INLINE void DDL_I2C_DisableIT_EVT (I2C_TypeDef *I2Cx)
 Disable Events interrupts.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledIT_EVT (I2C_TypeDef *I2Cx)
 Check if Events interrupts are enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableIT_BUF (I2C_TypeDef *I2Cx)
 Enable Buffer interrupts.
__STATIC_INLINE void DDL_I2C_DisableIT_BUF (I2C_TypeDef *I2Cx)
 Disable Buffer interrupts.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledIT_BUF (I2C_TypeDef *I2Cx)
 Check if Buffer interrupts are enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableIT_ERR (I2C_TypeDef *I2Cx)
 Enable Error interrupts.
__STATIC_INLINE void DDL_I2C_DisableIT_ERR (I2C_TypeDef *I2Cx)
 Disable Error interrupts.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledIT_ERR (I2C_TypeDef *I2Cx)
 Check if Error interrupts are enabled or disabled.
__STATIC_INLINE uint32_t DDL_I2C_ReadEventStatus (I2C_TypeDef *I2Cx, uint32_t i2cEvent)
 Checks if the current I2C event matches the specified event.
__STATIC_INLINE uint32_t I2C_ReadLastEvent (I2C_TypeDef *I2Cx)
 Reads and returns the last I2C event status.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_START (I2C_TypeDef *I2Cx)
 Indicate the status of Start Bit (master mode).
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_ADDR (I2C_TypeDef *I2Cx)
 Indicate the status of Address sent (master mode) or Address matched flag (slave mode).
__STATIC_INLINE void DDL_I2C_ClearFlag_ADDR (I2C_TypeDef *I2Cx)
 Clear Address Matched flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_BTF (I2C_TypeDef *I2Cx)
 Indicate the status of Byte Transfer Finished flag. RESET: When Data byte transfer not done. SET: When Data byte transfer succeeded.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_ADD10 (I2C_TypeDef *I2Cx)
 Indicate the status of 10-bit header sent (master mode).
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_STOP (I2C_TypeDef *I2Cx)
 Indicate the status of Stop detection flag (slave mode).
__STATIC_INLINE void DDL_I2C_ClearFlag_STOP (I2C_TypeDef *I2Cx)
 Clear Stop detection flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_RXNE (I2C_TypeDef *I2Cx)
 Indicate the status of Receive data register not empty flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_TXE (I2C_TypeDef *I2Cx)
 Indicate the status of Transmit data register empty flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_BERR (I2C_TypeDef *I2Cx)
 Indicate the status of Bus error flag.
__STATIC_INLINE void DDL_I2C_ClearFlag_BERR (I2C_TypeDef *I2Cx)
 Clear Bus error flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_ARLO (I2C_TypeDef *I2Cx)
 Indicate the status of Arbitration lost flag.
__STATIC_INLINE void DDL_I2C_ClearFlag_ARLO (I2C_TypeDef *I2Cx)
 Clear Arbitration lost flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_AF (I2C_TypeDef *I2Cx)
 Indicate the status of Acknowledge failure flag.
__STATIC_INLINE void DDL_I2C_ClearFlag_AF (I2C_TypeDef *I2Cx)
 Clear Acknowledge failure flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_OVR (I2C_TypeDef *I2Cx)
 Indicate the status of Overrun/Underrun flag.
__STATIC_INLINE void DDL_I2C_ClearFlag_OVR (I2C_TypeDef *I2Cx)
 Clear Overrun/Underrun flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveSMBusFlag_PECERR (I2C_TypeDef *I2Cx)
 Indicate the status of SMBus PEC error flag in reception.
__STATIC_INLINE void DDL_I2C_ClearSMBusFlag_PECERR (I2C_TypeDef *I2Cx)
 Clear SMBus PEC error flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveSMBusFlag_TIMEOUT (I2C_TypeDef *I2Cx)
 Indicate the status of SMBus Timeout detection flag.
__STATIC_INLINE void DDL_I2C_ClearSMBusFlag_TIMEOUT (I2C_TypeDef *I2Cx)
 Clear SMBus Timeout detection flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveSMBusFlag_ALERT (I2C_TypeDef *I2Cx)
 Indicate the status of SMBus alert flag.
__STATIC_INLINE void DDL_I2C_ClearSMBusFlag_ALERT (I2C_TypeDef *I2Cx)
 Clear SMBus Alert flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_MSL (I2C_TypeDef *I2Cx)
 Indicate the status of Master/Slave flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_BUSY (I2C_TypeDef *I2Cx)
 Indicate the status of Bus Busy flag.
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_GENCALL (I2C_TypeDef *I2Cx)
 Indicate the status of General call address reception (Slave mode).
__STATIC_INLINE uint32_t DDL_I2C_IsActiveSMBusFlag_SMBDEFAULT (I2C_TypeDef *I2Cx)
 Indicate the status of SMBus Device default address reception (Slave mode).
__STATIC_INLINE uint32_t DDL_I2C_IsActiveSMBusFlag_SMBHOST (I2C_TypeDef *I2Cx)
 Indicate the status of SMBus Host address reception (Slave mode).
__STATIC_INLINE uint32_t DDL_I2C_IsActiveFlag_DUAL (I2C_TypeDef *I2Cx)
 Indicate the status of Dual flag.
__STATIC_INLINE void DDL_I2C_EnableReset (I2C_TypeDef *I2Cx)
 Enable Reset of I2C peripheral.
__STATIC_INLINE void DDL_I2C_DisableReset (I2C_TypeDef *I2Cx)
 Disable Reset of I2C peripheral.
__STATIC_INLINE uint32_t DDL_I2C_IsResetEnabled (I2C_TypeDef *I2Cx)
 Check if the I2C peripheral is under reset state or not.
__STATIC_INLINE void DDL_I2C_AcknowledgeNextData (I2C_TypeDef *I2Cx, uint32_t TypeAcknowledge)
 Prepare the generation of a ACKnowledge or Non ACKnowledge condition after the address receive match code or next received byte.
__STATIC_INLINE void DDL_I2C_GenerateStartCondition (I2C_TypeDef *I2Cx)
 Generate a START or RESTART condition.
__STATIC_INLINE void DDL_I2C_GenerateStopCondition (I2C_TypeDef *I2Cx)
 Generate a STOP condition after the current byte transfer (master mode).
__STATIC_INLINE void DDL_I2C_EnableBitPOS (I2C_TypeDef *I2Cx)
 Enable bit POS (master/host mode).
__STATIC_INLINE void DDL_I2C_DisableBitPOS (I2C_TypeDef *I2Cx)
 Disable bit POS (master/host mode).
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledBitPOS (I2C_TypeDef *I2Cx)
 Check if bit POS is enabled or disabled.
__STATIC_INLINE uint32_t DDL_I2C_GetTransferDirection (I2C_TypeDef *I2Cx)
 Indicate the value of transfer direction.
__STATIC_INLINE void DDL_I2C_EnableLastDMA (I2C_TypeDef *I2Cx)
 Enable DMA last transfer.
__STATIC_INLINE void DDL_I2C_DisableLastDMA (I2C_TypeDef *I2Cx)
 Disable DMA last transfer.
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledLastDMA (I2C_TypeDef *I2Cx)
 Check if DMA last transfer is enabled or disabled.
__STATIC_INLINE void DDL_I2C_EnableSMBusPECCompare (I2C_TypeDef *I2Cx)
 Enable transfer or internal comparison of the SMBus Packet Error byte (transmission or reception mode).
__STATIC_INLINE void DDL_I2C_DisableSMBusPECCompare (I2C_TypeDef *I2Cx)
 Disable transfer or internal comparison of the SMBus Packet Error byte (transmission or reception mode).
__STATIC_INLINE uint32_t DDL_I2C_IsEnabledSMBusPECCompare (I2C_TypeDef *I2Cx)
 Check if the SMBus Packet Error byte transfer or internal comparison is requested or not.
__STATIC_INLINE uint32_t DDL_I2C_GetSMBusPEC (I2C_TypeDef *I2Cx)
 Get the SMBus Packet Error byte calculated.
__STATIC_INLINE uint8_t DDL_I2C_ReceiveData8 (I2C_TypeDef *I2Cx)
 Read Receive Data register.
__STATIC_INLINE void DDL_I2C_TransmitData8 (I2C_TypeDef *I2Cx, uint8_t Data)
 Write in Transmit Data Register .
uint32_t DDL_I2C_Init (I2C_TypeDef *I2Cx, DDL_I2C_InitTypeDef *I2C_InitStruct)
 Initialize the I2C registers according to the specified parameters in I2C_InitStruct.
uint32_t DDL_I2C_DeInit (I2C_TypeDef *I2Cx)
 De-initialize the I2C registers to their default reset values.
void DDL_I2C_StructInit (DDL_I2C_InitTypeDef *I2C_InitStruct)
 Set each DDL_I2C_InitTypeDef field to default value.

Detailed Description

Header file of I2C DDL module.

Attention

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The original code has been modified by Geehy Semiconductor.

Copyright (c) 2016 STMicroelectronics. Copyright (C) 2025 Geehy Semiconductor. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file g32r4xx_ddl_i2c.h.