SDM APIs. More...
Data Structures | |
| struct | sdm_control_t |
| struct | sdm_channel_common_config_t |
| struct | sdm_comparator_config_t |
| struct | sdm_filter_config_t |
| struct | sdm_output_config_t |
Macros | |
| #define | SAMPLING_MODE_MASK (0x7U) |
| #define | CHN_SAMPLING_MODE_SHIFT(ch) ((ch) * 3U + SDM_CTRL_CHMD_SHIFT) |
| #define | CHN_SAMPLING_MODE_MASK(ch) (SAMPLING_MODE_MASK << CHN_SAMPLING_MODE_SHIFT(ch)) |
| #define | CH0_EN_MASK (0x1U << SDM_CTRL_CH_EN_SHIFT) |
| #define | CHN_EN_MASK(ch) (CH0_EN_MASK << (ch)) |
| #define | CHN_ERR_MASK(ch) (SDM_INT_EN_CH0ERR_MASK << (ch)) |
| #define | CHN_DRY_MASK(ch) (SDM_INT_EN_CH0DRY_MASK << (ch)) |
Functions | |
| static void | sdm_enable_module_interrupt (SDM_Type *ptr, bool enable) |
| sdm enable module interrupt More... | |
| static void | sdm_enable_channel (SDM_Type *ptr, uint8_t ch_index, bool enable) |
| sdm enable channel More... | |
| static void | sdm_enable_channel_filter (SDM_Type *ptr, uint8_t ch_index, bool enable) |
| sdm enable channel sample data function More... | |
| static void | sdm_enable_channel_comparator (SDM_Type *ptr, uint8_t ch_index, bool enable) |
| sdm enable channel amplitude detect function More... | |
| static void | sdm_enable_channel_by_mask (SDM_Type *ptr, uint32_t ch_mask) |
| sdm enable channel by mask More... | |
| static void | sdm_set_channel_sampling_mode (SDM_Type *ptr, uint8_t ch_index, sdm_sampling_mode_t mode) |
| sdm set channel sampling mode More... | |
| static void | sdm_enable_channel_interrupt (SDM_Type *ptr, uint32_t mask) |
| sdm enable channel interrupt More... | |
| static uint32_t | sdm_get_status (SDM_Type *ptr) |
| sdm get status register value More... | |
| static bool | sdm_get_channel_data_ready_status (SDM_Type *ptr, uint8_t ch) |
| get channel data ready status More... | |
| static bool | sdm_get_channel_data_error_status (SDM_Type *ptr, uint8_t ch) |
| get channel error status More... | |
| static void | sdm_set_ch_fifo_threshold (SDM_Type *ptr, uint8_t ch, uint8_t threshold) |
| sdm set channel's fifo threshold More... | |
| static uint8_t | sdm_get_ch_fifo_threshold (SDM_Type *ptr, uint8_t ch) |
| sdm get channel fifo threshold More... | |
| static uint32_t | sdm_get_channel_filter_status (SDM_Type *ptr, uint8_t ch) |
| sdm get channel filter status More... | |
| static void | sdm_clean_channel_filter_status (SDM_Type *ptr, uint8_t ch, uint32_t mask) |
| sdm clean channel sample data status More... | |
| static uint8_t | sdm_get_channel_fifo_data_count (SDM_Type *ptr, uint8_t ch) |
| sdm get channel data count in fifo More... | |
| static int32_t | sdm_get_channel_fifo_data (SDM_Type *ptr, uint8_t ch) |
| sdm get channel filter output data in fifo More... | |
| static uint8_t | sdm_get_channel_clock_cycle_count (SDM_Type *ptr, uint8_t ch) |
| sdm get channel input clock cycle count More... | |
| static uint16_t | sdm_get_channel_comparator_data (SDM_Type *ptr, uint8_t ch) |
| sdm get channel comparator data More... | |
| static void | sdm_set_channel_comparator_high_threshold (SDM_Type *ptr, uint8_t ch, uint16_t value) |
| sdm set channel comparator high threshold More... | |
| static void | sdm_set_channel_comparator_zero_crossing_threshold (SDM_Type *ptr, uint8_t ch, uint16_t value) |
| sdm set channel comparator zero crossing threshold More... | |
| static void | sdm_set_channel_comparator_low_threshold (SDM_Type *ptr, uint8_t ch, uint16_t value) |
| sdm set channel comparator low threshold More... | |
| static uint32_t | sdm_get_channel_comparator_status (SDM_Type *ptr, uint8_t ch) |
| sdm get channel comparator status register value More... | |
| static void | sdm_clean_channel_comparator_status (SDM_Type *ptr, uint8_t ch, uint32_t mask) |
| sdm clean channel amplitude detect status More... | |
| void | sdm_get_default_module_control (SDM_Type *ptr, sdm_control_t *control) |
| sdm get default module control More... | |
| void | sdm_init_module (SDM_Type *ptr, sdm_control_t *control) |
| sdm init module More... | |
| void | sdm_get_channel_common_setting (SDM_Type *ptr, sdm_channel_common_config_t *config) |
| sdm get channel common setting More... | |
| void | sdm_config_channel_common_setting (SDM_Type *ptr, uint8_t ch_index, sdm_channel_common_config_t *config) |
| sdm config channel's common setting More... | |
| void | sdm_get_channel_default_filter_config (SDM_Type *ptr, sdm_filter_config_t *filter_config) |
| sdm get channel default filter config More... | |
| void | sdm_config_channel_filter (SDM_Type *ptr, uint8_t ch_index, sdm_filter_config_t *filter_config) |
| sdm config channel filter More... | |
| void | sdm_get_channel_default_comparator_config (SDM_Type *ptr, sdm_comparator_config_t *cmp_config) |
| sdm get channel default comparator config More... | |
| void | sdm_config_channel_comparator (SDM_Type *ptr, uint8_t ch_index, sdm_comparator_config_t *cmp_config) |
| sdm config channel comparator More... | |
| hpm_stat_t | sdm_receive_one_filter_data (SDM_Type *ptr, uint8_t ch_index, bool using_fifo, int8_t *data, uint8_t data_len_in_bytes) |
| sdm receive one filter data More... | |
| hpm_stat_t | sdm_receive_filter_data (SDM_Type *ptr, uint8_t ch_index, bool using_fifo, int8_t *data, uint32_t count, uint8_t data_len_in_bytes) |
| sdm receive filter data More... | |
SDM APIs.
| #define CH0_EN_MASK (0x1U << SDM_CTRL_CH_EN_SHIFT) |
#include <drivers/inc/hpm_sdm_drv.h>
| #define CHN_DRY_MASK | ( | ch | ) | (SDM_INT_EN_CH0DRY_MASK << (ch)) |
#include <drivers/inc/hpm_sdm_drv.h>
| #define CHN_EN_MASK | ( | ch | ) | (CH0_EN_MASK << (ch)) |
#include <drivers/inc/hpm_sdm_drv.h>
| #define CHN_ERR_MASK | ( | ch | ) | (SDM_INT_EN_CH0ERR_MASK << (ch)) |
#include <drivers/inc/hpm_sdm_drv.h>
| #define CHN_SAMPLING_MODE_MASK | ( | ch | ) | (SAMPLING_MODE_MASK << CHN_SAMPLING_MODE_SHIFT(ch)) |
#include <drivers/inc/hpm_sdm_drv.h>
| #define CHN_SAMPLING_MODE_SHIFT | ( | ch | ) | ((ch) * 3U + SDM_CTRL_CHMD_SHIFT) |
#include <drivers/inc/hpm_sdm_drv.h>
| #define SAMPLING_MODE_MASK (0x7U) |
#include <drivers/inc/hpm_sdm_drv.h>
#include <drivers/inc/hpm_sdm_drv.h>
| Enumerator | |
|---|---|
| sdm_chn0_enable_mask | |
| sdm_chn1_enable_mask | |
| sdm_chn2_enable_mask | |
| sdm_chn3_enable_mask | |
#include <drivers/inc/hpm_sdm_drv.h>
| Enumerator | |
|---|---|
| sdm_chn0_error_mask | |
| sdm_chn1_error_mask | |
| sdm_chn2_error_mask | |
| sdm_chn3_error_mask | |
| sdm_chn0_data_ready_mask | |
| sdm_chn1_data_ready_mask | |
| sdm_chn2_data_ready_mask | |
| sdm_chn3_data_ready_mask | |
#include <drivers/inc/hpm_sdm_drv.h>
| Enumerator | |
|---|---|
| sdm_comparator_no_event | |
| sdm_comparator_event_out_high_threshold | |
| sdm_comparator_event_out_low_threshold | |
| sdm_comparator_event_hz | |
| sdm_comparator_event_invalid_clk | |
| enum sdm_filter_type_t |
#include <drivers/inc/hpm_sdm_drv.h>
| Enumerator | |
|---|---|
| sdm_filter_sinc1 | |
| sdm_filter_sinc2 | |
| sdm_filter_sinc3 | |
| sdm_filter_fast_sinc2 | |
| enum sdm_sampling_mode_t |
#include <drivers/inc/hpm_sdm_drv.h>
| Enumerator | |
|---|---|
| sdm_sampling_rising_clk_edge | |
| sdm_sampling_every_clk_edge | |
| sdm_sampling_manchester_mode | |
| sdm_sampling_falling_clk_edge | |
| sdm_sampling_rising_two_clk_edge | |
| sdm_sampling_falling_two_clk_edge | |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm clean channel amplitude detect status
| ptr | SDM base address |
| ch | channel index |
| mask | status mask value |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm clean channel sample data status
| ptr | SDM base address |
| ch | channel index |
| mask | status mask value |
| void sdm_config_channel_common_setting | ( | SDM_Type * | ptr, |
| uint8_t | ch_index, | ||
| sdm_channel_common_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm config channel's common setting
| ptr | SDM base address |
| ch_index | channel index |
| config | sdm_channel_common_config_t |
| void sdm_config_channel_comparator | ( | SDM_Type * | ptr, |
| uint8_t | ch_index, | ||
| sdm_comparator_config_t * | cmp_config | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm config channel comparator
| ptr | SDM base address |
| ch_index | channel index |
| cmp_config | sdm_comparator_config_t |
| void sdm_config_channel_filter | ( | SDM_Type * | ptr, |
| uint8_t | ch_index, | ||
| sdm_filter_config_t * | filter_config | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm config channel filter
| ptr | SDM base address |
| ch_index | channel index |
| filter_config | sdm_filter_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm enable channel
| ptr | SDM base address |
| ch_index | channel index |
| enable | true for enable, false for disable |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm enable channel by mask
| ptr | SDM base address |
| ch_mask | sdm_channel_enable_mask_t |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm enable channel amplitude detect function
| ptr | SDM base address |
| ch_index | channel index |
| enable | true for enable, false for disable |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm enable channel sample data function
| ptr | SDM base address |
| ch_index | channel index |
| enable | true for enable, false for disable |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm enable channel interrupt
| ptr | SDM base address |
| mask | sdm_channel_int_status_mask_t, support bitwise or operation |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm enable module interrupt
| ptr | SDM base address |
| enable | true for enable, false for disable |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel fifo threshold
| ptr | SDM base address |
| ch | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel input clock cycle count
| ptr | SDM base address |
| ch | channel index |
| void sdm_get_channel_common_setting | ( | SDM_Type * | ptr, |
| sdm_channel_common_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel common setting
| ptr | SDM base address |
| config | sdm_channel_common_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel comparator data
| ptr | SDM base address |
| ch | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel comparator status register value
| ptr | SDM base address |
| ch | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
get channel error status
| ptr | SDM base address |
| ch | channel |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
get channel data ready status
| ptr | SDM base address |
| ch | channel |
| void sdm_get_channel_default_comparator_config | ( | SDM_Type * | ptr, |
| sdm_comparator_config_t * | cmp_config | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel default comparator config
| ptr | SDM base address |
| cmp_config | sdm_comparator_config_t |
< 1-32, when 32, write 0 into bitfield
| void sdm_get_channel_default_filter_config | ( | SDM_Type * | ptr, |
| sdm_filter_config_t * | filter_config | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel default filter config
| ptr | SDM base address |
| filter_config | sdm_filter_config_t |
< 1- 256
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel filter output data in fifo
| ptr | SDM base address |
| ch | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel data count in fifo
| ptr | SDM base address |
| ch | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get channel filter status
| ptr | SDM base address |
| ch | channel index |
| void sdm_get_default_module_control | ( | SDM_Type * | ptr, |
| sdm_control_t * | control | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get default module control
| ptr | SDM base address |
| control | sdm_control_t |
< configure clk sync for all channels
< configure data sync for all channels
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm get status register value
| ptr | SDM base address |
| void sdm_init_module | ( | SDM_Type * | ptr, |
| sdm_control_t * | control | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm init module
| ptr | SDM base address |
| control | sdm_control_t |
| hpm_stat_t sdm_receive_filter_data | ( | SDM_Type * | ptr, |
| uint8_t | ch_index, | ||
| bool | using_fifo, | ||
| int8_t * | data, | ||
| uint32_t | count, | ||
| uint8_t | data_len_in_bytes | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm receive filter data
| ptr | SDM base address |
| ch_index | channel index |
| using_fifo | true for getting data from fifo, false for getting data from register |
| data | data buff |
| count | data count |
| data_len_in_bytes | output data len in bytes |
| hpm_stat_t | status_success only if it succeeds |
| hpm_stat_t sdm_receive_one_filter_data | ( | SDM_Type * | ptr, |
| uint8_t | ch_index, | ||
| bool | using_fifo, | ||
| int8_t * | data, | ||
| uint8_t | data_len_in_bytes | ||
| ) |
#include <drivers/inc/hpm_sdm_drv.h>
sdm receive one filter data
| ptr | SDM base address |
| ch_index | channel index |
| using_fifo | true for getting data from fifo, false for getting data from register |
| data | data buff |
| data_len_in_bytes | output data len in bytes |
| hpm_stat_t | status_success only if it succeeds |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm set channel's fifo threshold
| ptr | SDM base address |
| ch | channel index |
| threshold | threshold value |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm set channel comparator high threshold
| ptr | SDM base address |
| ch | channel index |
| value | high threshold value |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm set channel comparator low threshold
| ptr | SDM base address |
| ch | channel index |
| value | low threshold value |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm set channel comparator zero crossing threshold
| ptr | SDM base address |
| ch | channel index |
| value | zero crossing threshold value |
|
inlinestatic |
#include <drivers/inc/hpm_sdm_drv.h>
sdm set channel sampling mode
| ptr | SDM base address |
| ch_index | channel index |
| mode | sdm_sampling_mode_t |