MT2523 API Reference  LinkIt SDK v4
DISPLAY_PWM

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...

Overview

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

How to use this driver

Functions

hal_display_pwm_status_t hal_display_pwm_init (hal_display_pwm_clock_t clock)
 This function initializes the display PWM hardware. More...
 
hal_display_pwm_status_t hal_display_pwm_deinit (void)
 This function de-initializes the display PWM hardware. More...
 
hal_display_pwm_status_t hal_display_pwm_set_clock (hal_display_pwm_clock_t clock)
 This function sets the input clock of the PWM hardware. More...
 
hal_display_pwm_status_t hal_display_pwm_set_duty (uint8_t percentage)
 This function sets the PWM duty cycle in percentage. More...
 
hal_display_pwm_status_t hal_display_pwm_set_width (uint32_t width)
 This function sets the PWM duty cycle in integer format. More...
 

Modules

 Enum
 

Function Documentation

hal_display_pwm_status_t hal_display_pwm_deinit ( void  )

This function de-initializes the display PWM hardware.

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.
hal_display_pwm_status_t hal_display_pwm_init ( hal_display_pwm_clock_t  clock)

This function initializes the display PWM hardware.

Parameters
[in]clockspecifies the input clock source, please refer to hal_display_pwm_clock_t.
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.
hal_display_pwm_status_t hal_display_pwm_set_clock ( hal_display_pwm_clock_t  clock)

This function sets the input clock of the PWM hardware.

Parameters
[in]clockspecifies the input clock source, please refer to hal_display_pwm_clock_t
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.
hal_display_pwm_status_t hal_display_pwm_set_duty ( uint8_t  percentage)

This function sets the PWM duty cycle in percentage.

Parameters
[in]percentagerepresents 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.
hal_display_pwm_status_t hal_display_pwm_set_width ( uint32_t  width)

This function sets the PWM duty cycle in integer format.

Parameters
[in]widthrepresents 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.