STM8L15x Standard Peripherals Drivers: I2C_Exported_Macros

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

I2C_Exported_Macros

Defines

#define IS_I2C_ACK_POSITION(POSITION)
 Macro used by the assert function to check the different acknowledgement position.
#define IS_I2C_ACK_STATE(STATE)
 Macro used by the assert function to check the different acknowledgement configuration.
#define IS_I2C_ACKNOWLEDGE_ADDRESS(ADDMODE)
 Macro used by the assert function to check the different I2C addressing modes.
#define IS_I2C_ADDRESS(ADD)   (((ADD) & (uint8_t)0x01) == (uint8_t)0x00)
 Macro used by the assert function to check the different I2C address The address must be even.
#define IS_I2C_CLEAR_FLAG(FLAG)   ((((uint16_t)(FLAG) & (uint16_t)0xFD00) == 0x00) && ((uint16_t)(FLAG) != 0x00))
 Macro used by the assert function to check the I2C flags to clear.
#define IS_I2C_CLEAR_IT(IT)   ((((uint16_t)(IT) & (uint16_t)0xDC00) == 0x00) && ((uint16_t)(IT) != 0x00))
 Macro used by the assert function to check the different I2C possible pending bits to clear by writing 0.
#define IS_I2C_CONFIG_IT(IT)   ((((uint16_t)(IT) & (uint16_t)0xFFF8) == 0x00) && ((uint16_t)(IT) != 0x00))
 Macro used by the assert_param function in order to check the different sensitivity values for the Interrupts.
#define IS_I2C_DIRECTION(DIR)
 Macro used by the assert function to check the different I2C communication direction.
#define IS_I2C_DUTY_CYCLE(CYCLE)
 Macro used by the assert function to check the different I2C duty cycles.
#define IS_I2C_EVENT(EVENT)
 Macro used by the assert function to check the different I2C possible events.
#define IS_I2C_GET_FLAG(FLAG)
 Macro used by the assert function to check the different I2C flags.
#define IS_I2C_GET_IT(IT)
 Macro used by the assert function to check the different I2C possible pending bits.
#define IS_I2C_MODE(MODE)
 Macro used by the assert function to check the different functions parameters.
#define IS_I2C_OUTPUT_CLOCK_FREQ(FREQ)   (((FREQ) >= (uint8_t)1) && ((FREQ) <= I2C_MAX_FAST_FREQ))
 Macro used by the assert function to check that I2C Output clock frequency must be between 1Hz and 400kHz.
#define IS_I2C_OWN_ADDRESS(ADDRESS)   ((ADDRESS) <= (uint16_t)0x03FF)
 Macro used by the assert function to check the different I2C possible own address.
#define IS_I2C_PEC_POSITION(POSITION)
 Macro used by the assert function to check the different I2C PEC positions.
#define IS_I2C_REGISTER(REGISTER)
 Macro used by the assert function to check the different I2C registers.
#define IS_I2C_SMBUS_ALERT(ALERT)
 Macro used by the assert function to check the different I2C SMBus Alert pin configuration.

Define Documentation

#define IS_I2C_ACK_POSITION (   POSITION)
Value:
(((POSITION) == I2C_AckPosition_Next) || \
                                       ((POSITION) == I2C_AckPosition_Current))

Macro used by the assert function to check the different acknowledgement position.

Definition at line 498 of file stm8l15x_i2c.h.

Referenced by I2C_AckPositionConfig().

#define IS_I2C_ACK_STATE (   STATE)
Value:
(((STATE) == I2C_Ack_Disable) || \
                                 ((STATE) == I2C_Ack_Enable))

Macro used by the assert function to check the different acknowledgement configuration.

Definition at line 493 of file stm8l15x_i2c.h.

Referenced by I2C_Init().

#define IS_I2C_ACKNOWLEDGE_ADDRESS (   ADDMODE)
Value:
(((ADDMODE) == I2C_AcknowledgedAddress_7bit) || \
    ((ADDMODE) == I2C_AcknowledgedAddress_10bit))

Macro used by the assert function to check the different I2C addressing modes.

Definition at line 510 of file stm8l15x_i2c.h.

