LCD - Liquid Crystal Display#

Liquid Crystal Display (LCD) Peripheral API.


This module contains functions to control the LCD peripheral of Silicon Labs 32-bit MCUs and SoCs. The LCD driver can drive up to 8x36 segmented LCD directly. The animation feature makes it possible to have active animations without the CPU intervention.

Example#

This example demonstrates initialization, basic configuration, and usage of the LCD peripheral. It shows how to:

  • Initialize the LCD with default settings

  • Show a blink animation of segment 0-7 of com line 0.

#include "sl_hal_lcd.h"
#include "sl_clock_manager.h"
void lcd_example(void)
{
  // Enable clock to LCD module.
  sl_clock_manager_enable_bus_clock(SL_BUS_CLOCK_LCD);
  // Disable interrupts.
  sl_hal_lcd_disable_interrupts(_LCD_IF_MASK);
  // Initialize lcd configuration structure.
  sl_hal_lcd_init_t init = {
    .mux = SL_HAL_LCD_MUX_QUADRUPLEX,
    .bias = SL_HAL_LCD_BIAS_ONE_THIRD,
    .wave = SL_HAL_LCD_WAVE_LOW_POWER,
    .mode = SL_HAL_LCD_MODE_CHARGE_PUMP,
    .charge_redistribution = SL_HAL_LCD_CHARGE_REDISTRIBUTION_THREE_CYCLE,
    .frame_rate_divider = 8,
    .contrast_level = 25,
    .clock_prescaler = 128
  };
  sl_hal_lcd_frame_counter_init_t fc_init = {
    .top = 48,
    .prescale = SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV1
  };

  // Disable LCD before config.
  sl_hal_lcd_disable();
  sl_hal_lcd_wait_ready();
  // Initialize LCD.
  sl_hal_lcd_init(&init);
  // Initialize frame counter.
  sl_hal_lcd_init_frame_counter(&fc_init);
  // Enable the LCD.
  sl_hal_lcd_enable();
  // Enable frame counter.
  sl_hal_lcd_enable_frame_counter();

  // Enable display segment.
  sl_hal_lcd_enable_com_line(0);
  for(uint8_t segment_num = 0; segment_num < 8; segment_num++) {
    sl_hal_lcd_segment_enable(segment_num);
  }
  
  // Initialize lcd blink animation configuration structure.
  sl_hal_lcd_animation_init_t animation_init = {
      .A_reg = 0x80,
      .A_shift = SL_HAL_LCD_ANIMATION_SHIFT_LEFT,
      .B_reg = 0x00,
      .B_shift = SL_HAL_LCD_ANIMATION_SHIFT_NONE,
      .animation_logic = SL_HAL_LCD_ANIMATION_LOGIC_OR,
      .start_segment = SL_HAL_LCD_ANIMATION_LOCATION_SEG0_TO_7
  };
  sl_hal_lcd_init_animation(&animation_init);
  sl_hal_lcd_animation_enable();
}

Modules#

sl_hal_lcd_animation_init_t

sl_hal_lcd_frame_counter_init_t

sl_hal_lcd_init_t

Enumerations#

enum
SL_HAL_LCD_MUX_STATIC = _LCD_DISPCTRL_MUX_STATIC
SL_HAL_LCD_MUX_DUPLEX = _LCD_DISPCTRL_MUX_DUPLEX
SL_HAL_LCD_MUX_TRIPLEX = _LCD_DISPCTRL_MUX_TRIPLEX
SL_HAL_LCD_MUX_QUADRUPLEX = _LCD_DISPCTRL_MUX_QUADRUPLEX
}

MUX setting.

enum
SL_HAL_LCD_WAVE_LOW_POWER = _LCD_DISPCTRL_WAVE_TYPEB
SL_HAL_LCD_WAVE_NORMAL = _LCD_DISPCTRL_WAVE_TYPEA
}

Wave type.

