All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SLCD: Segment LCD Driver

## Overview

The KSDK provides a peripheral driver for the Segment LCD (SLCD) module of Kinetis devices. The SLCD module is a CMOS charge pump voltage inverter that is designed for low voltage and low-power operation. SLCD is designed to generate the appropriate waveforms to drive multiplexed numeric, alphanumeric, or custom segment LCD panels. SLCD also has several timing and control settings that can be software-configured depending on the application's requirements. Timing and control consists of registers and control logic for the following:

1. LCD frame frequency
2. Duty cycle selection
3. Front plane/back plane selection and enabling
4. Blink modes and frequency
5. Operation in low-power modes

After the SLCD general initialization, the SLCD_SetBackPlanePhase(), SLCD_SetFrontPlaneSegments(), and SLCD_SetFrontPlaneOnePhase() are used to set the special back/front Plane to make SLCD display correctly. Then, the independent display control APIs, SLCD_StartDisplay() and SLCD_StopDisplay(), start and stop the SLCD display.

The SLCD_StartBlinkMode() and SLCD_StopBlinkMode() are provided for the runtime special blink mode control. To get the SLCD fault detection result, call the SLCD_GetFaultDetectCounter().

# Typical use case

## SLCD Initialization operation

slcd_config_t configure = 0;
slcd_clock_config_t clkConfig =
{
kSLCD_AlternateClk1,
kSLCD_AltClkDivFactor1,
kSLCD_ClkPrescaler00
#if FSL_FEATURE_SLCD_HAS_FAST_FRAME_RATE
,
false
#endif
};
SLCD_GetDefaultConfig(&configure);
configure.clkConfig. = &clkConfig;
configure.loadAdjust = kSLCD_LowLoadOrIntermediateClkSrc;
configure.dutyCycle = kSLCD_1Div4DutyCycle;
configure.slcdlowPinEnabled = 0x1a44;
configure.backPlanelowPin = 0x0822;
configure.faultConfig = NULL;
SLCD_Init(base, &configure);
SLCD_SetBackPlanePhase(base, 1, kSLCD_PhaseAActivate);
SLCD_SetBackPlanePhase(base, 5, kSLCD_PhaseBActivate);
SLCD_SetBackPlanePhase(base, 11, kSLCD_PhaseCActivate);
SLCD_SetFrontPlaneSegments(base, 0, (kSLCD_PhaseAActivate | kSLCD_PhaseBActivate));
SLCD_SetFrontPlaneSegments(base, 9, (kSLCD_PhaseBActivate | kSLCD_PhaseCActivate));
SLCD_StartDisplay(base);

## Data Structures

struct | slcd_fault_detect_config_t
| SLCD fault frame detection configure structure. More...
struct | slcd_clock_config_t
| SLCD clock configure structure. More...
struct | slcd_config_t
| SLCD configure structure. More...

## Enumerations

enum | slcd_power_supply_option_t { kSLCD_InternalVll3UseChargePump, kSLCD_ExternalVll3UseResistorBiasNetwork, kSLCD_ExteranlVll3UseChargePump, kSLCD_InternalVll1UseChargePump }
| SLCD power supply option. More...

enum

slcd_regulated_voltage_trim_t {
kSLCD_RegulatedVolatgeTrim00 = 0U,
kSLCD_RegulatedVolatgeTrim01,
kSLCD_RegulatedVolatgeTrim02,
kSLCD_RegulatedVolatgeTrim03,
kSLCD_RegulatedVolatgeTrim04,
kSLCD_RegulatedVolatgeTrim05,
kSLCD_RegulatedVolatgeTrim06,
kSLCD_RegulatedVolatgeTrim07,
kSLCD_RegulatedVolatgeTrim08,
kSLCD_RegulatedVolatgeTrim09,
kSLCD_RegulatedVolatgeTrim10,
kSLCD_RegulatedVolatgeTrim11,
kSLCD_RegulatedVolatgeTrim12,
kSLCD_RegulatedVolatgeTrim13,
kSLCD_RegulatedVolatgeTrim14,
kSLCD_RegulatedVolatgeTrim15
}