Referenced by I2C_Init().

#define IS_I2C_ADDRESS (   ADD)    (((ADD) & (uint8_t)0x01) == (uint8_t)0x00)

Macro used by the assert function to check the different I2C address The address must be even.

Definition at line 635 of file stm8l15x_i2c.h.

Referenced by I2C_Send7bitAddress().

#define IS_I2C_CLEAR_FLAG (   FLAG)    ((((uint16_t)(FLAG) & (uint16_t)0xFD00) == 0x00) && ((uint16_t)(FLAG) != 0x00))

Macro used by the assert function to check the I2C flags to clear.

Definition at line 554 of file stm8l15x_i2c.h.

Referenced by I2C_ClearFlag().

#define IS_I2C_CLEAR_IT (   IT)    ((((uint16_t)(IT) & (uint16_t)0xDC00) == 0x00) && ((uint16_t)(IT) != 0x00))

Macro used by the assert function to check the different I2C possible pending bits to clear by writing 0.

Definition at line 566 of file stm8l15x_i2c.h.

Referenced by I2C_ClearITPendingBit().

#define IS_I2C_CONFIG_IT (   IT)    ((((uint16_t)(IT) & (uint16_t)0xFFF8) == 0x00) && ((uint16_t)(IT) != 0x00))

Macro used by the assert_param function in order to check the different sensitivity values for the Interrupts.

Definition at line 560 of file stm8l15x_i2c.h.

Referenced by I2C_ITConfig().

#define IS_I2C_DIRECTION (   DIR)
Value:
(((DIR) == I2C_Direction_Transmitter) || \
                              ((DIR) == I2C_Direction_Receiver ))

Macro used by the assert function to check the different I2C communication direction.

Definition at line 522 of file stm8l15x_i2c.h.

Referenced by I2C_Send7bitAddress().

#define IS_I2C_DUTY_CYCLE (   CYCLE)
Value:
(((CYCLE) == I2C_DutyCycle_2) || \
                                 ((CYCLE) == I2C_DutyCycle_16_9))

Macro used by the assert function to check the different I2C duty cycles.

Definition at line 487 of file stm8l15x_i2c.h.

Referenced by I2C_FastModeDutyCycleConfig(), and I2C_Init().

#define IS_I2C_EVENT (   EVENT)
#define IS_I2C_GET_FLAG (   FLAG)
Value:
(((FLAG) == I2C_FLAG_TXE)        || \
                               ((FLAG) == I2C_FLAG_RXNE)       || \
                               ((FLAG) == I2C_FLAG_STOPF)      || \
                               ((FLAG) == I2C_FLAG_ADD10)      || \
                               ((FLAG) == I2C_FLAG_BTF)        || \
                               ((FLAG) == I2C_FLAG_ADDR)       || \
                               ((FLAG) == I2C_FLAG_SB)         || \
                               ((FLAG) == I2C_FLAG_SMBALERT)   || \
                               ((FLAG) == I2C_FLAG_TIMEOUT)    || \
                               ((FLAG) == I2C_FLAG_WUFH)       || \
                               ((FLAG) == I2C_FLAG_PECERR)     || \
                               ((FLAG) == I2C_FLAG_OVR)        || \
                               ((FLAG) == I2C_FLAG_AF)         || \
                               ((FLAG) == I2C_FLAG_ARLO)       || \
                               ((FLAG) == I2C_FLAG_BERR)       || \
                               ((FLAG) == I2C_FLAG_DUALF)      || \
                               ((FLAG) == I2C_FLAG_SMBHOST)    || \
                               ((FLAG) == I2C_FLAG_SMBDEFAULT) || \
                               ((FLAG) == I2C_FLAG_GENCALL)    || \
                               ((FLAG) == I2C_FLAG_TRA)        || \
                               ((FLAG) == I2C_FLAG_BUSY)       || \
                               ((FLAG) == I2C_FLAG_MSL))

Macro used by the assert function to check the different I2C flags.

Definition at line 528 of file stm8l15x_i2c.h.

Referenced by I2C_GetFlagStatus().

