STM8S/A Standard Peripherals Firmware Library: I2C_Private_Macros

STM8S/A

STM8S/A Standard Peripherals Firmware Library
I2C_Private_Macros

Defines

#define IS_I2C_ACK_OK(ACK)
 Macro used by the assert function to check the different acknowledgement configuration.
#define IS_I2C_ADDMODE_OK(ADDMODE)
 Macro used by the assert function to check the different I2C addressing modes.
#define IS_I2C_ADDRESS_OK(ADD)   (((ADD) & (uint8_t)0x01) == (uint8_t)0x00)
#define IS_I2C_CLEAR_FLAG_OK(FLAG)
 Macro used by the assert function to check the I2C flags to clear.
#define IS_I2C_CLEAR_ITPENDINGBIT_OK(ITPENDINGBIT)
 Macro used by the assert function to check the different I2C possible pending bits to clear by writing 0.
#define IS_I2C_DIRECTION_OK(DIR)
 Macro used by the assert function to check the different I2C communcation direction.
#define IS_I2C_DUTYCYCLE_OK(DUTY)
 Macro used by the assert function to check the different functions parameters.
#define IS_I2C_EVENT_OK(EVENT)
 Macro used by the assert function to check the different I2C possible events.
#define IS_I2C_FLAG_OK(FLAG)
 Macro used by the assert function to check the different I2C flags.
#define IS_I2C_INPUT_CLOCK_FREQ_OK(FREQ)   (((FREQ) >= (uint8_t)1) && ((FREQ) <= I2C_MAX_INPUT_FREQ))
 Macro used by the assert function to check that I2C Input clock frequency must be between 1MHz and 50MHz.
#define IS_I2C_INTERRUPT_OK(IT)
 Macro used by the assert function to check the different I2C interrupt types.
#define IS_I2C_ITPENDINGBIT_OK(ITPENDINGBIT)
 Macro used by the assert function to check the different I2C possible pending bits.
#define IS_I2C_OUTPUT_CLOCK_FREQ_OK(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_OK(ADDRESS)   ((ADDRESS) <= (uint16_t)0x03FF)
 Macro used by the assert function to check the different I2C possible own address.

Define Documentation

#define IS_I2C_ACK_OK (   ACK)
Value:
(((ACK) == I2C_ACK_NONE) || \
   ((ACK) == I2C_ACK_CURR) || \
   ((ACK) == I2C_ACK_NEXT))

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

Definition at line 368 of file stm8s_i2c.h.

Referenced by I2C_AcknowledgeConfig(), and I2C_Init().

#define IS_I2C_ADDMODE_OK (   ADDMODE)
Value:
(((ADDMODE) == I2C_ADDMODE_7BIT) || \
   ((ADDMODE) == I2C_ADDMODE_10BIT))

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

Definition at line 376 of file stm8s_i2c.h.

Referenced by I2C_Init().

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

Definition at line 480 of file stm8s_i2c.h.

Referenced by I2C_Send7bitAddress().

#define IS_I2C_CLEAR_FLAG_OK (   FLAG)
Value:
((((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 422 of file stm8s_i2c.h.

Referenced by I2C_ClearFlag().

#define IS_I2C_CLEAR_ITPENDINGBIT_OK (   ITPENDINGBIT)
Value:
(((ITPENDINGBIT) == I2C_ITPENDINGBIT_WAKEUPFROMHALT)     || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_OVERRUNUNDERRUN)    || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_ACKNOWLEDGEFAILURE) || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_ARBITRATIONLOSS)    || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_BUSERROR))

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

Definition at line 446 of file stm8s_i2c.h.

Referenced by I2C_ClearITPendingBit().

#define IS_I2C_DIRECTION_OK (   DIR)
Value:
(((DIR) == I2C_DIRECTION_TX) || \
   ((DIR) == I2C_DIRECTION_RX))

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

Definition at line 394 of file stm8s_i2c.h.

Referenced by I2C_Send7bitAddress().

#define IS_I2C_DUTYCYCLE_OK (   DUTY)
Value:
(((DUTY) == I2C_DUTYCYCLE_2) || \
   ((DUTY) == I2C_DUTYCYCLE_16_9))

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

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