| SLCD regulated voltage trim parameter, be used to meet the desired contrast. More...
enum | slcd_load_adjust_t { kSLCD_LowLoadOrFastestClkSrc = 0U, kSLCD_LowLoadOrIntermediateClkSrc, kSLCD_HighLoadOrIntermediateClkSrc, kSLCD_HighLoadOrSlowestClkSrc }
| SLCD load adjust to handle different LCD glass capacitance or configure the LCD charge pump clock source. More...
enum | slcd_clock_src_t { kSLCD_DefaultClk = 0U, kSLCD_AlternateClk1 = 1U }
| SLCD clock source. More...
enum | slcd_alt_clock_div_t { kSLCD_AltClkDivFactor1 = 0U, kSLCD_AltClkDivFactor64, kSLCD_AltClkDivFactor256, kSLCD_AltClkDivFactor512 }
| SLCD alternate clock divider. More...
enum | slcd_clock_prescaler_t { kSLCD_ClkPrescaler00 = 0U, kSLCD_ClkPrescaler01, kSLCD_ClkPrescaler02, kSLCD_ClkPrescaler03, kSLCD_ClkPrescaler04, kSLCD_ClkPrescaler05, kSLCD_ClkPrescaler06, kSLCD_ClkPrescaler07 }
| SLCD clock prescaler to generate frame frequency. More...
enum | slcd_duty_cycle_t { kSLCD_1Div1DutyCycle = 0U, kSLCD_1Div2DutyCycle, kSLCD_1Div3DutyCycle, kSLCD_1Div4DutyCycle, kSLCD_1Div5DutyCycle, kSLCD_1Div6DutyCycle, kSLCD_1Div7DutyCycle, kSLCD_1Div8DutyCycle }
| SLCD duty cycle. More...
enum | slcd_phase_type_t { kSLCD_NoPhaseActivate = 0x00U, kSLCD_PhaseAActivate = 0x01U, kSLCD_PhaseBActivate = 0x02U, kSLCD_PhaseCActivate = 0x04U, kSLCD_PhaseDActivate = 0x08U, kSLCD_PhaseEActivate = 0x10U, kSLCD_PhaseFActivate = 0x20U, kSLCD_PhaseGActivate = 0x40U, kSLCD_PhaseHActivate = 0x80U }
| SLCD segment phase type. More...
enum | slcd_phase_index_t { kSLCD_PhaseAIndex = 0x0U, kSLCD_PhaseBIndex = 0x1U, kSLCD_PhaseCIndex = 0x2U, kSLCD_PhaseDIndex = 0x3U, kSLCD_PhaseEIndex = 0x4U, kSLCD_PhaseFIndex = 0x5U, kSLCD_PhaseGIndex = 0x6U, kSLCD_PhaseHIndex = 0x7U }
| SLCD segment phase bit index. More...
enum | slcd_display_mode_t { kSLCD_NormalMode = 0U, kSLCD_AlternateMode, kSLCD_BlankMode }
| SLCD display mode. More...
enum | slcd_blink_mode_t { kSLCD_BlankDisplayBlink = 0U, kSLCD_AltDisplayBlink }
| SLCD blink mode. More...
enum | slcd_blink_rate_t { kSLCD_BlinkRate00 = 0U, kSLCD_BlinkRate01, kSLCD_BlinkRate02, kSLCD_BlinkRate03, kSLCD_BlinkRate04, kSLCD_BlinkRate05, kSLCD_BlinkRate06, kSLCD_BlinkRate07 }
| SLCD blink rate. More...
enum | slcd_fault_detect_clock_prescaler_t { kSLCD_FaultSampleFreqDivider1 = 0U, kSLCD_FaultSampleFreqDivider2, kSLCD_FaultSampleFreqDivider4, kSLCD_FaultSampleFreqDivider8, kSLCD_FaultSampleFreqDivider16, kSLCD_FaultSampleFreqDivider32, kSLCD_FaultSampleFreqDivider64, kSLCD_FaultSampleFreqDivider128 }
| SLCD fault detect clock prescaler. More...
enum | slcd_fault_detect_sample_window_width_t { kSLCD_FaultDetectWindowWidth4SampleClk = 0U, kSLCD_FaultDetectWindowWidth8SampleClk, kSLCD_FaultDetectWindowWidth16SampleClk, kSLCD_FaultDetectWindowWidth32SampleClk, kSLCD_FaultDetectWindowWidth64SampleClk, kSLCD_FaultDetectWindowWidth128SampleClk, kSLCD_FaultDetectWindowWidth256SampleClk, kSLCD_FaultDetectWindowWidth512SampleClk }
| SLCD fault detect sample window width. More...
enum | slcd_interrupt_enable_t { kSLCD_FaultDetectCompleteInterrupt = 1U }
| SLCD interrupt source. More...
enum | slcd_lowpower_behavior { kSLCD_EnabledInWaitStop = 0, kSLCD_EnabledInWaitOnly, kSLCD_EnabledInStopOnly, kSLCD_DisabledInWaitStop }
| SLCD behavior in low power mode. More...

