Liquid Crystal Display (LCD) Peripheral API. More...
![]() |
Data Structures | |
struct | LCD_AnimInit_TypeDef |
struct | LCD_FrameCountInit_TypeDef |
struct | LCD_Init_TypeDef |
Defines | |
#define | LCD_INIT_DEFAULT |
Enumerations | |
enum | LCD_Mux_TypeDef { lcdMuxStatic = LCD_DISPCTRL_MUX_STATIC, lcdMuxDuplex = LCD_DISPCTRL_MUX_DUPLEX, lcdMuxTriplex = LCD_DISPCTRL_MUX_TRIPLEX, lcdMuxQuadruplex = LCD_DISPCTRL_MUX_QUADRUPLEX, lcdMuxSextaplex = LCD_DISPCTRL_MUXE_MUXE | LCD_DISPCTRL_MUX_DUPLEX, lcdMuxOctaplex = LCD_DISPCTRL_MUXE_MUXE | LCD_DISPCTRL_MUX_QUADRUPLEX } |
enum | LCD_Bias_TypeDef { lcdBiasStatic = LCD_DISPCTRL_BIAS_STATIC, lcdBiasOneHalf = LCD_DISPCTRL_BIAS_ONEHALF, lcdBiasOneThird = LCD_DISPCTRL_BIAS_ONETHIRD, lcdBiasOneFourth = LCD_DISPCTRL_BIAS_ONEFOURTH } |
enum | LCD_Wave_TypeDef { lcdWaveLowPower = LCD_DISPCTRL_WAVE_LOWPOWER, lcdWaveNormal = LCD_DISPCTRL_WAVE_NORMAL } |
enum | LCD_VLCDSel_TypeDef { lcdVLCDSelVDD = LCD_DISPCTRL_VLCDSEL_VDD, lcdVLCDSelVExtBoost = LCD_DISPCTRL_VLCDSEL_VEXTBOOST } |
enum | LCD_ConConf_TypeDef { lcdConConfVLCD = LCD_DISPCTRL_CONCONF_VLCD, lcdConConfGND = LCD_DISPCTRL_CONCONF_GND } |
enum | LCD_VBoostLevel_TypeDef { lcdVBoostLevel0 = LCD_DISPCTRL_VBLEV_LEVEL0, lcdVBoostLevel1 = LCD_DISPCTRL_VBLEV_LEVEL1, lcdVBoostLevel2 = LCD_DISPCTRL_VBLEV_LEVEL2, lcdVBoostLevel3 = LCD_DISPCTRL_VBLEV_LEVEL3, lcdVBoostLevel4 = LCD_DISPCTRL_VBLEV_LEVEL4, lcdVBoostLevel5 = LCD_DISPCTRL_VBLEV_LEVEL5, lcdVBoostLevel6 = LCD_DISPCTRL_VBLEV_LEVEL6, lcdVBoostLevel7 = LCD_DISPCTRL_VBLEV_LEVEL7 } |
enum | LCD_FCPreScale_TypeDef { lcdFCPrescDiv1 = LCD_BACTRL_FCPRESC_DIV1, lcdFCPrescDiv2 = LCD_BACTRL_FCPRESC_DIV2, lcdFCPrescDiv4 = LCD_BACTRL_FCPRESC_DIV4, lcdFCPrescDiv8 = LCD_BACTRL_FCPRESC_DIV8 } |
enum | LCD_SegmentRange_TypeDef { lcdSegment0_3 = (1 << 0), lcdSegment4_7 = (1 << 1), lcdSegment8_11 = (1 << 2), lcdSegment12_15 = (1 << 3), lcdSegment16_19 = (1 << 4), lcdSegment20_23 = (1 << 5), lcdSegment24_27 = (1 << 6), lcdSegment28_31 = (1 << 7), lcdSegment32_35 = (1 << 8), lcdSegment36_39 = (1 << 9), lcdSegmentAll = (0x03ff) } |
enum | LCD_UpdateCtrl_TypeDef { lcdUpdateCtrlRegular = LCD_CTRL_UDCTRL_REGULAR, lcdUpdateCtrlFCEvent = LCD_CTRL_UDCTRL_FCEVENT, lcdUpdateCtrlFrameStart = LCD_CTRL_UDCTRL_FRAMESTART } |
enum | LCD_AnimShift_TypeDef { lcdAnimShiftNone = _LCD_BACTRL_AREGASC_NOSHIFT, lcdAnimShiftLeft = _LCD_BACTRL_AREGASC_SHIFTLEFT, lcdAnimShiftRight = _LCD_BACTRL_AREGASC_SHIFTRIGHT } |
enum | LCD_AnimLogic_TypeDef { lcdAnimLogicAnd = LCD_BACTRL_ALOGSEL_AND, lcdAnimLogicOr = LCD_BACTRL_ALOGSEL_OR } |
Functions | |
void | LCD_Init (const LCD_Init_TypeDef *lcdInit) |
Initalize Liquid Crystal Display (LCD) controller. | |
void | LCD_VLCDSelect (LCD_VLCDSel_TypeDef vlcd) |
Select source for VLCD. | |
void | LCD_UpdateCtrl (LCD_UpdateCtrl_TypeDef ud) |
Configure Update Control. | |
void | LCD_FrameCountInit (const LCD_FrameCountInit_TypeDef *fcInit) |
Initialize LCD Frame Counter. | |
void | LCD_AnimInit (const LCD_AnimInit_TypeDef *animInit) |
Configures LCD controller Animation feature. | |
void | LCD_SegmentRangeEnable (LCD_SegmentRange_TypeDef segmentRange, bool enable) |
Enables update of this range of LCD segment lines. | |
void | LCD_SegmentSet (int com, int bit, bool enable) |
Turn on or clear a segment. | |
void | LCD_SegmentSetLow (int com, uint32_t mask, uint32_t bits) |
Updates the 0-31 lowest segments on a given COM-line in one operation, according to bit mask. | |
void | LCD_SegmentSetHigh (int com, uint32_t mask, uint32_t bits) |
Updated the high (32-39) segments on a given COM-line in one operation. | |
void | LCD_ContrastSet (int level) |
Configure contrast level on LCD panel. | |
void | LCD_VBoostSet (LCD_VBoostLevel_TypeDef vboost) |
Configure voltage booster. | |
void | LCD_BiasSegmentSet (int segmentLine, int biasLevel) |
Configure bias level for a specific segment line for Direct Segment Control. | |
void | LCD_BiasComSet (int comLine, int biasLevel) |
Configure bias level for a specific segment line. | |
__STATIC_INLINE void | LCD_Enable (bool enable) |
Enable or disable LCD controller. | |
__STATIC_INLINE void | LCD_AnimEnable (bool enable) |
Enables or disables LCD Animation feature. | |
__STATIC_INLINE void | LCD_BlinkEnable (bool enable) |
Enables or disables LCD blink. | |
__STATIC_INLINE void | LCD_BlankEnable (bool enable) |
Disables all segments, while keeping segment state. | |
__STATIC_INLINE void | LCD_FrameCountEnable (bool enable) |
Enables or disables LCD Frame Control. | |
__STATIC_INLINE int | LCD_AnimState (void) |
Returns current animation state. | |
__STATIC_INLINE int | LCD_BlinkState (void) |
Returns current blink state. | |
__STATIC_INLINE void | LCD_FreezeEnable (bool enable) |
When set, LCD registers will not be updated until cleared,. | |
__STATIC_INLINE uint32_t | LCD_SyncBusyGet (void) |
Returns SYNCBUSY bits, indicating which registers have pending updates. | |
__STATIC_INLINE void | LCD_SyncBusyDelay (uint32_t flags) |
Polls LCD SYNCBUSY flags, until flag has been cleared. | |
__STATIC_INLINE uint32_t | LCD_IntGet (void) |
Get pending LCD interrupt flags. | |
__STATIC_INLINE uint32_t | LCD_IntGetEnabled (void) |
Get enabled and pending LCD interrupt flags. | |
__STATIC_INLINE void | LCD_IntSet (uint32_t flags) |
Set one or more pending LCD interrupts from SW. | |
__STATIC_INLINE void | LCD_IntEnable (uint32_t flags) |
Enable LCD interrupts. | |
__STATIC_INLINE void | LCD_IntDisable (uint32_t flags) |
Disable LCD interrupts. | |
__STATIC_INLINE void | LCD_IntClear (uint32_t flags) |
Clear one or more interrupt flags. | |
__STATIC_INLINE void | LCD_DSCEnable (bool enable) |
Enable or disable LCD Direct Segment Control. |
Liquid Crystal Display (LCD) Peripheral API.
#define LCD_INIT_DEFAULT |
{ true, \ lcdMuxQuadruplex, \ lcdBiasOneThird, \ lcdWaveLowPower, \ lcdVLCDSelVDD, \ lcdConConfVLCD \ }
Default config for LCD init structure, enables 160 segments
enum LCD_Bias_TypeDef |
enum LCD_ConConf_TypeDef |
enum LCD_Mux_TypeDef |
MUX setting
Segment selection
Voltage Boost Level - Datasheets document setting for each part number
enum LCD_VLCDSel_TypeDef |
enum LCD_Wave_TypeDef |
__STATIC_INLINE void LCD_AnimEnable | ( | bool | enable | ) |
Enables or disables LCD Animation feature.
[in] | enable | Boolean true enables animation, false disables animation |
Definition at line 349 of file em_lcd.h.
Referenced by LCD_AnimInit().
void LCD_AnimInit | ( | const LCD_AnimInit_TypeDef * | animInit | ) |
Configures LCD controller Animation feature.
[in] | animInit | Pointer to LCD Animation initialization structure |
Definition at line 179 of file em_lcd.c.
References LCD_AnimInit_TypeDef::animLogic, LCD_AnimInit_TypeDef::AReg, LCD_AnimInit_TypeDef::AShift, LCD_AnimInit_TypeDef::BReg, LCD_AnimInit_TypeDef::BShift, LCD_AnimInit_TypeDef::enable, LCD_AnimEnable(), and LCD_AnimInit_TypeDef::startSeg.
__STATIC_INLINE int LCD_AnimState | ( | void | ) |
void LCD_BiasComSet | ( | int | comLine, | |
int | biasLevel | |||
) |
Configure bias level for a specific segment line.
[in] | comLine | COM line number, 0-7 |
[in] | biasLevel | Bias configuration level, 0-4. This value must be within the constraint defined by the LCD_DISPCTRL bias setting, see Reference Manual/Datasheet |
void LCD_BiasSegmentSet | ( | int | segmentLine, | |
int | biasLevel | |||
) |
Configure bias level for a specific segment line for Direct Segment Control.
[in] | segmentLine | Segment line number |
[in] | biasLevel | Bias configuration level, 0-4. This value must be within the constraint defined by the LCD_DISPCTRL bias setting, see Reference Manual/Datasheet |
__STATIC_INLINE void LCD_BlankEnable | ( | bool | enable | ) |
__STATIC_INLINE void LCD_BlinkEnable | ( | bool | enable | ) |
__STATIC_INLINE int LCD_BlinkState | ( | void | ) |
void LCD_ContrastSet | ( | int | level | ) |
__STATIC_INLINE void LCD_DSCEnable | ( | bool | enable | ) |
Enable or disable LCD Direct Segment Control.
[in] | enable | If true, enables LCD controller Direct Segment Control Segment and COM line bias levels needs to be set explicitly with the LCD_BiasSegmentSet() and LCD_BiasComSet() function calls. |
__STATIC_INLINE void LCD_Enable | ( | bool | enable | ) |
Enable or disable LCD controller.
[in] | enable | If true, enables LCD controller with current configuration, if false disables LCD controller. CMU clock for LCD must be enabled for correct operation. |
Definition at line 329 of file em_lcd.h.
Referenced by LCD_Init().
__STATIC_INLINE void LCD_FrameCountEnable | ( | bool | enable | ) |
Enables or disables LCD Frame Control.
[in] | enable | Boolean true enables frame counter, false disables frame counter |
Definition at line 409 of file em_lcd.h.
Referenced by LCD_FrameCountInit().
void LCD_FrameCountInit | ( | const LCD_FrameCountInit_TypeDef * | fcInit | ) |
Initialize LCD Frame Counter.
[in] | fcInit | Pointer to Frame Counter initialization structure |
Definition at line 150 of file em_lcd.c.
References LCD_FrameCountInit_TypeDef::enable, LCD_FrameCountEnable(), LCD_FrameCountInit_TypeDef::prescale, and LCD_FrameCountInit_TypeDef::top.
__STATIC_INLINE void LCD_FreezeEnable | ( | bool | enable | ) |
void LCD_Init | ( | const LCD_Init_TypeDef * | lcdInit | ) |
Initalize Liquid Crystal Display (LCD) controller.
This function call will only configure the LCD controller. You must enable it afterwards, potentially configuring Frame Control and interrupts first according to requirements.
[in] | lcdInit | Pointer to initialization structure which configures LCD controller. |
Definition at line 63 of file em_lcd.c.
References LCD_Init_TypeDef::bias, LCD_Init_TypeDef::contrast, LCD_Init_TypeDef::enable, LCD_Enable(), LCD_Init_TypeDef::mux, LCD_Init_TypeDef::vlcd, and LCD_Init_TypeDef::wave.
__STATIC_INLINE void LCD_IntClear | ( | uint32_t | flags | ) |
__STATIC_INLINE void LCD_IntDisable | ( | uint32_t | flags | ) |
__STATIC_INLINE void LCD_IntEnable | ( | uint32_t | flags | ) |
__STATIC_INLINE uint32_t LCD_IntGet | ( | void | ) |
__STATIC_INLINE uint32_t LCD_IntGetEnabled | ( | void | ) |
Get enabled and pending LCD interrupt flags.
Useful for handling more interrupt sources in the same interrupt handler.
__STATIC_INLINE void LCD_IntSet | ( | uint32_t | flags | ) |
void LCD_SegmentRangeEnable | ( | LCD_SegmentRange_TypeDef | segmentRange, | |
bool | enable | |||
) |
void LCD_SegmentSet | ( | int | com, | |
int | bit, | |||
bool | enable | |||
) |
Turn on or clear a segment.
[in] | com | COM line to change |
[in] | bit | Bit index of which field to change |
[in] | enable | When true will set segment, when false will clear segment |
Definition at line 261 of file em_lcd.c.
References BITBAND_Peripheral().
void LCD_SegmentSetHigh | ( | int | com, | |
uint32_t | mask, | |||
uint32_t | bits | |||
) |
void LCD_SegmentSetLow | ( | int | com, | |
uint32_t | mask, | |||
uint32_t | bits | |||
) |
__STATIC_INLINE void LCD_SyncBusyDelay | ( | uint32_t | flags | ) |
__STATIC_INLINE uint32_t LCD_SyncBusyGet | ( | void | ) |
void LCD_UpdateCtrl | ( | LCD_UpdateCtrl_TypeDef | ud | ) |
void LCD_VBoostSet | ( | LCD_VBoostLevel_TypeDef | vboost | ) |
void LCD_VLCDSelect | ( | LCD_VLCDSel_TypeDef | vlcd | ) |
Select source for VLCD.
[in] | vlcd | Select source for VLD voltage |
Definition at line 108 of file em_lcd.c.
References lcdVLCDSelVDD, and lcdVLCDSelVExtBoost.