GPTMR driver APIs. More...
Data Structures | |
| struct | gptmr_channel_cfg |
| GPTMR counter mode. More... | |
Macros | |
| #define | GPTMR_CH_CMP_IRQ_MASK(ch, cmp) (1 << (ch * 4 + 2 + cmp)) |
| GPTMR channel IRQ mask. More... | |
| #define | GPTMR_CH_CAP_IRQ_MASK(ch) (1 << (ch * 4 + 1)) |
| #define | GPTMR_CH_RLD_IRQ_MASK(ch) (1 << (ch * 4)) |
| #define | GPTMR_CH_CMP_STAT_MASK(ch, cmp) (1 << (ch * 4 + 2 + cmp)) |
| GPTMR channel status. More... | |
| #define | GPTMR_CH_CAP_STAT_MASK(ch) (1 << (ch * 4 + 1)) |
| #define | GPTMR_CH_RLD_STAT_MASK(ch) (1 << (ch * 4)) |
| #define | GPTMR_CH_GCR_SWSYNCT_MASK(ch) (1 << ch) |
| GPTMR channel swsynct mask. More... | |
| #define | GPTMR_CH_CMP_COUNT (2U) |
| GPTMR one channel support output comparator count. More... | |
Typedefs | |
| typedef enum gptmr_synci_edge | gptmr_synci_edge_t |
| GPTMR synci valid edge. More... | |
| typedef enum gptmr_work_mode | gptmr_work_mode_t |
| GPTMR work mode. More... | |
| typedef enum gptmr_dma_request_event | gptmr_dma_request_event_t |
| GPTMR DMA request event. More... | |
| typedef enum gptmr_counter_type | gptmr_counter_type_t |
| GPTMR counter type. More... | |
| typedef struct gptmr_channel_cfg | gptmr_channel_config_t |
| GPTMR counter mode. More... | |
Functions | |
| static void | gptmr_channel_enable (GPTMR_Type *ptr, uint8_t ch_index, bool enable) |
| gptmr channel enable More... | |
| static void | gptmr_channel_reset_count (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel reset counter More... | |
| static void | gptmr_channel_update_count (GPTMR_Type *ptr, uint8_t ch_index, uint32_t value) |
| gptmr channel update counter More... | |
| static void | gptmr_channel_select_synci_valid_edge (GPTMR_Type *ptr, uint8_t ch_index, gptmr_synci_edge_t edge) |
| gptmr channel slect synci valid edge More... | |
| static void | gptmr_channel_enable_dma_request (GPTMR_Type *ptr, uint8_t ch_index, bool enable) |
| gptmr channel enable dma request More... | |
| static uint32_t | gptmr_channel_get_counter (GPTMR_Type *ptr, uint8_t ch_index, gptmr_counter_type_t capture) |
| gptmr channel get counter value More... | |
| static void | gptmr_trigger_channel_software_sync (GPTMR_Type *ptr, uint32_t ch_index_mask) |
| gptmr trigger channel software sync More... | |
| static void | gptmr_enable_irq (GPTMR_Type *ptr, uint32_t irq_mask) |
| gptmr enable irq More... | |
| static void | gptmr_disable_irq (GPTMR_Type *ptr, uint32_t irq_mask) |
| gptmr disable irq More... | |
| static bool | gptmr_check_status (GPTMR_Type *ptr, uint32_t mask) |
| gptmr check status More... | |
| static void | gptmr_clear_status (GPTMR_Type *ptr, uint32_t mask) |
| gptmr clear status More... | |
| static uint32_t | gptmr_get_status (GPTMR_Type *ptr) |
| gptmr get status More... | |
| static void | gptmr_stop_counter (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel stop counter More... | |
| static void | gptmr_enable_cmp_output (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel enable compare output More... | |
| static void | gptmr_disable_cmp_output (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel disable compare output More... | |
| static void | gptmr_channel_set_capmode (GPTMR_Type *ptr, uint8_t ch_index, gptmr_work_mode_t mode) |
| gptmr channel set capmode More... | |
| static gptmr_work_mode_t | gptmr_channel_get_capmode (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel get capmode More... | |
| static void | gptmr_update_cmp (GPTMR_Type *ptr, uint8_t ch_index, uint8_t cmp_index, uint32_t cmp) |
| gptmr channel update comparator More... | |
| static uint32_t | gptmr_channel_get_reload (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel get reload More... | |
| static void | gptmr_channel_config_update_reload (GPTMR_Type *ptr, uint8_t ch_index, uint32_t reload) |
| gptmr channel update reload More... | |
| static gptmr_dma_request_event_t | gptmr_channel_get_dma_request_event (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel get dma request event More... | |
| hpm_stat_t | gptmr_channel_config (GPTMR_Type *ptr, uint8_t ch_index, gptmr_channel_config_t *config, bool enable) |
| gptmr channel config More... | |
| void | gptmr_channel_get_default_config (GPTMR_Type *ptr, gptmr_channel_config_t *config) |
| gptmr channel get default config More... | |
| static void | gptmr_start_counter (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel start counter More... | |
| static void | gptmr_channel_set_cmp_initial_polarity (GPTMR_Type *ptr, uint8_t ch_index, bool high) |
| gptmr channel set comparator initial output polarity More... | |
| static bool | gptmr_channel_get_cmp_initial_polarity (GPTMR_Type *ptr, uint8_t ch_index) |
| gptmr channel get comparator initial output polarity More... | |
GPTMR driver APIs.
| #define GPTMR_CH_CAP_IRQ_MASK | ( | ch | ) | (1 << (ch * 4 + 1)) |
| #define GPTMR_CH_CAP_STAT_MASK | ( | ch | ) | (1 << (ch * 4 + 1)) |
| #define GPTMR_CH_CMP_COUNT (2U) |
GPTMR one channel support output comparator count.
| #define GPTMR_CH_CMP_IRQ_MASK | ( | ch, | |
| cmp | |||
| ) | (1 << (ch * 4 + 2 + cmp)) |
GPTMR channel IRQ mask.
| #define GPTMR_CH_CMP_STAT_MASK | ( | ch, | |
| cmp | |||
| ) | (1 << (ch * 4 + 2 + cmp)) |
GPTMR channel status.
| #define GPTMR_CH_GCR_SWSYNCT_MASK | ( | ch | ) | (1 << ch) |
GPTMR channel swsynct mask.
| #define GPTMR_CH_RLD_IRQ_MASK | ( | ch | ) | (1 << (ch * 4)) |
| #define GPTMR_CH_RLD_STAT_MASK | ( | ch | ) | (1 << (ch * 4)) |
| typedef struct gptmr_channel_cfg gptmr_channel_config_t |
GPTMR counter mode.
GPTMR channel config
| typedef enum gptmr_counter_type gptmr_counter_type_t |
GPTMR counter type.
| typedef enum gptmr_dma_request_event gptmr_dma_request_event_t |
GPTMR DMA request event.
| typedef enum gptmr_synci_edge gptmr_synci_edge_t |
GPTMR synci valid edge.
| typedef enum gptmr_work_mode gptmr_work_mode_t |
GPTMR work mode.
| enum gptmr_counter_type |
| enum gptmr_synci_edge |
| enum gptmr_work_mode |
| hpm_stat_t gptmr_channel_config | ( | GPTMR_Type * | ptr, |
| uint8_t | ch_index, | ||
| gptmr_channel_config_t * | config, | ||
| bool | enable | ||
| ) |
gptmr channel config
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | config | gptmr_channel_config_t |
| [in] | enable |
|
| hpm_stat_t | status_invalid_argument or status_success |
|
inlinestatic |
gptmr channel update reload
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | reload | reload value |
|
inlinestatic |
gptmr channel enable
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | enable |
|
|
inlinestatic |
gptmr channel enable dma request
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | enable |
|
|
inlinestatic |
gptmr channel get capmode
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| gptmr_work_mode_t | enum gptmr_work_mode_capture_at_rising_edge or gptmr_work_mode_capture_at_falling_edge |
|
inlinestatic |
gptmr channel get comparator initial output polarity
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| bool | true: initial output is high level |
|
inlinestatic |
gptmr channel get counter value
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | capture | gptmr_counter_type_t |
| void gptmr_channel_get_default_config | ( | GPTMR_Type * | ptr, |
| gptmr_channel_config_t * | config | ||
| ) |
gptmr channel get default config
| [in] | ptr | GPTMR base address |
| [out] | config | gptmr_channel_config_t |
|
inlinestatic |
gptmr channel get dma request event
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| gptmr_dma_request_event_t | gptmr_dma_request_on_cmp0 or gptmr_dma_request_on_reload |
|
inlinestatic |
gptmr channel get reload
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| RLD | register value |
|
inlinestatic |
gptmr channel reset counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
gptmr channel slect synci valid edge
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | edge | gptmr_synci_edge_t |
|
inlinestatic |
gptmr channel set capmode
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | mode | enum gptmr_work_mode_capture_at_rising_edge or gptmr_work_mode_capture_at_falling_edge and so on |
|
inlinestatic |
gptmr channel set comparator initial output polarity
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | high | true: initial output is high level |
|
inlinestatic |
gptmr channel update counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | value | updated vaue |
|
inlinestatic |
gptmr check status
| [in] | ptr | GPTMR base address |
| [in] | mask | channel flag mask |
|
inlinestatic |
gptmr clear status
| [in] | ptr | GPTMR base address |
| [in] | mask | channel flag mask |
|
inlinestatic |
gptmr channel disable compare output
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
gptmr disable irq
| [in] | ptr | GPTMR base address |
| [in] | irq_mask | irq mask |
|
inlinestatic |
gptmr channel enable compare output
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
gptmr enable irq
| [in] | ptr | GPTMR base address |
| [in] | irq_mask | irq mask |
|
inlinestatic |
gptmr get status
| [in] | ptr | GPTMR base address |
| SR | register value |
|
inlinestatic |
gptmr channel start counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
gptmr channel stop counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
gptmr trigger channel software sync
| [in] | ptr | GPTMR base address |
| [in] | ch_index_mask | channel index mask |
|
inlinestatic |
gptmr channel update comparator
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | cmp_index | comparator index |
| [in] | cmp | comparator value |