## Driver version

#define | FSL_SLCD_DRIVER_VERSION (MAKE_VERSION(2, 0, 1))
| SLCD driver version 2.0.1. More...

## Initialization and deinitialization

void | SLCD_Init (LCD_Type *base, slcd_config_t *configure)
| Initializes the SLCD, ungates the module clock, initializes the power setting, enables all used plane pins, and sets with interrupt and work mode with configuration. More...
void | SLCD_Deinit (LCD_Type *base)
| Deinitializes the SLCD module, gates the module clock, disables an interrupt, and displays the SLCD. More...
void | SLCD_GetDefaultConfig (slcd_config_t *configure)
| Gets the SLCD default configuration structure. More...

## Plane Setting and Display Control

static void | SLCD_StartDisplay (LCD_Type *base)
| Enables the SLCD controller, starts generate, and displays the front plane and back plane waveform. More...
static void | SLCD_StopDisplay (LCD_Type *base)
| Stops the SLCD controller. More...
void | SLCD_StartBlinkMode (LCD_Type *base, slcd_blink_mode_t mode, slcd_blink_rate_t rate)
| Starts the SLCD blink mode. More...
static void | SLCD_StopBlinkMode (LCD_Type *base)
| Stops the SLCD blink mode. More...
static void | SLCD_SetBackPlanePhase (LCD_Type *base, uint32_t pinIndx, slcd_phase_type_t phase)
| Sets the SLCD back plane pin phase. More...
static void | SLCD_SetFrontPlaneSegments (LCD_Type *base, uint32_t pinIndx, uint8_t operation)
| Sets the SLCD front plane segment operation for a front plane pin. More...
static void | SLCD_SetFrontPlaneOnePhase (LCD_Type *base, uint32_t pinIndx, slcd_phase_index_t phaseIndx, bool enable)
| Sets one SLCD front plane pin for one phase. More...
static uint32_t | SLCD_GetFaultDetectCounter (LCD_Type *base)
| Gets the SLCD fault detect counter. More...

## Interrupts.

void | SLCD_EnableInterrupts (LCD_Type *base, uint32_t mask)
| Enables the SLCD interrupt. More...
void | SLCD_DisableInterrupts (LCD_Type *base, uint32_t mask)
| Disables the SLCD interrupt. More...
uint32_t | SLCD_GetInterruptStatus (LCD_Type *base)
| Gets the SLCD interrupt status flag. More...
void | SLCD_ClearInterruptStatus (LCD_Type *base, uint32_t mask)
| Clears the SLCD interrupt events status flag. More...

## Data Structure Documentation

struct slcd_fault_detect_config_t

### Data Fields

bool | faultDetectIntEnable
| Fault frame detection interrupt enable flag. More...
bool | faultDetectBackPlaneEnable
| True means the pin id fault detected is back plane otherwise front plane. More...
uint8_t | faultDetectPinIndex
| Fault detected pin id from 0 to 63. More...
slcd_fault_detect_clock_prescaler_t | faultPrescaler
| Fault detect clock prescaler. More...
slcd_fault_detect_sample_window_width_t | width
| Fault detect sample window width. More...

#### Field Documentation

bool slcd_fault_detect_config_t::faultDetectIntEnable

bool slcd_fault_detect_config_t::faultDetectBackPlaneEnable

uint8_t slcd_fault_detect_config_t::faultDetectPinIndex

slcd_fault_detect_clock_prescaler_t slcd_fault_detect_config_t::faultPrescaler

slcd_fault_detect_sample_window_width_t slcd_fault_detect_config_t::width

struct slcd_clock_config_t

### Data Fields

