LL COMP Macros

Common write and read registers macro

group COMP_LL_EM_WRITE_READ

Defines

LL_COMP_WRITE_REG ( __INSTANCE__ , __REG__ , __VALUE__ ) STM32_WRITE_REG((__INSTANCE__)->__REG__, (__VALUE__))

Write a value in COMP register.

Parameters :
  • __INSTANCE__ – comparator instance

  • __REG__ – Register to be written

  • __VALUE__ – Value to be written in the register

LL_COMP_READ_REG ( __INSTANCE__ , __REG__ ) STM32_READ_REG((__INSTANCE__)->__REG__)

Read a value in COMP register.

Parameters :
  • __INSTANCE__ – comparator instance

  • __REG__ – Register to be read

Return values :

Register – value

COMP helper macro

group COMP_LL_EM_HELPER_MACRO

Defines

LL_COMP_COMMON_INSTANCE ( instance ) (COMP12_COMMON)

Helper macro to select the COMP common instance to which is belonging the selected COMP instance.

Note

COMP common register instance can be used to set parameters common to several COMP instances. Refer to functions having argument “p_comp_common” as parameter.

Parameters :
  • instance – COMP instance

Return values :

COMP – common instance or value “0” if there is no COMP common instance.

LL_COMP_WINDOW_INST_POS_ID ( instance )

((((instance) == COMP1)) \

? ((

LL_COMP_WINDOW_COMP_ODD

)) \

: \

((

LL_COMP_WINDOW_COMP_EVEN

)) \

)


Helper macro to define comparator instance position generic identification (odd or even) from comparator instance.

Parameters :
  • instance – Comparator instance.

Return values :

Comparator – common instance or value “0” if there is no COMP common instance.

LL_COMP_WINDOW_INST_TO_INPUT_PLUS ( instance ) ((( LL_COMP_WINDOW_INST_POS_ID (instance) == LL_COMP_WINDOW_COMP_ODD

)) \

? ((

LL_COMP_WINDOW_INPUT_PLUS_ODD

)) \

: \

((

LL_COMP_WINDOW_INPUT_PLUS_EVEN

)) \

)


Helper macro to select literal LL_COMP_WINDOW_INPUT_PLUS_x with suffix odd or even from comparator instance.

Note

Helper macro intended to be used with function LL_COMP_SetCommonWindowMode()

Parameters :
  • instance – COMP instance.

Return values :

COMP – common instance or value “0” if there is no COMP common instance.

LL_COMP_WINDOW_INST_TO_OUTPUT ( instance ) ((( LL_COMP_WINDOW_INST_POS_ID (instance) == LL_COMP_WINDOW_COMP_ODD

)) \

? ((

LL_COMP_WINDOW_OUTPUT_XOR_ODD

)) \

: \

((

LL_COMP_WINDOW_OUTPUT_XOR_EVEN

)) \

)


Helper macro to select literal LL_COMP_WINDOW_OUTPUT_x with suffix odd or even from comparator instance.

Note

Helper macro intended to be used with function LL_COMP_SetCommonWindowOutput()

Parameters :
  • instance – COMP instance.

Return values :

COMP – common instance or value “0” if there is no COMP common instance.