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_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 struct vsf_pwm_t | vsf_pwm_t |
typedef struct vsf_pwm_op_t | vsf_pwm_op_t |
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. | |
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_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_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 struct vsf_pwm_op_t vsf_pwm_op_t |
|
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 |
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 |
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) |