slcd_clock_src_t | clkSource
| Clock source. More...
slcd_alt_clock_div_t | altClkDivider
| The divider to divide the alternate clock used for alternate clock source. More...
slcd_clock_prescaler_t | clkPrescaler
| Clock prescaler. More...

#### Field Documentation

slcd_clock_src_t slcd_clock_config_t::clkSource

"slcd_clock_src_t" is recommended to be used. The SLCD is optimized to operate using a 32.768kHz clock input.

slcd_alt_clock_div_t slcd_clock_config_t::altClkDivider

slcd_clock_prescaler_t slcd_clock_config_t::clkPrescaler

struct slcd_config_t

### Data Fields

slcd_power_supply_option_t | powerSupply
| Power supply option. More...
slcd_regulated_voltage_trim_t | voltageTrim
| Regulated voltage trim used for the internal regulator VIREG to adjust to facilitate contrast control. More...
slcd_clock_config_t * | clkConfig
| Clock configure. More...
slcd_display_mode_t | displayMode
| SLCD display mode. More...
slcd_load_adjust_t | loadAdjust
| Load adjust to handle glass capacitance. More...
slcd_duty_cycle_t | dutyCycle
| Duty cycle. More...
slcd_lowpower_behavior | lowPowerBehavior
| SLCD behavior in low power mode. More...
uint32_t | slcdLowPinEnabled
| Setting enabled SLCD pin 0 ~ pin 31. More...
uint32_t | slcdHighPinEnabled
| Setting enabled SLCD pin 32 ~ pin 63. More...
uint32_t | backPlaneLowPin
| Setting back plane pin 0 ~ pin 31. More...
uint32_t | backPlaneHighPin
| Setting back plane pin 32 ~ pin 63. More...
slcd_fault_detect_config_t * | faultConfig
| Fault frame detection configure. More...

#### Field Documentation

slcd_power_supply_option_t slcd_config_t::powerSupply

slcd_regulated_voltage_trim_t slcd_config_t::voltageTrim

slcd_clock_config_t* slcd_config_t::clkConfig

slcd_display_mode_t slcd_config_t::displayMode

slcd_load_adjust_t slcd_config_t::loadAdjust

slcd_duty_cycle_t slcd_config_t::dutyCycle

slcd_lowpower_behavior slcd_config_t::lowPowerBehavior

uint32_t slcd_config_t::slcdLowPinEnabled

Setting bit n to 1 means enable pin n.

uint32_t slcd_config_t::slcdHighPinEnabled

Setting bit n to 1 means enable pin (n + 32).

uint32_t slcd_config_t::backPlaneLowPin

Setting bit n to 1 means setting pin n as back plane. It should never have the same bit setting as the frontPlane Pin.

uint32_t slcd_config_t::backPlaneHighPin

Setting bit n to 1 means setting pin (n + 32) as back plane. It should never have the same bit setting as the frontPlane Pin.

slcd_fault_detect_config_t* slcd_config_t::faultConfig

If not requirement, set to NULL.

## Macro Definition Documentation

#define FSL_SLCD_DRIVER_VERSION (MAKE_VERSION(2, 0, 1))

## Enumeration Type Documentation

enum slcd_power_supply_option_t

Enumerator
kSLCD_InternalVll3UseChargePump | VLL3 connected to VDD internally, charge pump is used to generate VLL1 and VLL2.
kSLCD_ExternalVll3UseResistorBiasNetwork | VLL3 is driven externally and resistor bias network is used to generate VLL1 and VLL2.
kSLCD_ExteranlVll3UseChargePump | VLL3 is driven externally and charge pump is used to generate VLL1 and VLL2.
kSLCD_InternalVll1UseChargePump | VIREG is connected to VLL1 internally and charge pump is used to generate VLL2 and VLL3.

enum slcd_regulated_voltage_trim_t

