This section describes the programming interface of the SLCD Peripheral driver. The SLCD driver configures SLCD.
Initialization
To initialize the SLCD module, call the SLCD_DRV_Init() function and provide the user configuration data structure. This function sets the configuration of the SLCD module automatically and enables the SLCD module.
Note that if the configuration does not enable the SLCD, the application enables it after the configurations are completed.
This is example code to configure the SLCD driver: slcd_work_mode_t lowPowerMode = { .kSLCDEnableInDozeMode = false, .kSLCDEnableInStopMode = false, }; slcd_user_config_t init = { .clkSrc = kSLCDDefaultClk, .alterClkDiv = kSLCDAltClkDivFactor1, .powerSupply = kSLCDPowerInternalVll3AndChargePump, .loadAdjust = kSLCDHighLoadOrSlowestClkSrc, .dutyCyc = kSLCD1Div8DutyCyc, .frameFreqDiv = kSLCDClkPrescaler02, .trim = kSLCDRegulatedVolatgeTrim08, .slcdIntEnabled = true, .workMode = lowPowerMode, }; slcd_pins_config_t pinsConfig = { .slcdLowPinsEnabled = 0x9FFFFE00, .slcdHighPinsEnabled = 0x0000083F, .slcdBackPlaneLowPinsEnabled = 0x0001FE00, .slcdBackPlaneHighPinsEnabled = 0x00000000, }; slcd_fault_detect_config_t faultDetectConfig = { .faultDetectCompleteIntEnabled = true, .faultDetectBackPlaneEnabled = true, .faultDetectPinIndex = 0, .prescaler = kSLCDFaultSampleFreq1BusClk, .winWidth = kSLCDFaultDetectWinWidth4SampleClk, }; slcd_blink_config_t blinkConfig = { .blinkRate = kSLCDBlinkRate01, .blinkMode = kSLCDAltDisplay, }; configure_lcd_pins(0);
SLCD_DRV_Init(0, &init);
SLCD_DRV_SetAllPinsConfig(0, &pinsConfig);
|
LCD_Type *const | g_slcdBase [LCD_INSTANCE_COUNT] |
| Table of base addresses for SLCD instances. More...
|
|
const IRQn_Type | g_slcdIrqId [LCD_INSTANCE_COUNT] |
| Table to save SLCD IRQ enumeration numbers defined in the CMSIS header file. More...
|
|
|
slcd_status_t | SLCD_DRV_Init (uint32_t instance, const slcd_user_config_t *userConfigPtr) |
| Initializes the SLCD driver. More...
|
|
void | SLCD_DRV_Deinit (uint32_t instance) |
| Deinitializes the SLCD driver. More...
|
|
void | SLCD_DRV_Start (uint32_t instance) |
| Starts the SLCD driver. More...
|
|
void | SLCD_DRV_Stop (uint32_t instance) |
| Stops the SLCD driver. More...
|
|
void | SLCD_DRV_SetIntCmd (uint32_t instance, slcd_int_type_t intType, bool enable) |
| Configures the SLCD interrupt. More...
|
|
slcd_status_t | SLCD_DRV_StartFaultDetection (uint32_t instance, const slcd_fault_detect_config_t *faultDetectConfigPtr) |
| Starts the SLCD fault detection. More...
|
|
bool | SLCD_DRV_CheckFaultDetectCompleteFlag (uint32_t instance) |
| Returns the fault detection configuration. More...
|
|
void | SLCD_DRV_ClearFaultDetectCompleteFlag (uint32_t instance) |
| Clears the fault detection complete flag. More...
|
|
uint8_t | SLCD_DRV_GetFaultDetectCounter (uint32_t instance) |
| Returns the fault detection counter. More...
|
|
bool | SLCD_DRV_CheckFrameFrequencyIntFlag (uint32_t instance) |
| Checks whether the SLCD frame frequency interrupt is enabled or disabled. More...
|
|
void | SLCD_DRV_ClearFrameFrequencyIntFlag (uint32_t instance) |
| Clears the SLCD frame frequency interrupt flag. More...
|
|
slcd_status_t | SLCD_DRV_StartBlinkingMode (uint32_t instance, const slcd_blink_config_t *blinkConfigPtr) |
| Starts the SLCD blinking mode. More...
|
|
void | SLCD_DRV_StopBlinkingMode (uint32_t instance) |
| Stops the SLCD blinking mode. More...
|
|
void | SLCD_DRV_SetAltDisplayModeCmd (uint32_t instance, bool enable) |
| Starts/stops the SLCD alternating display mode. More...
|
|
void | SLCD_DRV_SetBlankDisplayModeCmd (uint32_t instance, bool enable) |
| Starts/stops the SLCD blank display mode. More...
|
|
slcd_status_t | SLCD_DRV_SetAllPinsConfig (uint32_t instance, const slcd_pins_config_t *pinsConfigPtr) |
| Sets all SLCD pin configurations. More...
|
|
void | SLCD_DRV_SetPinWaveForm (uint32_t instance, uint8_t pinIndex, uint8_t waveForm) |
| Sets all SLCD pin waveforms. More...
|
|
void | SLCD_DRV_SetBackPlanePhase (uint32_t instance, uint8_t pinIndex, slcd_phase_index_t phase) |
| Sets the SLCD back plane phase. More...
|
|
void | SLCD_DRV_SetSegmentEnableCmd (uint32_t instance, uint8_t pinIndex, slcd_phase_index_t phaseIndex, bool enable) |
| Configures an SLCD pin segment. More...
|
|
struct slcd_pins_config_t |
This structure is used when calling the SLCD_DRV_Init function.
Data Fields |
uint32_t | slcdLowPinsEnabled |
| low pins from 0 to 31 and if one bit is set means the corresponding pin is enabled
|
|
uint32_t | slcdHighPinsEnabled |
| high pins from 32 to 63 and if one bit is set means the corresponding pin is enabled
|
|
uint32_t | slcdBackPlaneLowPinsEnabled |
| low pins from 0 to 31 and if one bit is set means the corresponding pin is configured as back plane
|
|
uint32_t | slcdBackPlaneHighPinsEnabled |
| high pins from 32 to 63 and if the bit is set means the corresponding pin is configured as back plane
|
|
struct slcd_user_config_t |
This structure is used when calling the SLCD_DRV_Init function.
- Parameters
-
instance | The SLCD peripheral instance number. |
userConfigPtr | The pointer to the SLCD user configure structure, see slcd_user_config_t. |
- Returns
- kStatus_SLCD_Success means success. Otherwise, means failure.
void SLCD_DRV_Deinit |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
- Returns
- kStatus_SLCD_Success means success. Otherwise, means failure.
void SLCD_DRV_Start |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
void SLCD_DRV_Stop |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
void SLCD_DRV_SetIntCmd |
( |
uint32_t |
instance, |
|
|
slcd_int_type_t |
intType, |
|
|
bool |
enable |
|
) |
| |
- Parameters
-
instance | The SLCD peripheral instance number. |
intType | interrupt type. |
enable | Enables or Disables interrupt. |
- Parameters
-
instance | The SLCD peripheral instance number. |
faultDetectConfigPtr | The pointer to SLCD configure fault detection. |
- Returns
- kStatus_SLCD_Success means success. Otherwise, means failure.
bool SLCD_DRV_CheckFaultDetectCompleteFlag |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
- Returns
- true Fault detection is complete.
-
false Fault detection is not complete.
void SLCD_DRV_ClearFaultDetectCompleteFlag |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
uint8_t SLCD_DRV_GetFaultDetectCounter |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
- Returns
- The fault detection counter value.
bool SLCD_DRV_CheckFrameFrequencyIntFlag |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
- Returns
- True This event causes an interrupt request.
-
False No interrupt request is generated by this event.
void SLCD_DRV_ClearFrameFrequencyIntFlag |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
- Parameters
-
instance | The SLCD peripheral instance number. |
blinkConfigPtr | The pointer used to configure SLCD blink configuration. |
- Returns
- kStatus_SLCD_Success means success. Otherwise, means failure.
void SLCD_DRV_StopBlinkingMode |
( |
uint32_t |
instance | ) |
|
- Parameters
-
instance | The SLCD peripheral instance number. |
void SLCD_DRV_SetAltDisplayModeCmd |
( |
uint32_t |
instance, |
|
|
bool |
enable |
|
) |
| |
- Parameters
-
instance | The SLCD peripheral instance number. |
enable | Disable/Enable SLCD alternating display mode. |
void SLCD_DRV_SetBlankDisplayModeCmd |
( |
uint32_t |
instance, |
|
|
bool |
enable |
|
) |
| |
- Parameters
-
instance | The SLCD peripheral instance number. |
enable | Disable/Enable SLCD blank display mode. |
- Parameters
-
instance | The SLCD peripheral instance number. |
pinsConfigPtr | The pointer used to configure SLCD pins. |
- Returns
- kStatus_SLCD_Success means success. Otherwise, means failure.
void SLCD_DRV_SetPinWaveForm |
( |
uint32_t |
instance, |
|
|
uint8_t |
pinIndex, |
|
|
uint8_t |
waveForm |
|
) |
| |
- Parameters
-
instance | The SLCD peripheral instance number. |
pinIndex | The configured SLCD pin index form 0 to 63. |
waveForm | The waveForm used to configure the pin wave form. |
void SLCD_DRV_SetBackPlanePhase |
( |
uint32_t |
instance, |
|
|
uint8_t |
pinIndex, |
|
|
slcd_phase_index_t |
phase |
|
) |
| |
- Parameters
-
instance | The SLCD peripheral instance number. |
pinIndex | The configured SLCD pin index form 0 to 63. |
phase | The configured segment from 0 to 7. |
void SLCD_DRV_SetSegmentEnableCmd |
( |
uint32_t |
instance, |
|
|
uint8_t |
pinIndex, |
|
|
slcd_phase_index_t |
phaseIndex, |
|
|
bool |
enable |
|
) |
| |
- Parameters
-
instance | The SLCD peripheral instance number. |
pinIndex | The specific pin index from 0 to 63. |
phaseIndex | The configured segment from 0 to 7. |
enable | Enable/Disable the segment. |
LCD_Type* const g_slcdBase[LCD_INSTANCE_COUNT] |
const IRQn_Type g_slcdIrqId[LCD_INSTANCE_COUNT] |