This section introduces the display PWM APIs including terms and acronyms, supported features, software architecture, details on how to use this API, PWM function groups, all enumerations, structures and functions.
More...
This section introduces the display PWM APIs including terms and acronyms, supported features, software architecture, details on how to use this API, PWM function groups, all enumerations, structures and functions.
Terms and acronyms
Terms | Details |
PWM | Pulse-width modulation is a modulation technique to encode a message into a pulsing signal. The duty cycle percentage for backlight brightness is used. For more information, please refer to Pulse-width modulation and Duty cycle in Wikipedia. |
Supported features
- Support 26MHz and 104MHz input clock.
The input clock can be set to 26MHz or 104MHz
- 26MHz : If the input clock is set to 26MHz, the PWM output clock will be 25.39KHz (26MHz/1024).
- 104MHz : If the input clock is set to 104MHz, the PWM output clock will be 101.5KHz (104MHz/1024).
- Support 10bits resolution.
The resolution of display PWM is 10 bits which means the backlight has 1024 levels.
How to use this driver
- Use the PWM with 26MHz input clock and generate a 80% duty cycle PWM signal.
This function sets the PWM duty cycle in percentage.
- Parameters
-
[in] | percentage | represents the percentage of high width of output PWM signal. If it is 0, the output PWM signal will always stay on low. If it is 100, the output PWM signal will always stay on high and the backlight will be the brightest. |
- Returns
- To indicate whether this function call is successful or not. HAL_DISPLAY_PWM_STATUS_OK, the operation completed successfully. HAL_DISPLAY_PWM_STATUS_INVALID_PARAMETER, the parameter needs to be verified. The parameter is out of bound. HAL_DISPLAY_PWM_STATUS_ERROR, an error occurred.
This function sets the PWM duty cycle in integer format.
- Parameters
-
[in] | width | represents the actual width of high width of output PWM signal. The range of the width is between 0 and 1024. |
- Returns
- To indicate whether this function call is successful or not. HAL_DISPLAY_PWM_STATUS_OK, the operation completed successfully. HAL_DISPLAY_PWM_STATUS_INVALID_PARAMETER, the parameter needs to be verified. The parameter is out of bound. HAL_DISPLAY_PWM_STATUS_ERROR, an error occurred.