HAL COMP Overview

Introducing COMP

group COMP_Introduction

  • This introduction is under development.

Module and files

The following diagram illustrates the COMP module and its associated files.

Module and files diagram

Component diagram

The following diagram illustrates the software components involved in the COMP module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.



@startuml

<style>

componentDiagram {

   arrow {

      FontSize 8

   }

}

</style>



title COMP Software Component Diagram



package "HAL" {

    [HAL_SERVICE]

    [HAL_COMP]

    [HAL_EXTI]

}



package "Low Layer" {

    [LL_COMP]

    [CMSIS]

    [COMP Interrupt routine service]

}



package "HW" {

    [STM32_HW]

}



[Appli] --> [HAL_COMP] : HAL COMP API

[Appli] <-- [HAL_COMP] : COMP callback

[HAL_COMP] --> [LL_COMP] : LL COMP API

[HAL_COMP] -r-> [HAL_EXTI] : HAL_EXTI_Init\nHAL_EXTI_SetConfig\nHAL_EXTI_Enable\nHAL_EXTI_Disable\nHAL_EXTI_GetState

[HAL_COMP] -l-> [HAL_SERVICE] : HAL_GetTick

[HAL_COMP] <-- [COMP Interrupt routine service]

[LL_COMP] --> [CMSIS]:COMP register def

[STM32_HW] -u--> [COMP Interrupt routine service]: COMPx Irq (via EXTI line)

[STM32_HW] <-u-- [LL_COMP] : COMP registers R/W

@enduml

Configuration table

The following table lists the configuration defines for the HAL COMP module, specifying their locations, default values, and descriptions:

group COMP_Configuration_Table

Configuration inside the COMP driver

Config defines

Description

Default value

Note

USE_HAL_COMP_MODULE

from hal_conf.h

1

When set, HAL COMP module is enabled

USE_HAL_COMP_EXTI

from hal_conf.h

1

When set, HAL COMP can be used with EXTI

.

(needed for event and IT operation)

USE_HAL_COMP_WINDOW_MODE

from hal_conf.h

0

When set, HAL COMP common features are available (under

.

condition of feature supported: COMP_WINDOW_MODE_SUPPORT)

USE_HAL_COMP_REGISTER_CALLBACKS

from hal_conf.h

0

When defined, enable the register callbacks assert

USE_HAL_COMP_CLK_ENABLE_MODEL

from hal_conf.h

HAL_CLK_ENABLE_NO

Enable the gating of the peripheral clock

USE_HAL_CHECK_PARAM

from hal_conf.h

0

Parameters (pointers or sizes) are checked in runtime

USE_HAL_CHECK_PROCESS_STATE

from hal_conf.h

0

When set, enable atomic access to process state check

USE_ASSERT_DBG_PARAM

from PreProcessor env

NA

When defined, enable the params assert

USE_ASSERT_DBG_STATE

from PreProcessor env

NA

When defined, enable the state assert

COMP_WINDOW_MODE_SUPPORT

from CMSIS

Defined

When defined, COMP window mode features are available