Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SLCD Peripheral driver

Overview

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);

Data Structures

struct  slcd_pins_config_t
 This structure describes SLCD pin configuration. More...
 
struct  slcd_user_config_t
 This structure describes the programming interface of the for SLCD initialization. More...
 

Variables

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 Driver

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

Data Structure Documentation

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.

Data Fields

slcd_clk_config_t clkConfig
 Configures SLCD clock and frame frequency.
 
slcd_power_supply_option_t powerSupply
 Configures SLCD power supply.
 
slcd_load_adjust_t loadAdjust
 Configures charge pump or resistor bias to handle different LCD glass capacitance.
 
slcd_duty_cyc_t dutyCyc
 Selects the duty cycle of the LCD controller driver.
 
slcd_regulated_voltage_trim_t trim
 Adjusts SLCD contrast.
 
bool slcdIntEnable
 SLCD interrupt enable or disable.
 
slcd_work_mode_t workMode
 Configures SLCD low power work mode.
 

Function Documentation

slcd_status_t SLCD_DRV_Init ( uint32_t  instance,
const slcd_user_config_t userConfigPtr 
)
Parameters
instanceThe SLCD peripheral instance number.
userConfigPtrThe 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
instanceThe SLCD peripheral instance number.
Returns
kStatus_SLCD_Success means success. Otherwise, means failure.
void SLCD_DRV_Start ( uint32_t  instance)
Parameters
instanceThe SLCD peripheral instance number.
void SLCD_DRV_Stop ( uint32_t  instance)
Parameters
instanceThe SLCD peripheral instance number.
void SLCD_DRV_SetIntCmd ( uint32_t  instance,
slcd_int_type_t  intType,
bool  enable 
)
Parameters
instanceThe SLCD peripheral instance number.
intTypeinterrupt type.
enableEnables or Disables interrupt.
slcd_status_t SLCD_DRV_StartFaultDetection ( uint32_t  instance,
const slcd_fault_detect_config_t faultDetectConfigPtr 
)
Parameters
instanceThe SLCD peripheral instance number.
faultDetectConfigPtrThe pointer to SLCD configure fault detection.
Returns
kStatus_SLCD_Success means success. Otherwise, means failure.
bool SLCD_DRV_CheckFaultDetectCompleteFlag ( uint32_t  instance)
Parameters
instanceThe SLCD peripheral instance number.
Returns
true Fault detection is complete.
false Fault detection is not complete.
void SLCD_DRV_ClearFaultDetectCompleteFlag ( uint32_t  instance)
Parameters
instanceThe SLCD peripheral instance number.
uint8_t SLCD_DRV_GetFaultDetectCounter ( uint32_t  instance)
Parameters
instanceThe SLCD peripheral instance number.
Returns
The fault detection counter value.
bool SLCD_DRV_CheckFrameFrequencyIntFlag ( uint32_t  instance)
Parameters
instanceThe 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
instanceThe SLCD peripheral instance number.
slcd_status_t SLCD_DRV_StartBlinkingMode ( uint32_t  instance,
const slcd_blink_config_t blinkConfigPtr 
)
Parameters
instanceThe SLCD peripheral instance number.
blinkConfigPtrThe pointer used to configure SLCD blink configuration.
Returns
kStatus_SLCD_Success means success. Otherwise, means failure.
void SLCD_DRV_StopBlinkingMode ( uint32_t  instance)
Parameters
instanceThe SLCD peripheral instance number.
void SLCD_DRV_SetAltDisplayModeCmd ( uint32_t  instance,
bool  enable 
)
Parameters
instanceThe SLCD peripheral instance number.
enableDisable/Enable SLCD alternating display mode.
void SLCD_DRV_SetBlankDisplayModeCmd ( uint32_t  instance,
bool  enable 
)
Parameters
instanceThe SLCD peripheral instance number.
enableDisable/Enable SLCD blank display mode.
slcd_status_t SLCD_DRV_SetAllPinsConfig ( uint32_t  instance,
const slcd_pins_config_t pinsConfigPtr 
)
Parameters
instanceThe SLCD peripheral instance number.
pinsConfigPtrThe 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
instanceThe SLCD peripheral instance number.
pinIndexThe configured SLCD pin index form 0 to 63.
waveFormThe waveForm used to configure the pin wave form.
void SLCD_DRV_SetBackPlanePhase ( uint32_t  instance,
uint8_t  pinIndex,
slcd_phase_index_t  phase 
)
Parameters
instanceThe SLCD peripheral instance number.
pinIndexThe configured SLCD pin index form 0 to 63.
phaseThe configured segment from 0 to 7.
void SLCD_DRV_SetSegmentEnableCmd ( uint32_t  instance,
uint8_t  pinIndex,
slcd_phase_index_t  phaseIndex,
bool  enable 
)
Parameters
instanceThe SLCD peripheral instance number.
pinIndexThe specific pin index from 0 to 63.
phaseIndexThe configured segment from 0 to 7.
enableEnable/Disable the segment.

Variable Documentation

LCD_Type* const g_slcdBase[LCD_INSTANCE_COUNT]
const IRQn_Type g_slcdIrqId[LCD_INSTANCE_COUNT]