enum
SL_HAL_LCD_BIAS_STATIC = _LCD_DISPCTRL_BIAS_STATIC
SL_HAL_LCD_BIAS_ONE_HALF = _LCD_DISPCTRL_BIAS_ONEHALF
SL_HAL_LCD_BIAS_ONE_THIRD = _LCD_DISPCTRL_BIAS_ONETHIRD
SL_HAL_LCD_BIAS_ONE_FOURTH = _LCD_DISPCTRL_BIAS_ONEFOURTH
}

Bias setting.

enum
SL_HAL_LCD_MODE_STEP_DOWN = _LCD_BIASCTRL_MODE_STEPDOWN
SL_HAL_LCD_MODE_CHARGE_PUMP = _LCD_BIASCTRL_MODE_CHARGEPUMP
}

Mode of operation.

enum
SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV1 = _LCD_BACFG_FCPRESC_DIV1
SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV2 = _LCD_BACFG_FCPRESC_DIV2
SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV4 = _LCD_BACFG_FCPRESC_DIV4
SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV8 = _LCD_BACFG_FCPRESC_DIV8
}

Frame Counter Clock Prescaler, FC-CLK = FrameRate (Hz) / this factor.

enum
SL_HAL_LCD_UPDATE_CONTROL_REGULAR = _LCD_CTRL_UDCTRL_REGULAR
SL_HAL_LCD_UPDATE_CONTROL_FRAME_COUNTER_EVENT = _LCD_CTRL_UDCTRL_FCEVENT
SL_HAL_LCD_UPDATE_CONTROL_FRAME_START = _LCD_CTRL_UDCTRL_FRAMESTART
SL_HAL_LCD_UPDATE_CONTROL_DISPLAY_EVENT = _LCD_CTRL_UDCTRL_DISPLAYEVENT
}

Update Data Control.

enum
SL_HAL_LCD_LOAD_ADDRESS_NONE = 0
SL_HAL_LCD_LOAD_ADDRESS_BACTRL = _LCD_UPDATECTRL_LOADADDR_BACTRLWR
SL_HAL_LCD_LOAD_ADDRESS_AREGA = _LCD_UPDATECTRL_LOADADDR_AREGAWR
SL_HAL_LCD_LOAD_ADDRESS_AREGB = _LCD_UPDATECTRL_LOADADDR_AREGBWR
SL_HAL_LCD_LOAD_ADDRESS_SEGD0 = _LCD_UPDATECTRL_LOADADDR_SEGD0WR
SL_HAL_LCD_LOAD_ADDRESS_SEGD1 = _LCD_UPDATECTRL_LOADADDR_SEGD1WR
SL_HAL_LCD_LOAD_ADDRESS_SEGD2 = _LCD_UPDATECTRL_LOADADDR_SEGD2WR
SL_HAL_LCD_LOAD_ADDRESS_SEGD3 = _LCD_UPDATECTRL_LOADADDR_SEGD3WR
}

Auto Load address which will start the synchronization from CLK_BUS to CLK_PER.

enum
SL_HAL_LCD_ANIMATION_SHIFT_NONE = _LCD_BACTRL_AREGASC_NOSHIFT
SL_HAL_LCD_ANIMATION_SHIFT_LEFT = _LCD_BACTRL_AREGASC_SHIFTLEFT
SL_HAL_LCD_ANIMATION_SHIFT_RIGHT = _LCD_BACTRL_AREGASC_SHIFTRIGHT
}

Animation Shift operation; none, left or right.

enum
SL_HAL_LCD_ANIMATION_LOGIC_AND = _LCD_BACTRL_ALOGSEL_AND
SL_HAL_LCD_ANIMATION_LOGIC_OR = _LCD_BACTRL_ALOGSEL_OR
}

Animation Logic Control, how AReg and BReg should be combined.

enum
SL_HAL_LCD_ANIMATION_LOCATION_SEG0_TO_7 = _LCD_BACTRL_ALOC_SEG0TO7
SL_HAL_LCD_ANIMATION_LOCATION_SEG8_TO_15 = _LCD_BACTRL_ALOC_SEG8TO15
}

Animation Location, set the LCD segments which animation applies to.