Definition at line 361 of file stm8s_i2c.h.

Referenced by I2C_FastModeDutyCycleConfig(), and I2C_Init().

#define IS_I2C_EVENT_OK (   EVENT)
Value:

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

Definition at line 456 of file stm8s_i2c.h.

Referenced by I2C_CheckEvent().

#define IS_I2C_FLAG_OK (   FLAG)
Value:
(((FLAG) == I2C_FLAG_TXEMPTY)         || \
   ((FLAG) == I2C_FLAG_RXNOTEMPTY)       || \
   ((FLAG) == I2C_FLAG_STOPDETECTION)      || \
   ((FLAG) == I2C_FLAG_HEADERSENT)       || \
   ((FLAG) == I2C_FLAG_TRANSFERFINISHED)   || \
   ((FLAG) == I2C_FLAG_ADDRESSSENTMATCHED)  || \
   ((FLAG) == I2C_FLAG_STARTDETECTION)    || \
   ((FLAG) == I2C_FLAG_WAKEUPFROMHALT)    || \
   ((FLAG) == I2C_FLAG_OVERRUNUNDERRUN)    || \
   ((FLAG) == I2C_FLAG_ACKNOWLEDGEFAILURE)  || \
   ((FLAG) == I2C_FLAG_ARBITRATIONLOSS)    || \
   ((FLAG) == I2C_FLAG_BUSERROR)       || \
   ((FLAG) == I2C_FLAG_GENERALCALL)      || \
   ((FLAG) == I2C_FLAG_TRANSMITTERRECEIVER) || \
   ((FLAG) == I2C_FLAG_BUSBUSY) || \
   ((FLAG) == I2C_FLAG_MASTERSLAVE))

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

Definition at line 401 of file stm8s_i2c.h.

Referenced by I2C_GetFlagStatus().

#define IS_I2C_INPUT_CLOCK_FREQ_OK (   FREQ)    (((FREQ) >= (uint8_t)1) && ((FREQ) <= I2C_MAX_INPUT_FREQ))

Macro used by the assert function to check that I2C Input clock frequency must be between 1MHz and 50MHz.

Definition at line 486 of file stm8s_i2c.h.

Referenced by I2C_Init().

#define IS_I2C_INTERRUPT_OK (   IT)
Value:
(((IT) == I2C_IT_ERR)     || \
   ((IT) == I2C_IT_EVT)     || \
   ((IT) == I2C_IT_BUF)     || \
   ((IT) == (I2C_IT_ERR | I2C_IT_EVT)) || \
   ((IT) == (I2C_IT_ERR | I2C_IT_BUF)) || \
   ((IT) == (I2C_IT_EVT | I2C_IT_BUF)) || \
   ((IT) == (I2C_IT_EVT | I2C_IT_BUF | I2C_IT_ERR)))

Macro used by the assert function to check the different I2C interrupt types.

Definition at line 383 of file stm8s_i2c.h.

Referenced by I2C_ITConfig().

#define IS_I2C_ITPENDINGBIT_OK (   ITPENDINGBIT)
Value:
(((ITPENDINGBIT) == I2C_ITPENDINGBIT_TXEMPTY)                                           || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_RXNOTEMPTY)                             || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_STOPDETECTION)                  || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_HEADERSENT)                             || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_TRANSFERFINISHED)       || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_ADDRESSSENTMATCHED) || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_STARTDETECTION)                 || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_WAKEUPFROMHALT)                 || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_OVERRUNUNDERRUN)                || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_ACKNOWLEDGEFAILURE) || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_ARBITRATIONLOSS)                || \
    ((ITPENDINGBIT) == I2C_ITPENDINGBIT_BUSERROR))

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

Definition at line 428 of file stm8s_i2c.h.

Referenced by I2C_GetITStatus().

#define IS_I2C_OUTPUT_CLOCK_FREQ_OK (   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 493 of file stm8s_i2c.h.

Referenced by I2C_Init().

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

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

Definition at line 476 of file stm8s_i2c.h.

Referenced by I2C_Init().

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com