HPM SDK
HPMicro Software Development Kit
hpm_acmp_drv.h File Reference
#include "hpm_common.h"
#include "hpm_acmp_regs.h"
#include "hpm_soc_ip_feature.h"

Go to the source code of this file.

Data Structures

struct  acmp_channel_config
 ACMP channel config. More...
 

Macros

#define ACMP_HYST_LEVEL_0   (0U)
 ACMP hysteresis level. More...
 
#define ACMP_HYST_LEVEL_1   (1U)
 
#define ACMP_HYST_LEVEL_2   (2U)
 
#define ACMP_HYST_LEVEL_3   (3U)
 
#define ACMP_INPUT_DAC_OUT   (0U)
 ACMP input channel number. More...
 
#define ACMP_INPUT_ANALOG_1   (1U)
 
#define ACMP_INPUT_ANALOG_2   (2U)
 
#define ACMP_INPUT_ANALOG_3   (3U)
 
#define ACMP_INPUT_ANALOG_4   (4U)
 
#define ACMP_INPUT_ANALOG_5   (5U)
 
#define ACMP_INPUT_ANALOG_6   (6U)
 
#define ACMP_INPUT_ANALOG_7   (7U)
 
#define ACMP_FILTER_MODE_BYPASS   (0U)
 ACMP output digital filter mode. More...
 
#define ACMP_FILTER_MODE_CHANGE_IMMEDIATELY   (4U)
 
#define ACMP_FILTER_MODE_CHANGE_AFTER_FILTER   (5U)
 
#define ACMP_FILTER_MODE_STABLE_LOW   (6U)
 
#define ACMP_FILTER_MODE_STABLE_HIGH   (7U)
 
#define ACMP_EVENT_RISING_EDGE   (1U)
 ACMP rising/falling flage mask. More...
 
#define ACMP_EVENT_FALLING_EDGE   (2U)
 
#define ACMP_CAP_SEL_LEVEL_0   (0U)
 ACMP cap selection mask. More...
 
#define ACMP_CAP_SEL_LEVEL_1   (1U)
 
#define ACMP_CAP_SEL_LEVEL_2   (2U)
 
#define ACMP_CAP_SEL_LEVEL_3   (3U)
 

Typedefs

typedef struct acmp_channel_config acmp_channel_config_t
 ACMP channel config. More...
 

Functions

static void acmp_channel_config_dac (ACMP_Type *ptr, uint8_t ch, uint32_t value)
 ACMP channel config DAC output value. More...
 
static void acmp_channel_clear_status (ACMP_Type *ptr, uint8_t ch, uint32_t mask)
 ACMP channel clear status. More...
 
static uint32_t acmp_channel_get_status (ACMP_Type *ptr, uint8_t ch)
 ACMP channel get status. More...
 
static void acmp_channel_dma_request_enable (ACMP_Type *ptr, uint8_t ch, uint32_t mask, bool enable)
 ACMP channel enable DMA request. More...
 
static void acmp_channel_enable_irq (ACMP_Type *ptr, uint8_t ch, uint32_t mask, bool enable)
 ACMP channel enable IRQ. More...
 
static void acmp_channel_enable_dac (ACMP_Type *ptr, uint8_t ch, bool enable)
 ACMP channel enable DAC. More...
 
static void acmp_channel_enable_hpmode (ACMP_Type *ptr, uint8_t ch, bool enable)
 ACMP channel enable high performance mode. More...
 
static void acmp_channel_set_hyst (ACMP_Type *ptr, uint8_t ch, uint8_t level)
 ACMP channel enable hysteresis level. More...
 
static void acmp_channel_enable_cmp (ACMP_Type *ptr, uint8_t ch, bool enable)
 ACMP channel enable comparator. More...
 
static void acmp_channel_enable_cmp_output (ACMP_Type *ptr, uint8_t ch, bool enable)
 ACMP channel enable comparator output. More...
 
static void acmp_channel_cmp_output_bypass_filter (ACMP_Type *ptr, uint8_t ch, bool enable)
 ACMP channel bypass comparator output filter. More...
 
static void acmp_channel_enable_cmp_window_mode (ACMP_Type *ptr, uint8_t ch, bool enable)
 ACMP channel enable comparator window mode. More...
 
static void acmp_channel_invert_output (ACMP_Type *ptr, uint8_t ch, bool enable)
 ACMP channel invert comparator output. More...
 
static void acmp_channel_set_filter_mode (ACMP_Type *ptr, uint8_t ch, uint8_t filter)
 ACMP channel set comparator output filter mode. More...
 
static void acmp_channel_set_filter_length (ACMP_Type *ptr, uint8_t ch, uint16_t filter_length)
 ACMP channel set comparator output filter length. More...
 
hpm_stat_t acmp_channel_config (ACMP_Type *ptr, uint8_t ch, acmp_channel_config_t *config, bool enable)
 ACMP channel set comparator output filter extended length. More...
 
void acmp_channel_get_default_config (ACMP_Type *ptr, acmp_channel_config_t *config)
 ADC channel get default config setting. More...