IO operation functions. More...
Functions | |
hal_status_t | hal_pwm_start (pwm_handle_t *p_pwm) |
Starts the PWM signal generation on the output. More... | |
hal_status_t | hal_pwm_stop (pwm_handle_t *p_pwm) |
Stops the PWM signal generation on the output. More... | |
hal_status_t | hal_pwm_resume (pwm_handle_t *p_pwm) |
Resume the PWM signal generation on the output. More... | |
hal_status_t | hal_pwm_pause (pwm_handle_t *p_pwm) |
Pause the PWM signal generation on the output. More... | |
hal_status_t | hal_pwm_update_freq (pwm_handle_t *p_pwm, uint32_t freq) |
Update the PWM frequency on the output. More... | |
void | hal_pwm_suspend_reg (pwm_handle_t *p_pwm) |
Suspend some registers related to PWM configuration before sleep. More... | |
void | hal_pwm_resume_reg (const pwm_handle_t *p_pwm) |
Restore some registers related to PWM configuration after sleep. This function must be used in conjunction with the hal_pwm_suspend_reg(). More... | |
hal_pm_status_t | hal_pm_pwm_suspend (pwm_handle_t *p_pwm) |
Suspend the specified PWM. More... | |
void | hal_pm_pwm_resume (const pwm_handle_t *p_pwm) |
Resume the specified PWM. More... | |
hal_status_t | hal_pwm_config_channel (pwm_handle_t *p_pwm, const pwm_none_coding_channel_init_t *p_config, hal_pwm_active_channel_t channel) |
Initialize the PWM channels according to the specified parameters in the pwm_init_t. More... | |
hal_status_t | hal_pwm_inactive_channel (const pwm_handle_t *p_pwm, hal_pwm_active_channel_t channel) |
Set the specified PWM channel inactive. More... | |
hal_status_t | hal_pwm_set_coding_data_in_one_channel (const pwm_handle_t *p_pwm, uint32_t coding_data) |
Set pwm coding data. More... | |
hal_status_t | hal_pwm_set_coding_data_in_three_channels (const pwm_handle_t *p_pwm, uint32_t coding_data0, uint32_t coding_data1, uint32_t coding_data2) |
Set pwm coding data. More... | |
hal_status_t | hal_pwm_start_coding_with_dma (pwm_handle_t *p_pwm, uint32_t *p_data, uint16_t size) |
Start generate wave form in DMA mode. More... | |
hal_status_t | hal_pwm_start_coding_in_one_channel (pwm_handle_t *p_pwm, uint32_t coding_data) |
Start generate one channel wave form in Interrupt mode. More... | |
hal_status_t | hal_pwm_start_coding_in_three_channels (pwm_handle_t *p_pwm, uint32_t coding_data0, uint32_t coding_data1, uint32_t coding_data2) |
Start generate three channels wave form in Interrupt mode. More... | |
void | hal_pwm_irq_handler (pwm_handle_t *p_pwm) |
PWM irq handler. More... | |
hal_pwm_state_t | hal_pwm_get_state (const pwm_handle_t *p_pwm) |
Return the PWM handle state. More... | |
IO operation functions.
============================================================================== ##### IO operation functions ##### ============================================================================== [..] This section provides functions allowing to: (+) Start the PWM. (+) Stop the PWM. (+) Configure the specified PWM channel.
void hal_pm_pwm_resume | ( | const pwm_handle_t * | p_pwm | ) |
Resume the specified PWM.
[in] | p_pwm | Pointer to a PWM handle |
::None |
hal_pm_status_t hal_pm_pwm_suspend | ( | pwm_handle_t * | p_pwm | ) |
Suspend the specified PWM.
[in] | p_pwm | Pointer to a PWM handle |
HAL_PM_ACTIVE | Device is active, not allow sleep. |
HAL_PM_SLEEP | Allow sleep. |
hal_status_t hal_pwm_config_channel | ( | pwm_handle_t * | p_pwm, |
const pwm_none_coding_channel_init_t * | p_config, | ||
hal_pwm_active_channel_t | channel | ||
) |
Initialize the PWM channels according to the specified parameters in the pwm_init_t.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | p_config | PWM Channels configuration structure. |
[in] | channel | PWM Channels to be configured. This parameter can be one of the following values:
|
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_pwm_state_t hal_pwm_get_state | ( | const pwm_handle_t * | p_pwm | ) |
Return the PWM handle state.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
HAL_PWM_STATE_RESET | Peripheral is not initialized or disabled. |
HAL_PWM_STATE_READY | Peripheral is initialized and ready for use. |
HAL_PWM_STATE_BUSY | An internal process is ongoing. |
HAL_PWM_STATE_ERROR | Reception process is ongoing. |
hal_status_t hal_pwm_inactive_channel | ( | const pwm_handle_t * | p_pwm, |
hal_pwm_active_channel_t | channel | ||
) |
Set the specified PWM channel inactive.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | channel | PWM Channels to be configured. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
void hal_pwm_irq_handler | ( | pwm_handle_t * | p_pwm | ) |
PWM irq handler.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
::None |
hal_status_t hal_pwm_pause | ( | pwm_handle_t * | p_pwm | ) |
Pause the PWM signal generation on the output.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_pwm_resume | ( | pwm_handle_t * | p_pwm | ) |
Resume the PWM signal generation on the output.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
void hal_pwm_resume_reg | ( | const pwm_handle_t * | p_pwm | ) |
Restore some registers related to PWM configuration after sleep. This function must be used in conjunction with the hal_pwm_suspend_reg().
[in] | p_pwm | Pointer to a PWM handle which contains the configuration information for the specified PWM module. |
None |
hal_status_t hal_pwm_set_coding_data_in_one_channel | ( | const pwm_handle_t * | p_pwm, |
uint32_t | coding_data | ||
) |
Set pwm coding data.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | coding_data | every bit represent compa0 or compa1 in coding data. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_pwm_set_coding_data_in_three_channels | ( | const pwm_handle_t * | p_pwm, |
uint32_t | coding_data0, | ||
uint32_t | coding_data1, | ||
uint32_t | coding_data2 | ||
) |
Set pwm coding data.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | coding_data0 | every bit represent compa0 or compa1 in coding data0. |
[in] | coding_data1 | every bit represent compb0 or compb1 in coding data1. |
[in] | coding_data2 | every bit represent compc0 or compc1 in coding data2. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_pwm_start | ( | pwm_handle_t * | p_pwm | ) |
Starts the PWM signal generation on the output.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_pwm_start_coding_in_one_channel | ( | pwm_handle_t * | p_pwm, |
uint32_t | coding_data | ||
) |
Start generate one channel wave form in Interrupt mode.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | coding_data | every bit represent compa0 or compa1 in coding data0. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_pwm_start_coding_in_three_channels | ( | pwm_handle_t * | p_pwm, |
uint32_t | coding_data0, | ||
uint32_t | coding_data1, | ||
uint32_t | coding_data2 | ||
) |
Start generate three channels wave form in Interrupt mode.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | coding_data0 | every bit represent compa0 or compa1 in coding data0. |
[in] | coding_data1 | every bit represent compb0 or compb1 in coding data1. |
[in] | coding_data2 | every bit represent compc0 or compc1 in coding data2. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_pwm_start_coding_with_dma | ( | pwm_handle_t * | p_pwm, |
uint32_t * | p_data, | ||
uint16_t | size | ||
) |
Start generate wave form in DMA mode.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | p_data | the coding data address. |
[in] | size | coding data size. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
hal_status_t hal_pwm_stop | ( | pwm_handle_t * | p_pwm | ) |
Stops the PWM signal generation on the output.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |
void hal_pwm_suspend_reg | ( | pwm_handle_t * | p_pwm | ) |
Suspend some registers related to PWM configuration before sleep.
[in] | p_pwm | Pointer to a PWM handle which contains the configuration information for the specified PWM module. |
None |
hal_status_t hal_pwm_update_freq | ( | pwm_handle_t * | p_pwm, |
uint32_t | freq | ||
) |
Update the PWM frequency on the output.
[in] | p_pwm | Pointer to a PWM handle that contains the configuration information for the specified PWM module. |
[in] | freq | This parameter ranges between min = 0 and max = SystemFreq / 2. |
HAL_OK | Operation is OK. |
HAL_ERROR | Parameter error or operation not supported. |
HAL_BUSY | Driver is busy. |
HAL_TIMEOUT | Timeout occurred. |