enum
SL_HAL_LCD_CHARGE_REDISTRIBUTION_DISABLE = _LCD_DISPCTRL_CHGRDST_DISABLE
SL_HAL_LCD_CHARGE_REDISTRIBUTION_ENABLE = _LCD_DISPCTRL_CHGRDST_ONE
SL_HAL_LCD_CHARGE_REDISTRIBUTION_TWO_CYCLE = _LCD_DISPCTRL_CHGRDST_TWO
SL_HAL_LCD_CHARGE_REDISTRIBUTION_THREE_CYCLE = _LCD_DISPCTRL_CHGRDST_THREE
SL_HAL_LCD_CHARGE_REDISTRIBUTION_FOUR_CYCLE = _LCD_DISPCTRL_CHGRDST_FOUR
}

Charge redistribution control.

enum
SL_HAL_LCD_DMA_MODE_DISABLE = _LCD_BIASCTRL_DMAMODE_DMADISABLE
SL_HAL_LCD_DMA_MODE_FRAME_COUNTER_EVENT = _LCD_BIASCTRL_DMAMODE_DMAFC
SL_HAL_LCD_DMA_MODE_DISPLAY_EVENT = _LCD_BIASCTRL_DMAMODE_DMADISPLAY
}

DMA mode of operation.

Functions#

void
sl_hal_lcd_init(const sl_hal_lcd_init_t *init)

Initialize the Liquid Crystal Display (LCD) controller.

void
sl_hal_lcd_init_frame_counter(const sl_hal_lcd_frame_counter_init_t *init)

Initialize the LCD Frame Counter.

void
sl_hal_lcd_init_animation(const sl_hal_lcd_animation_init_t *init)

Configure the LCD controller Animation feature.

void
sl_hal_lcd_update_control(sl_hal_lcd_update_data_control_t method)

Configure Update Control.

void
sl_hal_lcd_segment_enable(uint32_t segment_number)

Enables a given LCD segment line.

void
sl_hal_lcd_segment_disable(uint32_t segment_number)

Disable a given LCD segment line.

void
sl_hal_lcd_segment_set(uint8_t com, int bit, bool enable)

Turn on or clear a segment.

void
sl_hal_lcd_segment_set_low(uint8_t com, uint32_t mask, uint32_t bits)

Update 0-31 lowest segments on a given COM-line in one operation according to the bit mask.

void

Enables a given LCD COM line.

void

Disable a given LCD COM line.

void
sl_hal_lcd_bias_set_segment(uint8_t segment_line, uint32_t bias_level)

Configure the bias level for a specific segment line for Direct Segment Control.

void
sl_hal_lcd_bias_set_com(uint8_t com_line, uint32_t bias_level)

Configure the bias level for a specific segment line.

void

Wait for load synchronization completion.

void

Wait for the LCD to complete resetting or disabling procedure.

void

Enable LCD controller with current configuration.

void

Disable LCD controller.

void

Reset the LCD.

void

Enable LCD Animation feature.

void

Disable LCD Animation feature.

uint32_t

Return the current animation state.

void

Enable the LCD blink.

void

Disable the LCD blink.

uint32_t

Return the current blink state.

void

Clears all segments while keeping segment state.

void

Restores all segment lines.

void

Enable or disable LCD Frame counter.

void

Disable LCD Frame counter.

void

Enable the LCD Display counter.

void

Disable the LCD Display counter.

void
sl_hal_lcd_start_sync(bool auto_load, sl_hal_lcd_load_address_t load_addr)

Start the synchronization process.

void
sl_hal_lcd_stop_sync(bool auto_load)

Stop the synchronization process.

uint32_t

Get pending LCD interrupt flags.

uint32_t

Get enabled and pending LCD interrupt flags.

void

Set one or more pending LCD interrupts from SW.

void

Enable LCD interrupts.

void

Disable LCD interrupts.

void

Clear one or more interrupt flags.

void

Enable LCD Direct Segment Control.

void

Disable LCD Direct Segment Control.

