IO operation functions

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_update_freq (pwm_handle_t *p_pwm, uint32_t freq)
 Update the PWM frequency on the output. More...
 
hal_status_t hal_pwm_suspend_reg (pwm_handle_t *p_pwm)
 Suspend some registers related to PWM configuration before sleep. More...
 
hal_status_t hal_pwm_resume_reg (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_status_t hal_pwm_config_channel (pwm_handle_t *p_pwm, pwm_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...
 

Detailed Description

IO operation functions.

  ==============================================================================
                      ##### IO operation functions #####
  ==============================================================================
  [..]
    This section provides functions allowing to:
    (+) Start the PWM.
    (+) Stop the PWM.
    (+) Configure the specified PWM channel.

Function Documentation

◆ hal_pwm_config_channel()

hal_status_t hal_pwm_config_channel ( pwm_handle_t p_pwm,
pwm_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.

Parameters
[in]p_pwmPointer to a PWM handle that contains the configuration information for the specified PWM module.
[in]p_configPWM Channels configuration structure.
[in]channelPWM Channels to be configured. This parameter can be one of the following values:
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_pwm_resume_reg()

hal_status_t hal_pwm_resume_reg ( 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().

Parameters
[in]p_pwmPointer to a PWM handle which contains the configuration information for the specified PWM module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_pwm_start()

hal_status_t hal_pwm_start ( pwm_handle_t p_pwm)

Starts the PWM signal generation on the output.

Parameters
[in]p_pwmPointer to a PWM handle that contains the configuration information for the specified PWM module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_pwm_stop()

hal_status_t hal_pwm_stop ( pwm_handle_t p_pwm)

Stops the PWM signal generation on the output.

Parameters
[in]p_pwmPointer to a PWM handle that contains the configuration information for the specified PWM module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_pwm_suspend_reg()

hal_status_t hal_pwm_suspend_reg ( pwm_handle_t p_pwm)

Suspend some registers related to PWM configuration before sleep.

Parameters
[in]p_pwmPointer to a PWM handle which contains the configuration information for the specified PWM module.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_pwm_update_freq()

hal_status_t hal_pwm_update_freq ( pwm_handle_t p_pwm,
uint32_t  freq 
)

Update the PWM frequency on the output.

Parameters
[in]p_pwmPointer to a PWM handle that contains the configuration information for the specified PWM module.
[in]freqThis parameter ranges between min = 0 and max = SystemFreq / 2.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.