|
VSF Documented
|
Go to the source code of this file.
Data Structures | |
| struct | vsf_pwm_cfg_t |
| PWM configuration structure. Used to configure the PWM generator's frequency settings. More... | |
| struct | vsf_pwm_capability_t |
| PWM capability structure. Describes the capabilities and limitations of the PWM hardware. More... | |
| struct | vsf_pwm_op_t |
| struct | vsf_pwm_t |
Macros | |
| #define | VSF_PWM_CFG_MULTI_CLASS ENABLED |
| Enable multi-class support by default for maximum availability. | |
| #define | VSF_PWM_CFG_PREFIX vsf |
| Convert count to mask in specific hardware driver. | |
| #define | VSF_PWM_CFG_FUNCTION_RENAME ENABLED |
| #define | VSF_PWM_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
| Enable macro VSF_PWM_CFG_REIMPLEMENT_TYPE_CFG in specific hardware drivers to redefine struct vsf_pwm_cfg_t. For compatibility, members should not be deleted when redefining. The vsf_pwm_isr_handler_t type also needs to be redefined. | |
| #define | VSF_PWM_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
| Redefine struct vsf_pwm_capability_t. For compatibility, members should not be deleted when redefining. | |
| #define | VSF_PWM_CFG_INHERIT_HAL_CAPABILITY ENABLED |
| In specific hardware driver, we can enable macro VSF_PWM_CFG_INHERIT_HAL_CAPABILITY to inherit the structure vsf_peripheral_capability_t. | |
| #define | VSF_PWM_CFG_REIMPLEMENT_TYPE_CTRL DISABLED |
| Enable macro VSF_PWM_CFG_REIMPLEMENT_TYPE_CTRL in specific hardware drivers to redefine enum vsf_pwm_ctrl_t. This allows hardware-specific control commands to be added to the control enumeration. | |
| #define | VSF_PWM_APIS(__prefix_name) |
| PWM API template, used to generate PWM type, specific prefix function declarations, etc. | |
Typedefs | |
| typedef struct vsf_pwm_cfg_t | vsf_pwm_cfg_t |
| PWM configuration structure. Used to configure the PWM generator's frequency settings. | |
| typedef struct vsf_pwm_capability_t | vsf_pwm_capability_t |
| PWM capability structure. Describes the capabilities and limitations of the PWM hardware. | |
| typedef enum vsf_pwm_ctrl_t | vsf_pwm_ctrl_t |
| PWM control commands for hardware-specific operations. | |
| typedef struct vsf_pwm_t | vsf_pwm_t |
| typedef struct vsf_pwm_op_t | vsf_pwm_op_t |
Enumerations | |
| enum | vsf_pwm_ctrl_t { __VSF_PWM_CTRL_DUMMY = 0 } |
| PWM control commands for hardware-specific operations. More... | |
Functions | |
| vsf_err_t | vsf_pwm_init (vsf_pwm_t *pwm_ptr, vsf_pwm_cfg_t *cfg_ptr) |
| Initialize a PWM instance. | |
| void | vsf_pwm_fini (vsf_pwm_t *pwm_ptr) |
| Finalize a PWM instance. | |
| vsf_err_t | vsf_pwm_get_configuration (vsf_pwm_t *pwm_ptr, vsf_pwm_cfg_t *cfg_ptr) |
| Get the current configuration of a PWM instance. | |
| fsm_rt_t | vsf_pwm_enable (vsf_pwm_t *pwm_ptr) |
| Enable PWM instance. | |
| fsm_rt_t | vsf_pwm_disable (vsf_pwm_t *pwm_ptr) |
| Disable a PWM instance. | |
| vsf_pwm_capability_t | vsf_pwm_capability (vsf_pwm_t *pwm_ptr) |
| Get the capability of PWM instance. | |
| vsf_err_t | vsf_pwm_set (vsf_pwm_t *pwm_ptr, uint8_t channel, uint32_t period, uint32_t pulse) |
| PWM set the period width and pulse width for a channel. | |
| uint32_t | vsf_pwm_get_freq (vsf_pwm_t *pwm_ptr) |
| PWM get clock frequency. | |
| vsf_err_t | vsf_pwm_ctrl (vsf_pwm_t *pwm_ptr, vsf_pwm_ctrl_t ctrl, void *param) |
| Calls the specified PWM command. | |
| vsf_err_t | vsf_pwm_set_ms (vsf_pwm_t *pwm_ptr, uint8_t channel, uint32_t period, uint32_t pulse) |
| Set PWM period in milliseconds. | |
| vsf_err_t | vsf_pwm_set_us (vsf_pwm_t *pwm_ptr, uint8_t channel, uint32_t period, uint32_t pulse) |
| Set PWM period in microseconds. | |
| vsf_err_t | vsf_pwm_set_ns (vsf_pwm_t *pwm_ptr, uint8_t channel, uint32_t period, uint32_t pulse) |
| Set PWM period in nanoseconds. | |
| #define VSF_PWM_CFG_MULTI_CLASS ENABLED |
Enable multi-class support by default for maximum availability.
| #define VSF_PWM_CFG_PREFIX vsf |
Convert count to mask in specific hardware driver.
Convert mask to count in specific hardware driver.
We can redefine macro VSF_PWM_CFG_PREFIX to specify a prefix to call a specific driver directly in the application code.
| #define VSF_PWM_CFG_FUNCTION_RENAME ENABLED |
| #define VSF_PWM_CFG_REIMPLEMENT_TYPE_CFG DISABLED |
Enable macro VSF_PWM_CFG_REIMPLEMENT_TYPE_CFG in specific hardware drivers to redefine struct vsf_pwm_cfg_t. For compatibility, members should not be deleted when redefining. The vsf_pwm_isr_handler_t type also needs to be redefined.
| #define VSF_PWM_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED |
Redefine struct vsf_pwm_capability_t. For compatibility, members should not be deleted when redefining.
| #define VSF_PWM_CFG_INHERIT_HAL_CAPABILITY ENABLED |
In specific hardware driver, we can enable macro VSF_PWM_CFG_INHERIT_HAL_CAPABILITY to inherit the structure vsf_peripheral_capability_t.
| #define VSF_PWM_CFG_REIMPLEMENT_TYPE_CTRL DISABLED |
Enable macro VSF_PWM_CFG_REIMPLEMENT_TYPE_CTRL in specific hardware drivers to redefine enum vsf_pwm_ctrl_t. This allows hardware-specific control commands to be added to the control enumeration.
| #define VSF_PWM_APIS | ( | __prefix_name | ) |
PWM API template, used to generate PWM type, specific prefix function declarations, etc.
| [in] | __prefix_name | The prefix used for generating PWM functions. |
| typedef struct vsf_pwm_cfg_t vsf_pwm_cfg_t |
PWM configuration structure. Used to configure the PWM generator's frequency settings.
| typedef struct vsf_pwm_capability_t vsf_pwm_capability_t |
PWM capability structure. Describes the capabilities and limitations of the PWM hardware.
| typedef enum vsf_pwm_ctrl_t vsf_pwm_ctrl_t |
PWM control commands for hardware-specific operations.
| typedef struct vsf_pwm_op_t vsf_pwm_op_t |
| enum vsf_pwm_ctrl_t |
PWM control commands for hardware-specific operations.
|
extern |
Initialize a PWM instance.
| [in] | pwm_ptr | pointer to structure vsf_pwm_t |
| [in] | cfg_ptr | pointer to configuration structure vsf_pwm_cfg_t |
|
extern |
|
extern |
Get the current configuration of a PWM instance.
| [in] | pwm_ptr | pointer to structure vsf_pwm_t |
| [out] | cfg_ptr | pointer to configuration structure vsf_pwm_cfg_t to store the current configuration |
Enable PWM instance.
| [in] | pwm_ptr | pointer to structure vsf_pwm_t |
Disable a PWM instance.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
|
extern |
Get the capability of PWM instance.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
|
extern |
PWM set the period width and pulse width for a channel.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
| [in] | channel | PWM channel |
| [in] | period | PWM period width (in clock counter) |
| [in] | pulse | PWM pulse width (in clock counter) |
PWM get clock frequency.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
|
extern |
Calls the specified PWM command.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
| [in] | ctrl | PWM control command vsf_pwm_ctrl_t |
| [in,out] | param | the parameter of the command, its use is determined by the command |
|
extern |
Set PWM period in milliseconds.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
| [in] | channel | PWM channel |
| [in] | period | PWM period width (in milliseconds) |
| [in] | pulse | PWM pulse width (in milliseconds) |
|
extern |
Set PWM period in microseconds.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
| [in] | channel | PWM channel |
| [in] | period | PWM period width (in microseconds) |
| [in] | pulse | PWM pulse width (in microseconds) |
|
extern |
Set PWM period in nanoseconds.
| [in] | pwm_ptr | a pointer to structure vsf_pwm_t |
| [in] | channel | PWM channel |
| [in] | period | PWM period width (in nanoseconds) |
| [in] | pulse | PWM pulse width (in nanoseconds) |