void
sl_hal_lcd_set_dma_mode(sl_hal_lcd_dma_mode_t mode)

Set a given DMA mode operation.

void
sl_hal_lcd_bias_set(sl_hal_lcd_bias_t bias)

Configure the bias level on the LCD panel.

void

Configure the contrast level on the LCD panel.

void

Configure the charge redistribution cycles for the LCD panel.

void
sl_hal_lcd_set_mode(sl_hal_lcd_mode_t mode)

Configure the mode for the LCD panel.

Macros#

#define
SL_HAL_LCD_DEFAULT_CLOCK_PRESCALER 64

Default Clock Prescaler.

#define
SL_HAL_LCD_DEFAULT_FRAME_RATE_DIV 4

Default LCD Frame Rate Divisor.

#define
SL_HAL_LCD_DEFAULT_CONTRAST 15

Default LCD Contrast.

#define
SL_HAL_LCD_COM_LINES_MAX LCD_COM_NUM

Maximum common lines of LCD.

#define
SL_HAL_LCD_SEGMENT_LINES_MAX LCD_SEG_NUM

Maximum segment lines of LCD.

#define
SL_HAL_LCD_INIT_DEFAULT undefined

Default configuration for LCD initialization structure, enables 160 segments.

#define
SL_HAL_LCD_ANIMATION_INIT_DEFAULT undefined

Default configuration for LCD Animation initialization structure.

#define
SL_HAL_LCD_FRAME_COUNTER_INIT_DEFAULT undefined

Default configuration for LCD Frame Counter initialization structure.

Enumeration Documentation#

sl_hal_lcd_multiplexer_t#

sl_hal_lcd_multiplexer_t

MUX setting.

Enumerator
SL_HAL_LCD_MUX_STATIC

Static (segments can be multiplexed with LCD_COM[0]).

SL_HAL_LCD_MUX_DUPLEX

Duplex: 1/2 Duty cycle (segments can be multiplexed with LCD_COM[0:1]).

SL_HAL_LCD_MUX_TRIPLEX

Triplex: 1/3 Duty cycle (segments can be multiplexed with LCD_COM[0:2]).

SL_HAL_LCD_MUX_QUADRUPLEX

Quadruplex: 1/4 Duty cycle (segments can be multiplexed with LCD_COM[0:3]).


sl_hal_lcd_wave_t#

sl_hal_lcd_wave_t

Wave type.

Enumerator
SL_HAL_LCD_WAVE_LOW_POWER

Low power optimized waveform output.

SL_HAL_LCD_WAVE_NORMAL

Regular waveform output.


sl_hal_lcd_bias_t#

sl_hal_lcd_bias_t

Bias setting.

Enumerator
SL_HAL_LCD_BIAS_STATIC

Static (2 levels).

SL_HAL_LCD_BIAS_ONE_HALF

1/2 Bias (3 levels).

SL_HAL_LCD_BIAS_ONE_THIRD

1/3 Bias (4 levels).

SL_HAL_LCD_BIAS_ONE_FOURTH

1/4 Bias (5 levels).


sl_hal_lcd_mode_t#

sl_hal_lcd_mode_t

Mode of operation.

Enumerator
SL_HAL_LCD_MODE_STEP_DOWN

External cap with resistor string.

SL_HAL_LCD_MODE_CHARGE_PUMP

External cap and internal oscillator.


sl_hal_lcd_frame_counter_prescale_t#

sl_hal_lcd_frame_counter_prescale_t

Frame Counter Clock Prescaler, FC-CLK = FrameRate (Hz) / this factor.

Enumerator
SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV1

Prescale Div 1.

SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV2

Prescale Div 2.

SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV4

Prescale Div 4.

SL_HAL_LCD_FRAME_COUNTER_PRESCALE_DIV8

Prescale Div 8.


sl_hal_lcd_update_data_control_t#

sl_hal_lcd_update_data_control_t

Update Data Control.

Enumerator
SL_HAL_LCD_UPDATE_CONTROL_REGULAR

Regular update, data transfer done immediately.