Enumerator
kSLCD_RegulatedVolatgeTrim00 | Increase the voltage to 0.91 V.
kSLCD_RegulatedVolatgeTrim01 | Increase the voltage to 1.01 V.
kSLCD_RegulatedVolatgeTrim02 | Increase the voltage to 0.96 V.
kSLCD_RegulatedVolatgeTrim03 | Increase the voltage to 1.06 V.
kSLCD_RegulatedVolatgeTrim04 | Increase the voltage to 0.93 V.
kSLCD_RegulatedVolatgeTrim05 | Increase the voltage to 1.02 V.
kSLCD_RegulatedVolatgeTrim06 | Increase the voltage to 0.98 V.
kSLCD_RegulatedVolatgeTrim07 | Increase the voltage to 1.08 V.
kSLCD_RegulatedVolatgeTrim08 | Increase the voltage to 0.92 V.
kSLCD_RegulatedVolatgeTrim09 | Increase the voltage to 1.02 V.
kSLCD_RegulatedVolatgeTrim10 | Increase the voltage to 0.97 V.
kSLCD_RegulatedVolatgeTrim11 | Increase the voltage to 1.07 V.
kSLCD_RegulatedVolatgeTrim12 | Increase the voltage to 0.94 V.
kSLCD_RegulatedVolatgeTrim13 | Increase the voltage to 1.05 V.
kSLCD_RegulatedVolatgeTrim14 | Increase the voltage to 0.99 V.
kSLCD_RegulatedVolatgeTrim15 | Increase the voltage to 1.09 V.

enum slcd_load_adjust_t

Adjust the LCD glass capacitance if resistor bias network is enabled: kSLCD_LowLoadOrFastestClkSrc - Low load (LCD glass capacitance 2000pF or lower. LCD or GPIO function can be used on VLL1,VLL2,Vcap1 and Vcap2 pins) kSLCD_LowLoadOrIntermediateClkSrc - low load (LCD glass capacitance 2000pF or lower. LCD or GPIO function can be used on VLL1,VLL2,Vcap1 and Vcap2 pins) kSLCD_HighLoadOrIntermediateClkSrc - high load (LCD glass capacitance 8000pF or lower. LCD or GPIO function can be used on Vcap1 and Vcap2 pins) kSLCD_HighLoadOrSlowestClkSrc - high load (LCD glass capacitance 8000pF or lower LCD or GPIO function can be used on Vcap1 and Vcap2 pins) Adjust clock for charge pump if charge pump is enabled: kSLCD_LowLoadOrFastestClkSrc - Fasten clock source (LCD glass capacitance 8000pF or 4000pF or lower if Fast Frame Rate is set) kSLCD_LowLoadOrIntermediateClkSrc - Intermediate clock source (LCD glass capacitance 4000pF or 2000pF or lower if Fast Frame Rate is set) kSLCD_HighLoadOrIntermediateClkSrc - Intermediate clock source (LCD glass capacitance 2000pF or 1000pF or lower if Fast Frame Rate is set) kSLCD_HighLoadOrSlowestClkSrc - slowest clock source (LCD glass capacitance 1000pF or 500pF or lower if Fast Frame Rate is set)

Enumerator
kSLCD_LowLoadOrFastestClkSrc | Adjust in low load or selects fastest clock.
kSLCD_LowLoadOrIntermediateClkSrc | Adjust in low load or selects intermediate clock.
kSLCD_HighLoadOrIntermediateClkSrc | Adjust in high load or selects intermediate clock.
kSLCD_HighLoadOrSlowestClkSrc | Adjust in high load or selects slowest clock.

enum slcd_clock_src_t

Enumerator
kSLCD_DefaultClk | Select default clock ERCLK32K.
kSLCD_AlternateClk1 | Select alternate clock source 1 : MCGIRCLK.

enum slcd_alt_clock_div_t

Enumerator
kSLCD_AltClkDivFactor1 | No divide for alternate clock.
kSLCD_AltClkDivFactor64 | Divide alternate clock with factor 64.
kSLCD_AltClkDivFactor256 | Divide alternate clock with factor 256.
kSLCD_AltClkDivFactor512 | Divide alternate clock with factor 512.

enum slcd_clock_prescaler_t

Enumerator
kSLCD_ClkPrescaler00 | Prescaler 0.
kSLCD_ClkPrescaler01 | Prescaler 1.
kSLCD_ClkPrescaler02 | Prescaler 2.
kSLCD_ClkPrescaler03 | Prescaler 3.
kSLCD_ClkPrescaler04 | Prescaler 4.
kSLCD_ClkPrescaler05 | Prescaler 5.
kSLCD_ClkPrescaler06 | Prescaler 6.
kSLCD_ClkPrescaler07 | Prescaler 7.

