VSF Documented
|
Go to the source code of this file.
Data Structures | |
struct | vsf_timer_isr_t |
struct | vsf_timer_cfg_t |
timer configuration More... | |
struct | vsf_timer_capability_t |
struct | vsf_timer_op_t |
struct | vsf_timer_t |
Typedefs | |
typedef enum vsf_timer_mode_t | vsf_timer_mode_t |
typedef enum vsf_timer_irq_mask_t | vsf_timer_irq_mask_t |
typedef struct vsf_timer_t | vsf_timer_t |
typedef void | vsf_timer_isr_handler_t(void *target_ptr, vsf_timer_t *timer_ptr, vsf_timer_irq_mask_t irq_mask) |
typedef struct vsf_timer_isr_t | vsf_timer_isr_t |
typedef struct vsf_timer_cfg_t | vsf_timer_cfg_t |
timer configuration | |
typedef struct vsf_timer_capability_t | vsf_timer_capability_t |
typedef struct vsf_timer_op_t | vsf_timer_op_t |
Enumerations | |
enum | vsf_timer_mode_t { VSF_TIMER_MODE_ONESHOT = (0x00 << 0) , VSF_TIMER_MODE_CONTINUES = (0x01 << 0) , VSF_TIMER_MODE_PWM = (0x01 << 1) , VSF_TIMER_MODE_NO_PWM = (0x00 << 1) } |
enum | { VSF_TIMER_MODE_RESTART_COUNT = 2 , VSF_TIMER_MODE_RESTART_MASK , VSF_TIMER_MODE_PWM_COUNT = 2 , VSF_TIMER_MODE_PWM_MASK , VSF_TIMER_MODE_MASK_COUNT = 3 , VSF_TIMER_MODE_ALL_BITS_MASK = VSF_TIMER_MODE_RESTART_MASK } |
enum | vsf_timer_irq_mask_t { VSF_TIMER_IRQ_MASK_OVERFLOW = (0x01 << 0) } |
enum | { VSF_TIMER_IRQ_COUNT = 1 , VSF_TIMER_IRQ_ALL_BITS_MASK = VSF_TIMER_IRQ_MASK_OVERFLOW } |
Functions | |
vsf_err_t | vsf_timer_init (vsf_timer_t *timer_ptr, vsf_timer_cfg_t *cfg_ptr) |
initialize a timer instance. | |
void | vsf_timer_fini (vsf_timer_t *timer_ptr) |
finalize a timer instance. | |
fsm_rt_t | vsf_timer_enable (vsf_timer_t *timer_ptr) |
enable interrupt masks of timer instance. | |
fsm_rt_t | vsf_timer_disable (vsf_timer_t *timer_ptr) |
disable interrupt masks of timer instance. | |
vsf_timer_capability_t | vsf_timer_capability (vsf_timer_t *timer_ptr) |
get the capability of timer instance. | |
void | vsf_timer_irq_enable (vsf_timer_t *timer_ptr, vsf_timer_irq_mask_t irq_mask) |
enable interrupt masks of timer instance. | |
void | vsf_timer_irq_disable (vsf_timer_t *timer_ptr, vsf_timer_irq_mask_t irq_mask) |
disable interrupt masks of timer instance. | |
vsf_err_t | vsf_timer_set_period (vsf_timer_t *timer_ptr, uint32_t period) |
timer set period (maximum count) | |
vsf_err_t | vsf_timer_pwm_set (vsf_timer_t *timer_ptr, uint8_t channel, uint32_t period, uint32_t pulse) |
timer pwm set the period width and pulse width for a channel | |
#define VSF_TIMER_CFG_MULTI_CLASS ENABLED |
#define VSF_TIMER_CFG_PREFIX vsf |
#define VSF_TIMER_CFG_FUNCTION_RENAME ENABLED |
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED |
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Redefine struct vsf_timer_cfg_t. The vsf_timer_isr_handler_t type also needs to be redefined For compatibility, members should not be deleted when struct vsf_timer_cfg_t redefining.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Redefine struct vsf_timer_capability_t. For compatibility, members should not be deleted when struct vsf_timer_capability_t redefining.
#define VSF_TIMER_CFG_INHERT_HAL_CAPABILITY ENABLED |
#define VSF_TIMER_APIS | ( | __prefix_name | ) |
#define __VSF_HAL_TEMPLATE_API VSF_HAL_TEMPLATE_API_FP |
#define __vsf_timer_t VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_t) |
#define vsf_timer_init | ( | __TIME, | |
... | |||
) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_init) ((__vsf_timer_t *)(__TIME), ##__VA_ARGS__) |
#define vsf_timer_fini | ( | __TIME, | |
... | |||
) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_fini) ((__vsf_timer_t *)(__TIME)) |
#define vsf_timer_enable | ( | __TIME | ) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_enable) ((__vsf_timer_t *)(__TIME)) |
#define vsf_timer_disable | ( | __TIME | ) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_disable) ((__vsf_timer_t *)(__TIME)) |
#define vsf_timer_capability | ( | __TIME | ) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_capability) ((__vsf_timer_t *)(__TIME)) |
#define vsf_timer_irq_enable | ( | __TIME, | |
... | |||
) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_irq_enable) ((__vsf_timer_t *)(__TIME), ##__VA_ARGS__) |
#define vsf_timer_irq_disable | ( | __TIME, | |
... | |||
) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_irq_disable) ((__vsf_timer_t *)(__TIME), ##__VA_ARGS__) |
#define vsf_timer_set_period | ( | __TIME, | |
... | |||
) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_set_period) ((__vsf_timer_t *)(__TIME), ##__VA_ARGS__) |
#define vsf_timer_pwm_set | ( | __TIME, | |
... | |||
) | VSF_MCONNECT(VSF_TIMER_CFG_PREFIX, _timer_pwm_set) ((__vsf_timer_t *)(__TIME), ##__VA_ARGS__) |
typedef enum vsf_timer_mode_t vsf_timer_mode_t |
typedef enum vsf_timer_irq_mask_t vsf_timer_irq_mask_t |
typedef struct vsf_timer_t vsf_timer_t |
typedef void vsf_timer_isr_handler_t(void *target_ptr, vsf_timer_t *timer_ptr, vsf_timer_irq_mask_t irq_mask) |
typedef struct vsf_timer_isr_t vsf_timer_isr_t |
typedef struct vsf_timer_cfg_t vsf_timer_cfg_t |
timer configuration
typedef struct vsf_timer_capability_t vsf_timer_capability_t |
typedef struct vsf_timer_op_t vsf_timer_op_t |
enum vsf_timer_mode_t |
anonymous enum |
enum vsf_timer_irq_mask_t |
|
extern |
initialize a timer instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | cfg_ptr | a pointer to structure vsf_timer_cfg_t |
|
extern |
|
extern |
enable interrupt masks of timer instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | irq_mask | one or more value of enum vsf_timer_irq_mask_t |
|
extern |
disable interrupt masks of timer instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | irq_mask | one or more value of enum vsf_timer_irq_mask_t, vsf_timer_irq_mask_t |
|
extern |
get the capability of timer instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
|
extern |
enable interrupt masks of timer instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | irq_mask | one or more value of enum vsf_timer_irq_mask_t |
|
extern |
disable interrupt masks of timer instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | irq_mask | one or more value of enum vsf_timer_irq_mask_t, vsf_timer_irq_mask_t |
|
extern |
timer set period (maximum count)
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | period | timer period width (in clock counter) |
|
extern |
timer pwm set the period width and pulse width for a channel
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | channel | timer pwm channel |
[in] | period | timer pwm period width (in clock counter) |
[in] | pulse | timer pwm pulse width (in clock counter) |