SL_HAL_LCD_UPDATE_CONTROL_FRAME_COUNTER_EVENT

Data transfer done at Frame Counter event.

SL_HAL_LCD_UPDATE_CONTROL_FRAME_START

Data transfer done at Frame Start.

SL_HAL_LCD_UPDATE_CONTROL_DISPLAY_EVENT

Data transfer done at Display Counter event.


sl_hal_lcd_load_address_t#

sl_hal_lcd_load_address_t

Auto Load address which will start the synchronization from CLK_BUS to CLK_PER.

Enumerator
SL_HAL_LCD_LOAD_ADDRESS_NONE

Starts synchronizing registers after a write to BACTRL.

SL_HAL_LCD_LOAD_ADDRESS_BACTRL

Starts synchronizing registers after a write to BACTRL.

SL_HAL_LCD_LOAD_ADDRESS_AREGA

Starts synchronizing registers after a write to AREGA.

SL_HAL_LCD_LOAD_ADDRESS_AREGB

Starts synchronizing registers after a write to AREGB.

SL_HAL_LCD_LOAD_ADDRESS_SEGD0

Starts synchronizing registers after a write to SEGD0.

SL_HAL_LCD_LOAD_ADDRESS_SEGD1

Starts synchronizing registers after a write to SEGD1.

SL_HAL_LCD_LOAD_ADDRESS_SEGD2

Starts synchronizing registers after a write to SEGD2.

SL_HAL_LCD_LOAD_ADDRESS_SEGD3

Starts synchronizing registers after a write to SEGD3.


sl_hal_lcd_animation_shift_t#

sl_hal_lcd_animation_shift_t

Animation Shift operation; none, left or right.

Enumerator
SL_HAL_LCD_ANIMATION_SHIFT_NONE

No shift.

SL_HAL_LCD_ANIMATION_SHIFT_LEFT

Shift segment bits left.

SL_HAL_LCD_ANIMATION_SHIFT_RIGHT

Shift segment bits right.


sl_hal_lcd_animation_logic_t#

sl_hal_lcd_animation_logic_t

Animation Logic Control, how AReg and BReg should be combined.

Enumerator
SL_HAL_LCD_ANIMATION_LOGIC_AND

Use bitwise logic AND to mix animation register A (AREGA) and B (AREGB).

SL_HAL_LCD_ANIMATION_LOGIC_OR

Use bitwise logic OR to mix animation register A (AREGA) and B (AREGB).


sl_hal_lcd_animation_location_t#

sl_hal_lcd_animation_location_t

Animation Location, set the LCD segments which animation applies to.

Enumerator
SL_HAL_LCD_ANIMATION_LOCATION_SEG0_TO_7

Animation appears on segments 0 to 7.

SL_HAL_LCD_ANIMATION_LOCATION_SEG8_TO_15

Animation appears on segments 8 to 15.


sl_hal_lcd_charge_redistribution_t#

sl_hal_lcd_charge_redistribution_t

Charge redistribution control.

Enumerator
SL_HAL_LCD_CHARGE_REDISTRIBUTION_DISABLE

Disable charge redistribution.

SL_HAL_LCD_CHARGE_REDISTRIBUTION_ENABLE

Use 1 prescaled low frequency clock cycle for charge redistribution.

SL_HAL_LCD_CHARGE_REDISTRIBUTION_TWO_CYCLE

Use 2 prescaled low frequency clock cycle for charge redistribution.

SL_HAL_LCD_CHARGE_REDISTRIBUTION_THREE_CYCLE

Use 3 prescaled low frequency clock cycle for charge redistribution.

SL_HAL_LCD_CHARGE_REDISTRIBUTION_FOUR_CYCLE

Use 4 prescaled low frequency clock cycle for charge redistribution.


sl_hal_lcd_dma_mode_t#

sl_hal_lcd_dma_mode_t

DMA mode of operation.

Enumerator
SL_HAL_LCD_DMA_MODE_DISABLE

No DMA requests are generated.