enum slcd_duty_cycle_t

Enumerator
kSLCD_1Div1DutyCycle | LCD use 1 BP 1/1 duty cycle.
kSLCD_1Div2DutyCycle | LCD use 2 BP 1/2 duty cycle.
kSLCD_1Div3DutyCycle | LCD use 3 BP 1/3 duty cycle.
kSLCD_1Div4DutyCycle | LCD use 4 BP 1/4 duty cycle.
kSLCD_1Div5DutyCycle | LCD use 5 BP 1/5 duty cycle.
kSLCD_1Div6DutyCycle | LCD use 6 BP 1/6 duty cycle.
kSLCD_1Div7DutyCycle | LCD use 7 BP 1/7 duty cycle.
kSLCD_1Div8DutyCycle | LCD use 8 BP 1/8 duty cycle.

enum slcd_phase_type_t

Enumerator
kSLCD_NoPhaseActivate | LCD wareform no phase activates.
kSLCD_PhaseAActivate | LCD waveform phase A activates.
kSLCD_PhaseBActivate | LCD waveform phase B activates.
kSLCD_PhaseCActivate | LCD waveform phase C activates.
kSLCD_PhaseDActivate | LCD waveform phase D activates.
kSLCD_PhaseEActivate | LCD waveform phase E activates.
kSLCD_PhaseFActivate | LCD waveform phase F activates.
kSLCD_PhaseGActivate | LCD waveform phase G activates.
kSLCD_PhaseHActivate | LCD waveform phase H activates.

enum slcd_phase_index_t

Enumerator
kSLCD_PhaseAIndex | LCD phase A bit index.
kSLCD_PhaseBIndex | LCD phase B bit index.
kSLCD_PhaseCIndex | LCD phase C bit index.
kSLCD_PhaseDIndex | LCD phase D bit index.
kSLCD_PhaseEIndex | LCD phase E bit index.
kSLCD_PhaseFIndex | LCD phase F bit index.
kSLCD_PhaseGIndex | LCD phase G bit index.
kSLCD_PhaseHIndex | LCD phase H bit index.

enum slcd_display_mode_t

Enumerator
kSLCD_NormalMode | LCD Normal display mode.
kSLCD_AlternateMode | LCD Alternate display mode. For four back planes or less.
kSLCD_BlankMode | LCD Blank display mode.

enum slcd_blink_mode_t

Enumerator
kSLCD_BlankDisplayBlink | Display blank during the blink period.
kSLCD_AltDisplayBlink | Display alternate display during the blink period if duty cycle is lower than 5.

enum slcd_blink_rate_t

Enumerator
kSLCD_BlinkRate00 | SLCD blink rate is LCD clock/((2^12)).
kSLCD_BlinkRate01 | SLCD blink rate is LCD clock/((2^13)).
kSLCD_BlinkRate02 | SLCD blink rate is LCD clock/((2^14)).
kSLCD_BlinkRate03 | SLCD blink rate is LCD clock/((2^15)).
kSLCD_BlinkRate04 | SLCD blink rate is LCD clock/((2^16)).
kSLCD_BlinkRate05 | SLCD blink rate is LCD clock/((2^17)).
kSLCD_BlinkRate06 | SLCD blink rate is LCD clock/((2^18)).
kSLCD_BlinkRate07 | SLCD blink rate is LCD clock/((2^19)).

enum slcd_fault_detect_clock_prescaler_t

Enumerator
kSLCD_FaultSampleFreqDivider1 | Fault detect sample clock frequency is 1/1 bus clock.
kSLCD_FaultSampleFreqDivider2 | Fault detect sample clock frequency is 1/2 bus clock.
kSLCD_FaultSampleFreqDivider4 | Fault detect sample clock frequency is 1/4 bus clock.
kSLCD_FaultSampleFreqDivider8 | Fault detect sample clock frequency is 1/8 bus clock.
kSLCD_FaultSampleFreqDivider16 | Fault detect sample clock frequency is 1/16 bus clock.
kSLCD_FaultSampleFreqDivider32 | Fault detect sample clock frequency is 1/32 bus clock.
kSLCD_FaultSampleFreqDivider64 | Fault detect sample clock frequency is 1/64 bus clock.
kSLCD_FaultSampleFreqDivider128 | Fault detect sample clock frequency is 1/128 bus clock.