#define IS_I2C_GET_IT (   IT)
Value:
(((IT) == I2C_IT_OVR)      ||\
                           ((IT) == I2C_IT_AF)       ||\
                           ((IT) == I2C_IT_ARLO)     ||\
                           ((IT) == I2C_IT_BERR)     ||\
                           ((IT) == I2C_IT_TXE)      ||\
                           ((IT) == I2C_IT_RXNE)     ||\
                           ((IT) == I2C_IT_STOPF)    ||\
                           ((IT) == I2C_IT_ADD10)    ||\
                           ((IT) == I2C_IT_BTF)      ||\
                           ((IT) == I2C_IT_ADDR)     ||\
                           ((IT) == I2C_IT_PECERR)   ||\
                           ((IT) == I2C_IT_TIMEOUT)  ||\
                           ((IT) == I2C_IT_SMBALERT) ||\
                           ((IT) == I2C_IT_WUFH)     ||\
                           ((IT) == I2C_IT_SB))

Macro used by the assert function to check the different I2C possible pending bits.

Definition at line 571 of file stm8l15x_i2c.h.

Referenced by I2C_GetITStatus().

#define IS_I2C_MODE (   MODE)
Value:
(((MODE) == I2C_Mode_I2C) || \
                          ((MODE) == I2C_Mode_SMBusDevice) || \
                          ((MODE) == I2C_Mode_SMBusHost))

Macro used by the assert function to check the different functions parameters.

Macro used by the assert function to check the different I2C modes.

Definition at line 480 of file stm8l15x_i2c.h.

Referenced by I2C_Init().

#define IS_I2C_OUTPUT_CLOCK_FREQ (   FREQ)    (((FREQ) >= (uint8_t)1) && ((FREQ) <= I2C_MAX_FAST_FREQ))

Macro used by the assert function to check that I2C Output clock frequency must be between 1Hz and 400kHz.

Definition at line 640 of file stm8l15x_i2c.h.

Referenced by I2C_Init().

#define IS_I2C_OWN_ADDRESS (   ADDRESS)    ((ADDRESS) <= (uint16_t)0x03FF)

Macro used by the assert function to check the different I2C possible own address.

Definition at line 629 of file stm8l15x_i2c.h.

Referenced by I2C_Init().

#define IS_I2C_PEC_POSITION (   POSITION)
Value:
(((POSITION) == I2C_PECPosition_Current) || \
                                       ((POSITION) == I2C_PECPosition_Next))

Macro used by the assert function to check the different I2C PEC positions.

Definition at line 504 of file stm8l15x_i2c.h.

Referenced by I2C_PECPositionConfig().

#define IS_I2C_REGISTER (   REGISTER)
Value:
(((REGISTER) == I2C_Register_CR1) || \
                                   ((REGISTER) == I2C_Register_CR2) || \
                                   ((REGISTER) == I2C_Register_FREQR) || \
                                   ((REGISTER) == I2C_Register_OARL) || \
                                   ((REGISTER) == I2C_Register_OARH) || \
                                   ((REGISTER) == I2C_Register_DR) || \
                                   ((REGISTER) == I2C_Register_SR1) || \
                                   ((REGISTER) == I2C_Register_SR2) || \
                                   ((REGISTER) == I2C_Register_SR3) || \
                                   ((REGISTER) == I2C_Register_ITR) || \
                                   ((REGISTER) == I2C_Register_CCRL) || \
                                   ((REGISTER) == I2C_Register_CCRH) || \
                                   ((REGISTER) == I2C_Register_TRISER) || \
                                   ((REGISTER) == I2C_Register_PECR))

Macro used by the assert function to check the different I2C registers.

Definition at line 612 of file stm8l15x_i2c.h.

Referenced by I2C_ReadRegister().

#define IS_I2C_SMBUS_ALERT (   ALERT)
Value:
(((ALERT) == I2C_SMBusAlert_High) || \
                                   ((ALERT) == I2C_SMBusAlert_Low))

Macro used by the assert function to check the different I2C SMBus Alert pin configuration.

Definition at line 516 of file stm8l15x_i2c.h.

Referenced by I2C_SMBusAlertConfig().

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com