S32 SDK
cmp_driver.h File Reference
#include "status.h"
#include "device_registers.h"

Go to the source code of this file.

Data Structures

struct  cmp_comparator_t
 Defines the block configuration. More...
 
struct  cmp_anmux_t
 Defines the analog mux. More...
 
struct  cmp_dac_t
 Defines the DAC block. More...
 
struct  cmp_trigger_mode_t
 Defines the trigger mode. More...
 
struct  cmp_module_t
 Defines the comparator module configuration. More...
 

Macros

#define CMP_INPUT_FLAGS_MASK   0xFF0000
 
#define CMP_INPUT_FLAGS_SHIFT   16U
 
#define CMP_ROUND_ROBIN_CHANNELS_MASK   0xFF0000
 
#define CMP_ROUND_ROBIN_CHANNELS_SHIFT   16U
 

Typedefs

typedef uint8_t cmp_ch_list_t
 Comparator channels list (1bit/channel) |------—|------—|--—|------—|------—| |CH7_state|CH6_state|.....|CH1_state|CH0_state| |------—|------—|--—|------—|------—| Implements : cmp_ch_list_t_Class. More...
 
typedef uint8_t cmp_ch_number_t
 Number of channel Implements : cmp_ch_number_t_Class. More...
 

Enumerations

enum  cmp_power_mode_t { CMP_LOW_SPEED = 0U, CMP_HIGH_SPEED = 1U }
 Power Modes selection Implements : cmp_power_mode_t_Class. More...
 
enum  cmp_voltage_reference_t { CMP_VIN1 = 0U, CMP_VIN2 = 1U }
 Voltage Reference selection Implements : cmp_voltage_reference_t_Class. More...
 
enum  cmp_port_mux_t { CMP_DAC = 0U, CMP_MUX = 1U }
 Port Mux Source selection Implements : cmp_port_mux_t_Class. More...
 
enum  cmp_inverter_t { CMP_NORMAL = 0U, CMP_INVERT = 1U }
 Comparator output invert selection Implements : cmp_inverter_t_Class. More...
 
enum  cmp_output_select_t { CMP_COUT = 0U, CMP_COUTA = 1U }
 Comparator output select selection Implements : cmp_output_select_t_Class. More...
 
enum  cmp_output_enable_t { CMP_UNAVAILABLE = 0U, CMP_AVAILABLE = 1U }
 Comparator output pin enable selection Implements : cmp_output_enable_t_Class. More...
 
enum  cmp_offset_t { CMP_LEVEL_OFFSET_0 = 0U, CMP_LEVEL_OFFSET_1 = 1U }
 Comparator hard block offset control Implements : cmp_offset_t_Class. More...
 
enum  cmp_hysteresis_t { CMP_LEVEL_HYS_0 = 0U, CMP_LEVEL_HYS_1 = 1U, CMP_LEVEL_HYS_2 = 2U, CMP_LEVEL_HYS_3 = 3U }
 Comparator hysteresis control Implements : cmp_hysteresis_t_Class. More...
 
enum  cmp_fixed_port_t { CMP_PLUS_FIXED = 0U, CMP_MINUS_FIXED = 1U }
 Comparator Round-Robin fixed port Implements : cmp_fixed_port_t_Class. More...
 
enum  cmp_output_trigger_t { CMP_NO_EVENT = 0U, CMP_FALLING_EDGE = 1U, CMP_RISING_EDGE = 2U, CMP_BOTH_EDGES = 3U }
 Comparator output interrupt configuration Implements : cmp_output_trigger_t_Class. More...
 
enum  cmp_mode_t {
  CMP_DISABLED = 0U, CMP_CONTINUOUS = 1U, CMP_SAMPLED_NONFILTRED_INT_CLK = 2U, CMP_SAMPLED_NONFILTRED_EXT_CLK = 3U,
  CMP_SAMPLED_FILTRED_INT_CLK = 4U, CMP_SAMPLED_FILTRED_EXT_CLK = 5U, CMP_WINDOWED = 6U, CMP_WINDOWED_RESAMPLED = 7U,
  CMP_WINDOWED_FILTRED = 8U
}
 Comparator functional modes Implements : cmp_mode_t_Class. More...
 

Functions

cMP DRV.
status_t CMP_DRV_Reset (const uint32_t instance)
 Reset all registers. More...
 
status_t CMP_DRV_GetInitConfigAll (cmp_module_t *config)
 Get reset configuration for all registers. More...
 
status_t CMP_DRV_Init (const uint32_t instance, const cmp_module_t *const config)
 Configure all comparator features with the given configuration structure. More...
 
status_t CMP_DRV_GetConfigAll (const uint32_t instance, cmp_module_t *const config)
 Gets the current comparator configuration. More...
 
status_t CMP_DRV_GetInitConfigDAC (cmp_dac_t *config)
 Get reset configuration for registers related with DAC. More...
 
status_t CMP_DRV_ConfigDAC (const uint32_t instance, const cmp_dac_t *config)
 Configure only the DAC component. More...
 
status_t CMP_DRV_GetDACConfig (const uint32_t instance, cmp_dac_t *const config)
 Return current configuration for DAC. More...
 
status_t CMP_DRV_GetInitConfigMUX (cmp_anmux_t *config)
 Get reset configuration for registers related with MUX. More...
 
status_t CMP_DRV_ConfigMUX (const uint32_t instance, const cmp_anmux_t *config)
 Configure only the MUX component. More...
 
status_t CMP_DRV_GetMUXConfig (const uint32_t instance, cmp_anmux_t *const config)
 Return configuration only for the MUX component. More...
 
status_t CMP_DRV_GetInitTriggerMode (cmp_trigger_mode_t *config)
 Get reset configuration for registers related with Trigger Mode. More...
 
status_t CMP_DRV_ConfigTriggerMode (const uint32_t instance, const cmp_trigger_mode_t *config)
 Configure trigger mode. More...
 
status_t CMP_DRV_GetTriggerModeConfig (const uint32_t instance, cmp_trigger_mode_t *const config)
 Get current trigger mode configuration. More...
 
status_t CMP_DRV_GetOutputFlags (const uint32_t instance, cmp_output_trigger_t *flags)
 Get comparator output flags. More...
 
status_t CMP_DRV_ClearOutputFlags (const uint32_t instance)
 Clear comparator output flags. More...
 
status_t CMP_DRV_GetInputFlags (const uint32_t instance, cmp_ch_list_t *flags)
 Gets input channels change flags. More...
 
status_t CMP_DRV_ClearInputFlags (const uint32_t instance)
 Clear comparator input channels flags. More...
 
status_t CMP_DRV_GetInitConfigComparator (cmp_comparator_t *config)
 Get reset configuration for registers related with comparator features. More...
 
status_t CMP_DRV_ConfigComparator (const uint32_t instance, const cmp_comparator_t *config)
 Configure only comparator features. More...
 
status_t CMP_DRV_GetComparatorConfig (const uint32_t instance, cmp_comparator_t *config)
 Return configuration for comparator from CMP module. More...