enum slcd_fault_detect_sample_window_width_t

Enumerator
kSLCD_FaultDetectWindowWidth4SampleClk | Sample window width is 4 sample clock cycles.
kSLCD_FaultDetectWindowWidth8SampleClk | Sample window width is 8 sample clock cycles.
kSLCD_FaultDetectWindowWidth16SampleClk | Sample window width is 16 sample clock cycles.
kSLCD_FaultDetectWindowWidth32SampleClk | Sample window width is 32 sample clock cycles.
kSLCD_FaultDetectWindowWidth64SampleClk | Sample window width is 64 sample clock cycles.
kSLCD_FaultDetectWindowWidth128SampleClk | Sample window width is 128 sample clock cycles.
kSLCD_FaultDetectWindowWidth256SampleClk | Sample window width is 256 sample clock cycles.
kSLCD_FaultDetectWindowWidth512SampleClk | Sample window width is 512 sample clock cycles.

enum slcd_interrupt_enable_t

Enumerator
kSLCD_FaultDetectCompleteInterrupt | SLCD fault detection complete interrupt source.

enum slcd_lowpower_behavior

Enumerator
kSLCD_EnabledInWaitStop | SLCD works in wait and stop mode.
kSLCD_EnabledInWaitOnly | SLCD works in wait mode and is disabled in stop mode.
kSLCD_EnabledInStopOnly | SLCD works in stop mode and is disabled in wait mode.
kSLCD_DisabledInWaitStop | SLCD is disabled in stop mode and wait mode.

## Function Documentation

void SLCD_Init | ( | LCD_Type * | base,
|  | slcd_config_t * | configure
| ) |  |

Parameters

  base | SLCD peripheral base address.
  configure | SLCD configuration pointer. For the configuration structure, many parameters have the default setting and the SLCD_Getdefaultconfig() is provided to get them. Use it verified for their applications. The others have no default settings such as "clkConfig" and must be provided by the application before calling the SLCD_Init() API.

void SLCD_Deinit | ( | LCD_Type * | base | ) |

Parameters

  base | SLCD peripheral base address.

void SLCD_GetDefaultConfig | ( | slcd_config_t * | configure | ) |

The purpose of this API is to get default parameters of the configuration structure for the SLCD_Init(). Use these initialized parameters unchanged in SLCD_Init(), or modify some fields of the structure before the calling SLCD_Init(). All default parameters of the configure structure are listed:

config.displayMode = kSLCD_NormalMode; // SLCD normal mode
config.powerSupply = kSLCD_InternalVll3UseChargePump; // Use charge pump internal VLL3
config.voltageTrim = kSLCD_RegulatedVolatgeTrim00;
config.lowPowerBehavior = kSLCD_EnabledInWaitStop; // Work on low power mode
config.interruptSrc = 0; // No interrupt source is enabled
config.faultConfig = NULL; // Fault detection is disabled
config.frameFreqIntEnable = false;

Parameters

  configure | The SLCD configuration structure pointer.

static void SLCD_StartDisplay | ( | LCD_Type * | base | ) |

inlinestatic

Parameters

  base | SLCD peripheral base address.

static void SLCD_StopDisplay | ( | LCD_Type * | base | ) |

inlinestatic

There is no waveform generator and all enabled pins only output a low value.

Parameters

  base | SLCD peripheral base address.

void SLCD_StartBlinkMode | ( | LCD_Type * | base,
|  | slcd_blink_mode_t | mode,
|  | slcd_blink_rate_t | rate
| ) |  |

Parameters

  base | SLCD peripheral base address.
  mode | SLCD blink mode.
  rate | SLCD blink rate.

static void SLCD_StopBlinkMode | ( | LCD_Type * | base | ) |

inlinestatic

Parameters

  base | SLCD peripheral base address.

static void SLCD_SetBackPlanePhase | ( | LCD_Type * | base,
|  | uint32_t | pinIndx,
|  | slcd_phase_type_t | phase
| ) |  |

inlinestatic

This function sets the SLCD back plane pin phase. "kSLCD_PhaseXActivate" setting means the phase X is active for the back plane pin. "kSLCD_NoPhaseActivate" setting means there is no phase active for the back plane pin. register value. For example, set the back plane pin 20 for phase A:

* SLCD_SetBackPlanePhase(LCD, 20, kSLCD_PhaseAActivate);
*

Parameters

  base | SLCD peripheral base address.
  pinIndx | SLCD back plane pin index. Range from 0 to 63.
  phase | The phase activates for the back plane pin.

static void SLCD_SetFrontPlaneSegments | ( | LCD_Type * | base,
|  | uint32_t | pinIndx,
|  | uint8_t | operation
| ) |  |

inlinestatic

This function sets the SLCD front plane segment on or off operation. Each bit turns on or off the segments associated with the front plane pin in the following pattern: HGFEDCBA (most significant bit controls segment H and least significant bit controls segment A). For example, turn on the front plane pin 20 for phase B and phase C:

* SLCD_SetFrontPlaneSegments(LCD, 20, (kSLCD_PhaseBActivate | kSLCD_PhaseCActivate));
*

Parameters

  base | SLCD peripheral base address.
  pinIndx | SLCD back plane pin index. Range from 0 to 63.
  operation | The operation for the segment on the front plane pin. This is a logical OR of the enumeration :: slcd_phase_type_t.

static void SLCD_SetFrontPlaneOnePhase | ( | LCD_Type * | base,
|  | uint32_t | pinIndx,
|  | slcd_phase_index_t | phaseIndx,
|  | bool | enable
| ) |  |

inlinestatic

This function can be used to set one phase on or off for the front plane pin. It can be call many times to set the plane pin for different phase indexes. For example, turn on the front plane pin 20 for phase B and phase C:

* SLCD_SetFrontPlaneOnePhase(LCD, 20, kSLCD_PhaseBIndex, true);
* SLCD_SetFrontPlaneOnePhase(LCD, 20, kSLCD_PhaseCIndex, true);
*

Parameters

  base | SLCD peripheral base address.
  pinIndx | SLCD back plane pin index. Range from 0 to 63.
  phaseIndx | The phase bit index slcd_phase_index_t.
  enable | True to turn on the segment for phaseIndx phase false to turn off the segment for phaseIndx phase.

static uint32_t SLCD_GetFaultDetectCounter | ( | LCD_Type * | base | ) |

inlinestatic

This function gets the number of samples inside the fault detection sample window.

Parameters

  base | SLCD peripheral base address.

Returns
  The fault detect counter. The maximum return value is 255. If the maximum 255 returns, the overflow may happen. Reconfigure the fault detect sample window and fault detect clock prescaler for proper sampling.

void SLCD_EnableInterrupts | ( | LCD_Type * | base,
|  | uint32_t | mask
| ) |  |

For example, to enable fault detect complete interrupt and frame frequency interrupt, for FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT enabled case, do the following.

* SLCD_EnableInterrupts(LCD,kSLCD_FaultDetectCompleteInterrupt | kSLCD_FrameFreqInterrupt);
*

Parameters

  base | SLCD peripheral base address.
  mask | SLCD interrupts to enable. This is a logical OR of the enumeration :: slcd_interrupt_enable_t.

void SLCD_DisableInterrupts | ( | LCD_Type * | base,
|  | uint32_t | mask
| ) |  |

For example, to disable fault detect complete interrupt and frame frequency interrupt, for FSL_FEATURE_SLCD_HAS_FRAME_FREQUENCY_INTERRUPT enabled case, do the following.

* SLCD_DisableInterrupts(LCD,kSLCD_FaultDetectCompleteInterrupt | kSLCD_FrameFreqInterrupt);
*

Parameters

  base | SLCD peripheral base address.
  mask | SLCD interrupts to disable. This is a logical OR of the enumeration :: slcd_interrupt_enable_t.

uint32_t SLCD_GetInterruptStatus | ( | LCD_Type * | base | ) |

Parameters

  base | SLCD peripheral base address.

Returns
  The event status of the interrupt source. This is the logical OR of members of the enumeration :: slcd_interrupt_enable_t.

void SLCD_ClearInterruptStatus | ( | LCD_Type * | base,
|  | uint32_t | mask
| ) |  |

Parameters

  base | SLCD peripheral base address.
  mask | SLCD interrupt source to be cleared. This is the logical OR of members of the enumeration :: slcd_interrupt_enable_t.