SL_HAL_LCD_DMA_MODE_FRAME_COUNTER_EVENT

DMA request on frame counter event.

SL_HAL_LCD_DMA_MODE_DISPLAY_EVENT

DMA request on display counter event.


Function Documentation#

sl_hal_lcd_init#

void sl_hal_lcd_init (const sl_hal_lcd_init_t * init)

Initialize the Liquid Crystal Display (LCD) controller.

Parameters
TypeDirectionArgument NameDescription
const sl_hal_lcd_init_t *[in]init

A pointer to the initialization structure which configures the LCD controller.

Configures the LCD controller. You must enable it afterwards, potentially configuring Frame Control and interrupts first according to requirements.


sl_hal_lcd_init_frame_counter#

void sl_hal_lcd_init_frame_counter (const sl_hal_lcd_frame_counter_init_t * init)

Initialize the LCD Frame Counter.

Parameters
TypeDirectionArgument NameDescription
const sl_hal_lcd_frame_counter_init_t *[in]init

A pointer to the Frame Counter initialization structure.

Note

  • The LCD controller need to be disabled before running this function.


sl_hal_lcd_init_animation#

void sl_hal_lcd_init_animation (const sl_hal_lcd_animation_init_t * init)

Configure the LCD controller Animation feature.

Parameters
TypeDirectionArgument NameDescription
const sl_hal_lcd_animation_init_t *[in]init

A pointer to the LCD Animation initialization structure.


sl_hal_lcd_update_control#

void sl_hal_lcd_update_control (sl_hal_lcd_update_data_control_t method)

Configure Update Control.

Parameters
TypeDirectionArgument NameDescription
sl_hal_lcd_update_data_control_t[in]method

Configures the LCD update method.

Note

  • The LCD controller need to be disabled before running this function.


sl_hal_lcd_segment_enable#

void sl_hal_lcd_segment_enable (uint32_t segment_number)

Enables a given LCD segment line.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]segment_number

Segment line number.


sl_hal_lcd_segment_disable#

void sl_hal_lcd_segment_disable (uint32_t segment_number)

Disable a given LCD segment line.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]segment_number

Segment line number.


sl_hal_lcd_segment_set#

void sl_hal_lcd_segment_set (uint8_t com, int bit, bool enable)

Turn on or clear a segment.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]com

A COM line to change.

int[in]bit

A bit index indicating which field to change.

bool[in]enable

A boolean indicating whether to set or clear the segment.

Note

  • For the Series 2 Family, the maximum configuration is 4x20. For the Series 2 xG28, the maximum configuration is 8x24 or 4x28.


sl_hal_lcd_segment_set_low#

void sl_hal_lcd_segment_set_low (uint8_t com, uint32_t mask, uint32_t bits)

Update 0-31 lowest segments on a given COM-line in one operation according to the bit mask.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]com

Indicates a COM line to update.

uint32_t[in]mask

A bit mask for segments 0-31.

uint32_t[in]bits

A bit pattern for segments 0-31.


sl_hal_lcd_enable_com_line#

void sl_hal_lcd_enable_com_line (uint8_t com)

Enables a given LCD COM line.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]com

COM line number.


sl_hal_lcd_disable_com_line#

void sl_hal_lcd_disable_com_line (uint8_t com)

Disable a given LCD COM line.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]com

COM line number.


sl_hal_lcd_bias_set_segment#

void sl_hal_lcd_bias_set_segment (uint8_t segment_line, uint32_t bias_level)

Configure the bias level for a specific segment line for Direct Segment Control.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]segment_line

A segment line number.

uint32_t[in]bias_level

The bias configuration level. This value must be within the constraints defined by the LCD_DISPCTRL bias settings. For more information, see the applicable Reference Manual and data sheet.

Note

  • When DSC is active, each configuration takes up 4 bits in the corresponding Segment Registers (SEGDx/SEGDxH) which defines the bias level. For optimal use of this feature, the entire SEGD-registers should be set at once in an optimized routine. Therefore, this function shows how to correctly configure the bias levels and should be used with care.


