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_channel_cfg_t |
struct | vsf_timer_channel_request_t |
struct | vsf_timer_status_t |
TIMER status information structure Contains the current status of TIMER operations. More... | |
struct | vsf_timer_capability_t |
struct | vsf_timer_op_t |
struct | vsf_timer_t |
Macros | |
#define | VSF_TIMER_CFG_MULTI_CLASS ENABLED |
Enable multi-class support by default for maximum availability. | |
#define | VSF_TIMER_CFG_PREFIX vsf |
In the specific hardware driver, either VSF_HW_TIMER_COUNT or VSF_HW_TIMER_MASK is defined. | |
#define | VSF_TIMER_CFG_FUNCTION_RENAME ENABLED |
Disable VSF_TIMER_CFG_FUNCTION_RENAME to use the original function names. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_IRQ_MASK in specific hardware drivers to redefine enum vsf_timer_irq_mask_t. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CFG in specific hardware drivers to redefine struct vsf_timer_cfg_t. vsf_timer_isr_handler_t type also needs to be redefined. For compatibility, members should not be deleted when redefining. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE in specific hardware drivers to redefine enum vsf_timer_channel_mode_t. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG in specific hardware drivers to redefine struct vsf_timer_channel_cfg_t. For compatibility, members should not be deleted when redefining. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_REQUEST DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_REQUEST in specific hardware drivers to redefine struct vsf_timer_channel_request_t. For compatibility, members should not be deleted when redefining. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_STATUS DISABLED |
In the specific hardware driver, we can enable VSF_TIMER_CFG_REIMPLEMENT_TYPE_STATUS to redefine struct vsf_timer_status_t. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_CTRL DISABLED |
In the specific hardware driver, we can enable VSF_TIMER_CFG_REIMPLEMENT_TYPE_CTRL to redefine vsf_timer_ctrl_t as needed. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CTRL DISABLED |
In the specific hardware driver, we can enable VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CTRL to redefine vsf_timer_channel_ctrl_t as needed. | |
#define | VSF_TIMER_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CAPABILITY in specific hardware drivers to redefine struct vsf_timer_capability_t. For compatibility, members should not be deleted when redefining. | |
#define | VSF_TIMER_CFG_INHERIT_HAL_CAPABILITY ENABLED |
Enable macro VSF_TIMER_CFG_INHERIT_HAL_CAPABILITY to inherit capability from HAL. | |
#define | VSF_TIMER_APIS(__prefix_name) |
Timer API template macros for generating timer function declarations and implementations. | |
Typedefs | |
typedef enum vsf_timer_channel_mode_t | vsf_timer_channel_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_channel_cfg_t | vsf_timer_channel_cfg_t |
typedef enum vsf_timer_ctrl_t | vsf_timer_ctrl_t |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time. | |
typedef enum vsf_timer_channel_ctrl_t | vsf_timer_channel_ctrl_t |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time. | |
typedef struct vsf_timer_channel_request_t | vsf_timer_channel_request_t |
typedef struct vsf_timer_status_t | vsf_timer_status_t |
TIMER status information structure Contains the current status of TIMER operations. | |
typedef struct vsf_timer_capability_t | vsf_timer_capability_t |
typedef struct vsf_timer_op_t | vsf_timer_op_t |
Enumerations | |
enum | vsf_timer_channel_mode_t { VSF_TIMER_CHANNEL_MODE_BASE = (0x00 << 0) , VSF_TIMER_BASE_ONESHOT = (0x00 << 5) , VSF_TIMER_BASE_CONTINUES = (0x01 << 5) } |
enum | { VSF_TIMER_CHANNEL_MODE_MASK = VSF_TIMER_CHANNEL_MODE_BASE , VSF_TIMER_BASE_COUNTER_MASK , VSF_TIMER_CHANNEL_MODE_ALL_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 } |
enum | vsf_timer_ctrl_t { __VSF_TIMER_CTRL_DUMMY = 0 } |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time. More... | |
enum | vsf_timer_channel_ctrl_t { __VSF_TIMER_CHANNEL_CTRL_DUMMY = 0 } |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time. More... | |
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 a TIMER instance. | |
fsm_rt_t | vsf_timer_disable (vsf_timer_t *timer_ptr) |
Disable a 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_timer_status_t | vsf_timer_status (vsf_timer_t *timer_ptr) |
Get the status of TIMER instance. | |
vsf_timer_capability_t | vsf_timer_capability (vsf_timer_t *timer_ptr) |
get the capability of TIMER instance. | |
vsf_err_t | vsf_timer_set_period (vsf_timer_t *timer_ptr, uint32_t period) |
TIMER set period (maximum count), used for change the period of TIMER dynamically. | |
vsf_err_t | vsf_timer_ctrl (vsf_timer_t *timer_ptr, vsf_timer_ctrl_t ctrl, void *param) |
Execute a control command on the TIMER instance. | |
vsf_err_t | vsf_timer_channel_config (vsf_timer_t *timer_ptr, uint8_t channel, vsf_timer_channel_cfg_t *channel_cfg_ptr) |
TIMER set the period width and pulse width for a channel. | |
vsf_err_t | vsf_timer_channel_start (vsf_timer_t *timer_ptr, uint8_t channel) |
start a TIMER channel | |
vsf_err_t | vsf_timer_channel_stop (vsf_timer_t *timer_ptr, uint8_t channel) |
stop a TIMER channel | |
vsf_err_t | vsf_timer_channel_request_start (vsf_timer_t *timer_ptr, uint8_t channel, vsf_timer_channel_request_t *request_ptr) |
start a TIMER channel request (usually based on DMA) | |
vsf_err_t | vsf_timer_channel_request_stop (vsf_timer_t *timer_ptr, uint8_t channel) |
stop a TIMER channel request. | |
vsf_err_t | vsf_timer_channel_ctrl (vsf_timer_t *timer_ptr, uint8_t channel, vsf_timer_channel_ctrl_t ctrl, void *param) |
Execute a control command on the TIMER channel. | |
#define VSF_TIMER_CFG_MULTI_CLASS ENABLED |
Enable multi-class support by default for maximum availability.
#define VSF_TIMER_CFG_PREFIX vsf |
In the specific hardware driver, either VSF_HW_TIMER_COUNT or VSF_HW_TIMER_MASK is defined.
Application code can redefine this prefix to specify a specific driver to call.
#define VSF_TIMER_CFG_FUNCTION_RENAME ENABLED |
Disable VSF_TIMER_CFG_FUNCTION_RENAME to use the original function names.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_IRQ_MASK in specific hardware drivers to redefine enum vsf_timer_irq_mask_t.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CFG in specific hardware drivers to redefine struct vsf_timer_cfg_t. vsf_timer_isr_handler_t type also needs to be redefined. For compatibility, members should not be deleted when redefining.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE in specific hardware drivers to redefine enum vsf_timer_channel_mode_t.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG in specific hardware drivers to redefine struct vsf_timer_channel_cfg_t. For compatibility, members should not be deleted when redefining.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_REQUEST DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_REQUEST in specific hardware drivers to redefine struct vsf_timer_channel_request_t. For compatibility, members should not be deleted when redefining.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_STATUS DISABLED |
In the specific hardware driver, we can enable VSF_TIMER_CFG_REIMPLEMENT_TYPE_STATUS to redefine struct vsf_timer_status_t.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CTRL DISABLED |
In the specific hardware driver, we can enable VSF_TIMER_CFG_REIMPLEMENT_TYPE_CTRL to redefine vsf_timer_ctrl_t as needed.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CTRL DISABLED |
In the specific hardware driver, we can enable VSF_TIMER_CFG_REIMPLEMENT_TYPE_CHANNEL_CTRL to redefine vsf_timer_channel_ctrl_t as needed.
#define VSF_TIMER_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Enable macro VSF_TIMER_CFG_REIMPLEMENT_TYPE_CAPABILITY in specific hardware drivers to redefine struct vsf_timer_capability_t. For compatibility, members should not be deleted when redefining.
#define VSF_TIMER_CFG_INHERIT_HAL_CAPABILITY ENABLED |
Enable macro VSF_TIMER_CFG_INHERIT_HAL_CAPABILITY to inherit capability from HAL.
#define VSF_TIMER_APIS | ( | __prefix_name | ) |
Timer API template macros for generating timer function declarations and implementations.
typedef enum vsf_timer_channel_mode_t vsf_timer_channel_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
Timer configuration structure
typedef struct vsf_timer_channel_cfg_t vsf_timer_channel_cfg_t |
typedef enum vsf_timer_ctrl_t vsf_timer_ctrl_t |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
typedef enum vsf_timer_channel_ctrl_t vsf_timer_channel_ctrl_t |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
typedef struct vsf_timer_channel_request_t vsf_timer_channel_request_t |
typedef struct vsf_timer_status_t vsf_timer_status_t |
TIMER status information structure Contains the current status of TIMER operations.
typedef struct vsf_timer_capability_t vsf_timer_capability_t |
typedef struct vsf_timer_op_t vsf_timer_op_t |
anonymous enum |
enum vsf_timer_irq_mask_t |
enum vsf_timer_ctrl_t |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
Enumerator | |
---|---|
__VSF_TIMER_CTRL_DUMMY | Dummy value for compilation. |
Predefined VSF TIMER control command that can be reimplemented in specific hal drivers.Optional control command require one or more enumeration options and a macro with the same name to determine if they are supported at runtime. If the feature supports more than one option, it is recommended to provide the corresponding MASK option, so that the user can switch to different modes at compile-time.
Enumerator | |
---|---|
__VSF_TIMER_CHANNEL_CTRL_DUMMY | Dummy value for compilation. |
|
extern |
Initialize a Timer instance.
[in] | timer_ptr | pointer to Timer instance |
[in] | cfg_ptr | pointer to configuration structure |
|
extern |
|
extern |
Enable a TIMER instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
|
extern |
Disable a 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 |
Get the status of TIMER instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
|
extern |
get the capability of TIMER instance.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
|
extern |
TIMER set period (maximum count), used for change the period of TIMER dynamically.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | period | timer period width (in clock counter) |
|
extern |
Execute a control command on the TIMER instance.
[in,out] | timer_ptr | Pointer to TIMER instance structure vsf_timer_t |
[in] | ctrl | Control command from vsf_timer_ctrl_t enumeration |
[in] | param | Command-specific parameter (can be NULL depending on command) |
|
extern |
TIMER set the period width and pulse width for a channel.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | channel | timer channel |
[in] | channel_cfg_ptr | a pointer to structure vsf_timer_channel_cfg_t |
|
extern |
start a TIMER channel
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | channel | timer channel |
|
extern |
stop a TIMER channel
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | channel | timer channel |
|
extern |
start a TIMER channel request (usually based on DMA)
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | channel | timer channel |
[in] | request_ptr | a pointer to request structure vsf_timer_channel_request_t For VSF_TIMER_CHANNEL_MODE_BASE mode, period_buffer in structure vsf_timer_channel_request_t is array of period value to be set after each overflow. For VSF_TIMER_CHANNEL_MODE_PWM mode, pwm_buffer in structure vsf_timer_channel_request_t is array of pulse value to be set after each overflow. For VSF_TIMER_CHANNEL_MODE_OUTPUT_COMPARE mode, pulse_buffer in structure vsf_timer_channel_request_t is array of pulse value to be set after each overflow. For VSF_TIMER_CHANNEL_MODE_INPUT_CAPTURE mode, input_capture_buffer in structure vsf_timer_channel_request_t is array of input capture value. For VSF_TIMER_CHANNEL_MODE_ENCODER mode, channel_a_buffer and channel_b_buffer in structure vsf_timer_channel_request_t is array of encoder value for channel A and channel B. |
|
extern |
stop a TIMER channel request.
[in] | timer_ptr | a pointer to structure vsf_timer_t |
[in] | channel | timer channel |
|
extern |
Execute a control command on the TIMER channel.
[in,out] | timer_ptr | Pointer to TIMER instance structure vsf_timer_t |
[in] | channel | timer channel |
[in] | ctrl | Control command from vsf_timer_channel_ctrl_t enumeration |
[in] | param | Command-specific parameter (can be NULL depending on command) |