GPTMR driver APIs. More...
Data Structures | |
| struct | gptmr_channel_config |
| 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_config | 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... | |
GPTMR driver APIs.
| #define GPTMR_CH_CAP_IRQ_MASK | ( | ch | ) | (1 << (ch * 4 + 1)) |
#include <drivers/inc/hpm_gptmr_drv.h>
| #define GPTMR_CH_CAP_STAT_MASK | ( | ch | ) | (1 << (ch * 4 + 1)) |
#include <drivers/inc/hpm_gptmr_drv.h>
| #define GPTMR_CH_CMP_COUNT (2U) |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR one channel support output comparator count.
| #define GPTMR_CH_CMP_IRQ_MASK | ( | ch, | |
| cmp | |||
| ) | (1 << (ch * 4 + 2 + cmp)) |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR channel IRQ mask.
| #define GPTMR_CH_CMP_STAT_MASK | ( | ch, | |
| cmp | |||
| ) | (1 << (ch * 4 + 2 + cmp)) |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR channel status.
| #define GPTMR_CH_GCR_SWSYNCT_MASK | ( | ch | ) | (1 << ch) |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR channel swsynct mask.
| #define GPTMR_CH_RLD_IRQ_MASK | ( | ch | ) | (1 << (ch * 4)) |
#include <drivers/inc/hpm_gptmr_drv.h>
| #define GPTMR_CH_RLD_STAT_MASK | ( | ch | ) | (1 << (ch * 4)) |
#include <drivers/inc/hpm_gptmr_drv.h>
| typedef struct gptmr_channel_config gptmr_channel_config_t |
| typedef enum gptmr_counter_type gptmr_counter_type_t |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR counter type.
| typedef enum gptmr_dma_request_event gptmr_dma_request_event_t |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR DMA request event.
| typedef enum gptmr_synci_edge gptmr_synci_edge_t |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR synci valid edge.
| typedef enum gptmr_work_mode gptmr_work_mode_t |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR work mode.
| enum gptmr_counter_type |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR counter type.
| Enumerator | |
|---|---|
| gptmr_counter_type_rising_edge | |
| gptmr_counter_type_falling_edge | |
| gptmr_counter_type_measured_period | |
| gptmr_counter_type_measured_duty_cycle | |
| gptmr_counter_type_normal | |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR DMA request event.
| Enumerator | |
|---|---|
| gptmr_dma_request_on_cmp0 | |
| gptmr_dma_request_on_cmp1 | |
| gptmr_dma_request_on_input_signal_toggle | |
| gptmr_dma_request_on_reload | |
| gptmr_dma_request_disabled | |
| enum gptmr_synci_edge |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR synci valid edge.
| Enumerator | |
|---|---|
| gptmr_synci_edge_none | |
| gptmr_synci_edge_falling | |
| gptmr_synci_edge_rising | |
| gptmr_synci_edge_both | |
| enum gptmr_work_mode |
#include <drivers/inc/hpm_gptmr_drv.h>
GPTMR work mode.
| Enumerator | |
|---|---|
| gptmr_work_mode_no_capture | |
| gptmr_work_mode_capture_at_rising_edge | |
| gptmr_work_mode_capture_at_falling_edge | |
| gptmr_work_mode_capture_at_both_edge | |
| gptmr_work_mode_measure_width | |
| hpm_stat_t gptmr_channel_config | ( | GPTMR_Type * | ptr, |
| uint8_t | ch_index, | ||
| gptmr_channel_config_t * | config, | ||
| bool | enable | ||
| ) |
#include <drivers/inc/hpm_gptmr_drv.h>
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 |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel update reload
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | reload | reload value |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel enable
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | enable |
|
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel enable dma request
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | enable |
|
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
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 |
#include <drivers/inc/hpm_gptmr_drv.h>
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 | ||
| ) |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel get default config
| [in] | ptr | GPTMR base address |
| [out] | config | gptmr_channel_config_t |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
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 |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel get reload
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| RLD | register value |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel reset counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel slect synci valid edge
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | edge | gptmr_synci_edge_t |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
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 |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel update counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | value | updated vaue |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr check status
| [in] | ptr | GPTMR base address |
| [in] | mask | channel flag mask |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr clear status
| [in] | ptr | GPTMR base address |
| [in] | mask | channel flag mask |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel disable compare output
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr disable irq
| [in] | ptr | GPTMR base address |
| [in] | irq_mask | irq mask |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel enable compare output
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr enable irq
| [in] | ptr | GPTMR base address |
| [in] | irq_mask | irq mask |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr get status
| [in] | ptr | GPTMR base address |
| SR | register value |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel start counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel stop counter
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr trigger channel software sync
| [in] | ptr | GPTMR base address |
| [in] | ch_index_mask | channel index mask |
|
inlinestatic |
#include <drivers/inc/hpm_gptmr_drv.h>
gptmr channel update comparator
| [in] | ptr | GPTMR base address |
| [in] | ch_index | channel index |
| [in] | cmp_index | comparator index |
| [in] | cmp | comparator value |