sl_hal_lcd_bias_set_com#

void sl_hal_lcd_bias_set_com (uint8_t com_line, uint32_t bias_level)

Configure the bias level for a specific segment line.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]com_line

Max is LCD_COM_NUM, defined in device-specific headers.

uint32_t[in]bias_level

The bias configuration level. This value must be within the constraints defined by the LCD_DISPCTRL bias settings. For more information, see the appropriate Reference Manual and data sheet.

Note

  • When DSC is active, each configuration takes up 4 bits in the corresponding Segment Registers (AREGA/AREGB) which defines bias level. For optimal use of this feature, the entire register set should be set at once in a optimized routine. Therefore, this function shows how to correctly configure the bias levels and should be used with care.


sl_hal_lcd_wait_load_busy#

void sl_hal_lcd_wait_load_busy (void )

Wait for load synchronization completion.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • Doing any writes to HV registers will not go through and will cause a bus fault.


sl_hal_lcd_wait_ready#

void sl_hal_lcd_wait_ready (void )

Wait for the LCD to complete resetting or disabling procedure.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_enable#

void sl_hal_lcd_enable (void )

Enable LCD controller with current configuration.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_disable#

void sl_hal_lcd_disable (void )

Disable LCD controller.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function will disables LCD controller. Remember to enable CMU clock for LCD for correct operation.


sl_hal_lcd_reset#

void sl_hal_lcd_reset (void )

Reset the LCD.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_animation_enable#

void sl_hal_lcd_animation_enable (void )

Enable LCD Animation feature.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_animation_disable#

void sl_hal_lcd_animation_disable (void )

Disable LCD Animation feature.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_animation_get_state#

uint32_t sl_hal_lcd_animation_get_state (void )

Return the current animation state.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Animation state, in range 0-15.


sl_hal_lcd_blink_enable#

void sl_hal_lcd_blink_enable (void )

Enable the LCD blink.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_blink_disable#

void sl_hal_lcd_blink_disable (void )

Disable the LCD blink.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_blink_get_state#

uint32_t sl_hal_lcd_blink_get_state (void )

Return the current blink state.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Return value is 1 if segments are enabled, 0 if disabled.


sl_hal_lcd_enable_blank#

void sl_hal_lcd_enable_blank (void )

Clears all segments while keeping segment state.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_disable_blank#

void sl_hal_lcd_disable_blank (void )

Restores all segment lines.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_enable_frame_counter#

void sl_hal_lcd_enable_frame_counter (void )

Enable or disable LCD Frame counter.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_disable_frame_counter#

void sl_hal_lcd_disable_frame_counter (void )

Disable LCD Frame counter.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_enable_display_counter#

void sl_hal_lcd_enable_display_counter (void )

Enable the LCD Display counter.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_disable_display_counter#

void sl_hal_lcd_disable_display_counter (void )

Disable the LCD Display counter.

Parameters
TypeDirectionArgument NameDescription
voidN/A

sl_hal_lcd_start_sync#

void sl_hal_lcd_start_sync (bool auto_load, sl_hal_lcd_load_address_t load_addr)

Start the synchronization process.

Parameters
TypeDirectionArgument NameDescription
bool[in]auto_load

Flag indicating if the synchronization is started manually with CMD.LOAD (false) or if the synchronization is managed automatically by Auto Load (true).

sl_hal_lcd_load_address_t[in]load_addr

Address which will start the synchronization from CLK_BUS to CLK_PER when Auto Load is selected. This argument has no effect if 'autoload' is false.

Note

  • This function will disables LCD controller.


sl_hal_lcd_stop_sync#

void sl_hal_lcd_stop_sync (bool auto_load)

Stop the synchronization process.

Parameters
TypeDirectionArgument NameDescription
bool[in]auto_load

Flag indicating if the synchronization is stopped manually with CMD.CLEAR (false) or if the synchronization managed by Auto Load is disabled (true).


sl_hal_lcd_get_pending_interrupts#

uint32_t sl_hal_lcd_get_pending_interrupts (void )

Get pending LCD interrupt flags.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Pending LCD interrupt sources. Returns a set of interrupt flags OR-ed together for multiple interrupt sources in the LCD module (LCD_IFS_nnn).


sl_hal_lcd_get_enabled_pending_interrupts#

uint32_t sl_hal_lcd_get_enabled_pending_interrupts (void )

Get enabled and pending LCD interrupt flags.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Useful for handling more interrupt sources in the same interrupt handler.

Note

  • Event bits are not cleared by the use of this function.

Returns

  • Pending and enabled LCD interrupt sources. Return value is the bitwise AND combination of

    • the OR combination of enabled interrupt sources in LCD_IEN_nnn register (LCD_IEN_nnn) and

    • the bitwise OR combination of valid interrupt flags of LCD module (LCD_IF_nnn).


sl_hal_lcd_set_interrupts#

void sl_hal_lcd_set_interrupts (uint32_t flags)

Set one or more pending LCD interrupts from SW.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

LCD interrupt sources to set to pending. Use a set of interrupt flags OR-ed together to set multiple interrupt sources for the LCD module (LCD_IFS_nnn).


sl_hal_lcd_enable_interrupts#

void sl_hal_lcd_enable_interrupts (uint32_t flags)

Enable LCD interrupts.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

LCD interrupt sources to enable. Use a set of interrupt flags OR-ed together to set multiple interrupt sources for LCD module (LCD_IFS_nnn).


sl_hal_lcd_disable_interrupts#

void sl_hal_lcd_disable_interrupts (uint32_t flags)

Disable LCD interrupts.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

LCD interrupt sources to disable. Use a set of interrupt flags OR-ed together to disable multiple interrupt sources for LCD module (LCD_IFS_nnn).


sl_hal_lcd_clear_interrupts#

void sl_hal_lcd_clear_interrupts (uint32_t flags)

Clear one or more interrupt flags.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]flags

LCD interrupt sources to clear. Use a set of interrupt flags OR-ed together to clear multiple interrupt sources for LCD module (LCD_IFS_nnn).


sl_hal_lcd_enable_dsc#

void sl_hal_lcd_enable_dsc (void )

Enable LCD Direct Segment Control.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function will disable the LCD controller before writing to register.

  • LCD controller Direct Segment Control Segment and COM line bias levels need to be set explicitly with sl_hal_lcd_set_bias_segment() and sl_hal_lcd_set_bias_com() function calls respectively.


sl_hal_lcd_disable_dsc#

void sl_hal_lcd_disable_dsc (void )

Disable LCD Direct Segment Control.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Note

  • This function will disable the LCD controller before writing to register.


sl_hal_lcd_set_dma_mode#

void sl_hal_lcd_set_dma_mode (sl_hal_lcd_dma_mode_t mode)

Set a given DMA mode operation.

Parameters
TypeDirectionArgument NameDescription
sl_hal_lcd_dma_mode_t[in]mode

DMA mode.


sl_hal_lcd_bias_set#

void sl_hal_lcd_bias_set (sl_hal_lcd_bias_t bias)

Configure the bias level on the LCD panel.

Parameters
TypeDirectionArgument NameDescription
sl_hal_lcd_bias_t[in]bias

The bias level.


sl_hal_lcd_set_contrast#

void sl_hal_lcd_set_contrast (uint8_t level)

Configure the contrast level on the LCD panel.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]level

The contrast level in range 0-31.


sl_hal_lcd_set_charge_redistribution_cycle#

void sl_hal_lcd_set_charge_redistribution_cycle (uint8_t cycles)

Configure the charge redistribution cycles for the LCD panel.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]cycles

Charge redistribution cycles, range 0-4.

Note

  • The LCD controller need to be disabled before running this function.


sl_hal_lcd_set_mode#

void sl_hal_lcd_set_mode (sl_hal_lcd_mode_t mode)

Configure the mode for the LCD panel.

Parameters
TypeDirectionArgument NameDescription
sl_hal_lcd_mode_t[in]mode

A mode.