cy_seglcd_8h

Provides an API declaration of the Segment LCD driver.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Version

1.10

Copyright

Copyright 2019-2020 Cypress Semiconductor Corporation SPDX-License-Identifier: Apache-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Defines

CY_SEGLCD_DRV_VERSION_MAJOR

Driver major version.

CY_SEGLCD_DRV_VERSION_MINOR

Driver minor version.

CY_SEGLCD_ID

SegLCD driver ID.

CY_SEGLCD_NOT_CON

Specifies the pixel in the display pixel map array which is not connected.

CY_SEGLCD_PIXEL(segNum, comLine)

Makes the pixel identifier from the LCD segment terminal number and the user defined common line number.

It should be used to display pixel map (pixMap) array definitions for cy_stc_seglcd_disp_t.

CY_SEGLCD_COMMON(comNum, comLine)

Makes the common line identifier from the LCD common terminal number and the user defined common line number.

It should be used for commons array definitions for Cy_SegLCD_ClrFrame and Cy_SegLCD_InvFrame.

CY_SEGLCD_NUM_BLANK

Space/blank/empty symbol code for the numeric type of fonts.

CY_SEGLCD_14SEG_FONTMAP_SIZE

14-segment fontMap array item size (in bytes)

CY_SEGLCD_16SEG_FONTMAP_SIZE

16-segment fontMap array item size (in bytes)

CY_SEGLCD_5X8DM_FONTMAP_SIZE

5x8 dot matrix fontMap array item size (in bytes)

Enums

enum cy_en_seglcd_status_t

cy_en_seglcd_status_t: SegLCD driver error codes.

Values:

enumerator CY_SEGLCD_SUCCESS

Returned successful.

enumerator CY_SEGLCD_BAD_PARAM

A bad parameter was passed (display/font pointer is NULL, position is out of display area, etc.)

enumerator CY_SEGLCD_BAD_PIXEL

The specified pixel value is wrong or the pixel is specified as ‘not connected’ in the display pixMap array.

enumerator CY_SEGLCD_BAD_CHAR

The specified character (or at least one of characters in the specified string) is not supported by the specified font.

enumerator CY_SEGLCD_EXCEED

The string (length) or number (amount of dec/hex digits) exceeds the display limits.

enumerator CY_SEGLCD_CUSTOM

The display/font type is custom (not defined by the cy_en_seglcd_disp_t).

enum cy_en_seglcd_speed_t

cy_en_seglcd_speed_t: SegLCD block speed mode.

Values:

enumerator CY_SEGLCD_SPEED_LOW

Low Speed mode, works in Active, Sleep and DeepSleep power modes.

enumerator CY_SEGLCD_SPEED_HIGH

High Speed mode, works in Active and Sleep power modes.

enum cy_en_seglcd_lsclk_t

cy_en_seglcd_lsclk_t: SegLCD block low speed mode clock source selection.

Values:

enumerator CY_SEGLCD_LSCLK_LF

Low Frequency source, usually connected to ILO.

enumerator CY_SEGLCD_LSCLK_MF

Middle Frequency source, usually connected to CLK_MF, Medium Frequency Domain Clock.

enum cy_en_seglcd_wave_t

cy_en_seglcd_wave_t: SegLCD driving waveform type.

Values:

enumerator CY_SEGLCD_TYPE_A

Type A - Each frame addresses each COM pin only once with a balanced (DC=0) waveform.

enumerator CY_SEGLCD_TYPE_B

Type B - Each frame addresses each COM pin twice in a sequence with a positive and negative waveform that together are balanced (DC=0).

enum cy_en_seglcd_drive_t

cy_en_seglcd_drive_t: SegLCD driving mode configuration.

Values:

enumerator CY_SEGLCD_PWM

PWM mode.

enumerator CY_SEGLCD_CORRELATION

Digital Correlation mode.

enum cy_en_seglcd_bias_t

cy_en_seglcd_bias_t: SegLCD PWM bias selection.

Values:

enumerator CY_SEGLCD_BIAS_HALF

1/2 Bias.

enumerator CY_SEGLCD_BIAS_THIRD

1/3 Bias.

enumerator CY_SEGLCD_BIAS_FOURTH

1/4 Bias (not supported for CY_SEGLCD_SPEED_LOW mode in MXLCD_ver1).

enumerator CY_SEGLCD_BIAS_FIFTH

1/5 Bias (not supported for CY_SEGLCD_SPEED_LOW mode in MXLCD_ver1).

enum cy_en_seglcd_disp_t

cy_en_seglcd_disp_t: SegLCD segment display types.

Values:

enumerator CY_SEGLCD_BAR

Bar Graph / Dial display.

enumerator CY_SEGLCD_7SEG

Seven-segment display.

enumerator CY_SEGLCD_14SEG

Fourteen-segment display.

enumerator CY_SEGLCD_16SEG

Sixteen-segment display.

enumerator CY_SEGLCD_5X8DM

Five-by-eight dot matrix display.

Functions

cy_en_seglcd_status_t Cy_SegLCD_Init(LCD_Type *base, cy_stc_seglcd_config_t const *config)

Initializes/restores the default Segment LCD block configuration.

Side Effects: The block is disabled to change the settings.

Function Usage

/* Scenario: Enable an LCD block */

cy_stc_seglcd_config_t config =
{
    .speed = CY_SEGLCD_SPEED_HIGH,
    .wave = CY_SEGLCD_TYPE_B,
    .drive = CY_SEGLCD_PWM,
    .bias = CY_SEGLCD_BIAS_FOURTH,
    .lsClk = CY_SEGLCD_LSCLK_LF,
    .comNum = 8,
    .frRate = 70,
    .contrast = 70,
  /*.clkFreq is unknown here */
};

const uint32_t commons[8] =
{
    CY_SEGLCD_COMMON(LCD_COM_0, 0UL),
    CY_SEGLCD_COMMON(LCD_COM_1, 1UL),
    CY_SEGLCD_COMMON(LCD_COM_2, 2UL),
    CY_SEGLCD_COMMON(LCD_COM_3, 3UL),
    CY_SEGLCD_COMMON(LCD_COM_4, 4UL),
    CY_SEGLCD_COMMON(LCD_COM_5, 5UL),
    CY_SEGLCD_COMMON(LCD_COM_6, 6UL),
    CY_SEGLCD_COMMON(LCD_COM_7, 7UL)
};
    /* Then in executable code: */

    /* Get the frequency of the assigned peripheral clock divider */
    config.clkFreq  = Cy_SysClk_PeriphGetFrequency(CY_SYSCLK_DIV_8_BIT, 0U);

    if (CY_SEGLCD_SUCCESS == Cy_SegLCD_Init(LCD0, &config))
    {
        if (CY_SEGLCD_SUCCESS == Cy_SegLCD_ClrFrame(LCD0, commons))
        {
            Cy_SegLCD_Enable(LCD0);
            
           /* Now the block generates LCD signals (all the pixels are off) and is ready to turn on any pixel
            * (or many pixels) using any of the frame/pixel/character/display management API functions.
            */
        }
        else
        {
            /* error handling */
        }
    }
    else
    {
        /* error handling */
    }

Parameters
  • base – The base pointer to the LCD instance registers.

  • config – The pointer to a configuration structure.

Returns

cy_en_seglcd_status_t.

cy_en_seglcd_status_t Cy_SegLCD_Contrast(LCD_Type *base, uint32_t contrast, cy_stc_seglcd_config_t *config)

Sets a specified contrast.

Side Effects: The configuration structure contrast value is also updated.

Function Usage

    uint32_t contrast = 70UL; /* Contrast value from 0 to 100 */
    /* Scenario: Adjust the LCD contrast */
    if (CY_SEGLCD_SUCCESS != Cy_SegLCD_Contrast(LCD0, contrast, &config))
    {
        /* error handling */
    }

Parameters
  • base – The base pointer to the LCD instance registers.

  • contrast – The contrast value to be set.

  • config – The pointer to a configuration structure.

Returns

cy_en_seglcd_status_t.

void Cy_SegLCD_Deinit(LCD_Type *base)

De-initializes the LCD block (resets the block registers to default state).

Function Usage

    /* Scenario: Reset all the block registers to their default values */
    Cy_SegLCD_Deinit(LCD0);

Parameters

base – The base pointer to the LCD instance registers.

void Cy_SegLCD_Enable(LCD_Type *base)

Enables the Segment LCD block.

Function Usage

/* Scenario: Enable an LCD block */

cy_stc_seglcd_config_t config =
{
    .speed = CY_SEGLCD_SPEED_HIGH,
    .wave = CY_SEGLCD_TYPE_B,
    .drive = CY_SEGLCD_PWM,
    .bias = CY_SEGLCD_BIAS_FOURTH,
    .lsClk = CY_SEGLCD_LSCLK_LF,
    .comNum = 8,
    .frRate = 70,
    .contrast = 70,
  /*.clkFreq is unknown here */
};

const uint32_t commons[8] =
{
    CY_SEGLCD_COMMON(LCD_COM_0, 0UL),
    CY_SEGLCD_COMMON(LCD_COM_1, 1UL),
    CY_SEGLCD_COMMON(LCD_COM_2, 2UL),
    CY_SEGLCD_COMMON(LCD_COM_3, 3UL),
    CY_SEGLCD_COMMON(LCD_COM_4, 4UL),
    CY_SEGLCD_COMMON(LCD_COM_5, 5UL),
    CY_SEGLCD_COMMON(LCD_COM_6, 6UL),
    CY_SEGLCD_COMMON(LCD_COM_7, 7UL)
};
    /* Then in executable code: */

    /* Get the frequency of the assigned peripheral clock divider */
    config.clkFreq  = Cy_SysClk_PeriphGetFrequency(CY_SYSCLK_DIV_8_BIT, 0U);

    if (CY_SEGLCD_SUCCESS == Cy_SegLCD_Init(LCD0, &config))
    {
        if (CY_SEGLCD_SUCCESS == Cy_SegLCD_ClrFrame(LCD0, commons))
        {
            Cy_SegLCD_Enable(LCD0);
            
           /* Now the block generates LCD signals (all the pixels are off) and is ready to turn on any pixel
            * (or many pixels) using any of the frame/pixel/character/display management API functions.
            */
        }
        else
        {
            /* error handling */
        }
    }
    else
    {
        /* error handling */
    }

Parameters

base – The base pointer to the LCD instance registers.

void Cy_SegLCD_Disable(LCD_Type *base)

Disables the Segment LCD block.

Function Usage

    /* Scenario: Stop the LCD signal generation */
    Cy_SegLCD_Disable(LCD0);

Parameters

base – The base pointer to the LCD instance registers.

cy_en_seglcd_status_t Cy_SegLCD_WriteChar(LCD_Type *base, char_t character, uint32_t position, cy_stc_seglcd_disp_t const *display)

Writes a specified character onto a specified display.

Supports all display types except CY_SEGLCD_BAR.

Function Usage

        /* Scenario: Write characters so that there the word 'char' is created */
        /* Set up the custom alphanumerical font for 7-segment display */
        display.font = &customAsciiFont7Seg; /* Set up the alphanumerical font */
        (void) Cy_SegLCD_WriteChar(LCD0, 'c', 0, &display);
        (void) Cy_SegLCD_WriteChar(LCD0, 'h', 1, &display);
        (void) Cy_SegLCD_WriteChar(LCD0, 'a', 2, &display);
        (void) Cy_SegLCD_WriteChar(LCD0, 'r', 3, &display);

Parameters
Returns

cy_en_seglcd_status_t.

cy_en_seglcd_status_t Cy_SegLCD_WriteString(LCD_Type *base, char_t const *string, uint32_t position, cy_stc_seglcd_disp_t const *display)

Writes a specified zero-terminated char string onto a specified display.

Supports all display types except CY_SEGLCD_BAR.

Function Usage

        /* Scenario: Write a string starting at the most left symbol on display */
        char_t * string = "Font";
        /* Set up the custom alphanumerical font for 7-segment display */
        display.font = &customAsciiFont7Seg;
        if (CY_SEGLCD_SUCCESS != Cy_SegLCD_WriteString(LCD0, string, 0, &display))
        {
            /* error handling */
        }

Parameters
  • base – The base pointer to the LCD instance registers.

  • string – The pointer to the ASCII-coded null-terminated character string.

  • position – The position of the first string character at the display as counted left to right starting at 0 - the first symbol on the left of the specified display. If the specified display contains fewer symbols than the string requires to be displayed, the extra character(s) is(are) not displayed and the CY_SEGLCD_EXCEED value is returned.

  • display – The pointer to the display structure cy_stc_seglcd_disp_t.

Returns

cy_en_seglcd_status_t.

cy_en_seglcd_status_t Cy_SegLCD_WriteNumber(LCD_Type *base, uint32_t value, uint32_t position, cy_stc_seglcd_disp_t const *display, bool zeroes, bool hex)

Displays an integer value onto a specified display.

Supports all display types except CY_SEGLCD_BAR.

note

The sign conversion, sign display, decimal points, and other special segments outside the display symbols themselves should be handled on upper layer code.

Function Usage

        /* Scenario: Write a decimal number starting at the most right symbol on display: */
        if (CY_SEGLCD_SUCCESS != Cy_SegLCD_WriteNumber(LCD0, 12, 3, &display, false, false))
        {
            /* error handling */
        }
        /* Scenario: Write a hexadecimal number with trailing zeroes: */
        if (CY_SEGLCD_SUCCESS != Cy_SegLCD_WriteNumber(LCD0, 12, 3, &display, true, true))
        {
            /* error handling */
        }

Parameters
  • base – The base pointer to the LCD instance registers.

  • value – The unsigned integer number to be displayed.

  • position – The position of the least significant digit of the number as counted left to right starting at 0 - the first symbol on the left of the specified display. If the specified display contains fewer symbols than the number requires to be displayed, the extra (more significant) digit(s) is(are) not displayed and the CY_SEGLCD_EXCEED value is returned.

  • display – The pointer to the display structure cy_stc_seglcd_disp_t.

  • zeroes

    • true - all the unused digits on the left of the displayed value are zeroes.

    • false - all the above mentioned digits are blank.

  • hex

    • true - the value is displayed in the hexadecimal format.

    • false - the value is displayed in the decimal format.

Returns

cy_en_seglcd_status_t.

cy_en_seglcd_status_t Cy_SegLCD_BarGraph(LCD_Type *base, uint32_t value, uint32_t position, cy_stc_seglcd_disp_t const *display)

Draws a bar onto a specified bar graph / dial display.

Only the CY_SEGLCD_BAR display type is supported.

Function Usage

#define BAR_LENGTH (4)
const uint32_t barGraphPixMap[BAR_LENGTH] =
{
    CY_SEGLCD_PIXEL(LCD_SEG_6,  7UL),
    CY_SEGLCD_PIXEL(LCD_SEG_5,  7UL),
    CY_SEGLCD_PIXEL(LCD_SEG_4,  7UL),
    CY_SEGLCD_PIXEL(LCD_SEG_2,  7UL)
};

const cy_stc_seglcd_disp_t barGraph =
{
    .type   = CY_SEGLCD_BAR,
    .symNum = BAR_LENGTH,
    .invert = false,
    .pixMap = (uint32_t*)barGraphPixMap,
    .font   = NULL
};
    uint32_t barGraphValue = 3UL; /* the value from 0 to barGraph.symNum */
    /* Scenario: Write a bar graph starting from the first pixel of the barGraph display */
    if (CY_SEGLCD_SUCCESS != Cy_SegLCD_BarGraph(LCD0, barGraphValue, 0UL, &barGraph))
    {
        /* error handling */
    }

Parameters
  • base – The base pointer to the LCD instance registers.

  • value – The length of the bar in pixels.

  • position – The position of the first bar pixel as counted from the beginning (‘0’ is the first pixel) of the specified display. If the specified display contains fewer pixels than the bar requires to be displayed, the extra pixel(s) is(are) not displayed and the CY_SEGLCD_EXCEED value is returned.

  • display – The pointer to the display structure cy_stc_seglcd_disp_t.

Returns

cy_en_seglcd_status_t.

cy_en_seglcd_status_t Cy_SegLCD_ClrFrame(LCD_Type *base, uint32_t const *commons)

Clears the frame buffer and initiates the common lines.

In general case it is recommended to be called after Cy_SegLCD_Init and before Cy_SegLCD_Enable.

Function Usage

/* Scenario: Enable an LCD block */

cy_stc_seglcd_config_t config =
{
    .speed = CY_SEGLCD_SPEED_HIGH,
    .wave = CY_SEGLCD_TYPE_B,
    .drive = CY_SEGLCD_PWM,
    .bias = CY_SEGLCD_BIAS_FOURTH,
    .lsClk = CY_SEGLCD_LSCLK_LF,
    .comNum = 8,
    .frRate = 70,
    .contrast = 70,
  /*.clkFreq is unknown here */
};

const uint32_t commons[8] =
{
    CY_SEGLCD_COMMON(LCD_COM_0, 0UL),
    CY_SEGLCD_COMMON(LCD_COM_1, 1UL),
    CY_SEGLCD_COMMON(LCD_COM_2, 2UL),
    CY_SEGLCD_COMMON(LCD_COM_3, 3UL),
    CY_SEGLCD_COMMON(LCD_COM_4, 4UL),
    CY_SEGLCD_COMMON(LCD_COM_5, 5UL),
    CY_SEGLCD_COMMON(LCD_COM_6, 6UL),
    CY_SEGLCD_COMMON(LCD_COM_7, 7UL)
};
    /* Then in executable code: */

    /* Get the frequency of the assigned peripheral clock divider */
    config.clkFreq  = Cy_SysClk_PeriphGetFrequency(CY_SYSCLK_DIV_8_BIT, 0U);

    if (CY_SEGLCD_SUCCESS == Cy_SegLCD_Init(LCD0, &config))
    {
        if (CY_SEGLCD_SUCCESS == Cy_SegLCD_ClrFrame(LCD0, commons))
        {
            Cy_SegLCD_Enable(LCD0);
            
           /* Now the block generates LCD signals (all the pixels are off) and is ready to turn on any pixel
            * (or many pixels) using any of the frame/pixel/character/display management API functions.
            */
        }
        else
        {
            /* error handling */
        }
    }
    else
    {
        /* error handling */
    }

Parameters
  • base – The base pointer to the LCD instance registers.

  • commons – The pointer to array of common lines. The array size is specified by cy_stc_seglcd_config_t::comNum. Each common line value should be made using CY_SEGLCD_COMMON macro.

Returns

cy_en_seglcd_status_t.

cy_en_seglcd_status_t Cy_SegLCD_InvFrame(LCD_Type *base, uint32_t const *commons)

Inverts the frame buffer (all the connected pixel states are inverted).

Function Usage

    /* Scenario: Toggle the state of each pixel to opposite: */
    if (CY_SEGLCD_SUCCESS != Cy_SegLCD_InvFrame(LCD0, commons))
    {
        /* error handling */
    }
    /* Now all the pixels are inverted statically, however the display/character
     * management API functions will remain to write symbols non-inverted
     * until the correspondent display property is also inverted:
     */
    display.invert = !display.invert;

Parameters
  • base – The base pointer to the LCD instance registers.

  • commons – The pointer to an array of common lines. The array size is specified by cy_stc_seglcd_config_t::comNum. Each common line value should be made using CY_SEGLCD_COMMON macro.

Returns

cy_en_seglcd_status_t.

cy_en_seglcd_status_t Cy_SegLCD_WritePixel(LCD_Type *base, uint32_t pixel, bool value)

Sets or clears a specified pixel.

Function Usage

/* Scenario: There is a heart-shaped sign on an LCD glass: */
#define HEART (CY_SEGLCD_PIXEL(LCD_P11_6, 7UL)) /* Seg: P11_6, Com: 7 */
    /* Scenario: Read a pixel value, do some action with it and write it back into the frame */
    bool pixelValue = Cy_SegLCD_ReadPixel(LCD0, HEART);
    Cy_SegLCD_WritePixel(LCD0, HEART, !pixelValue);

Parameters
  • base – The base pointer to the LCD instance registers.

  • pixel – The predefined packed number that points to the pixel location in the frame buffer.

  • value – Specifies the pixel on/off state.

Returns

cy_en_seglcd_status_t.

bool Cy_SegLCD_ReadPixel(LCD_Type *base, uint32_t pixel)

Gets the state of a specified pixel.

Function Usage

/* Scenario: There is a heart-shaped sign on an LCD glass: */
#define HEART (CY_SEGLCD_PIXEL(LCD_P11_6, 7UL)) /* Seg: P11_6, Com: 7 */
    /* Scenario: Read a pixel value, do some action with it and write it back into the frame */
    bool pixelValue = Cy_SegLCD_ReadPixel(LCD0, HEART);
    Cy_SegLCD_WritePixel(LCD0, HEART, !pixelValue);

Parameters
  • base – The base pointer to the LCD instance registers.

  • pixel – The predefined packed number that points to the pixel location in the frame buffer. Each pixel value should be made using CY_SEGLCD_PIXEL macro.

Returns

Boolean pixel state. If pixel value is invalid - the ‘false’ is returned.

__STATIC_INLINE cy_en_seglcd_status_t Cy_SegLCD_SetPixel (LCD_Type *base, uint32_t pixel)

Sets (turns on) the specified pixel.

Function Usage

/* Scenario: There is a heart-shaped sign on an LCD glass: */
#define HEART (CY_SEGLCD_PIXEL(LCD_P11_6, 7UL)) /* Seg: P11_6, Com: 7 */
    /* Scenario: Set a pixel (write a true value) */
    if (CY_SEGLCD_SUCCESS != Cy_SegLCD_SetPixel(LCD0, HEART))
    {
        /* error handling */
    }

Parameters
  • base – The base pointer to the LCD instance registers.

  • pixel – The predefined packed number that points to the pixel location in the frame buffer.

Returns

cy_en_seglcd_status_t.

__STATIC_INLINE cy_en_seglcd_status_t Cy_SegLCD_ClrPixel (LCD_Type *base, uint32_t pixel)

Clears (turns off) the specified pixel.

Function Usage

/* Scenario: There is a heart-shaped sign on an LCD glass: */
#define HEART (CY_SEGLCD_PIXEL(LCD_P11_6, 7UL)) /* Seg: P11_6, Com: 7 */
    /* Scenario: Clear a pixel (write a false value) */
    if (CY_SEGLCD_SUCCESS != Cy_SegLCD_ClrPixel(LCD0, HEART))
    {
        /* error handling */
    }

Parameters
  • base – The base pointer to the LCD instance registers.

  • pixel – The predefined packed number that points to the pixel location in the frame buffer.

Returns

cy_en_seglcd_status_t.

__STATIC_INLINE cy_en_seglcd_status_t Cy_SegLCD_InvPixel (LCD_Type *base, uint32_t pixel)

Inverts the state of the specified pixel.

Function Usage

/* Scenario: There is a heart-shaped sign on an LCD glass: */
#define HEART (CY_SEGLCD_PIXEL(LCD_P11_6, 7UL)) /* Seg: P11_6, Com: 7 */
    /* Scenario: Invert a pixel (change the value to opposite) */
    Cy_SegLCD_InvPixel(LCD0, HEART);

Parameters
  • base – The base pointer to the LCD instance registers.

  • pixel – The predefined packed number that points to the pixel location in the frame buffer.

Returns

cy_en_seglcd_status_t.

Variables

const cy_stc_seglcd_font_t cy_segLCD_7SegFont

Basic 7-segment font.

const cy_stc_seglcd_font_t cy_segLCD_14SegFont

Basic 14-segment font.

const cy_stc_seglcd_font_t cy_segLCD_16SegFont

Basic 16-segment font.

const cy_stc_seglcd_font_t cy_segLCD_5x8DmFont

Basic 5x8 dot matrix font.

struct cy_stc_seglcd_config_t
#include <>

Configuration structure.

Public Members

cy_en_seglcd_speed_t speed

Speed mode selection, see: cy_en_seglcd_speed_t.

cy_en_seglcd_wave_t wave

Waveform type configuration, see: cy_en_seglcd_wave_t.

cy_en_seglcd_drive_t drive

Driving mode configuration, see: cy_en_seglcd_drive_t.

cy_en_seglcd_bias_t bias

PWM bias selection, see: cy_en_seglcd_bias_t.

cy_en_seglcd_lsclk_t lsClk

Low Speed Mode clock selection, see: cy_en_seglcd_lsclk_t.

This is effective for MXLCD_ver2, for MXLCD_ver1 it is ignored.

uint8_t comNum

The number of Common connections, the valid range is 2…16 however the maximum is dependent on PSoC device family - there could be limitation to 4 or 8 commons, see the device TRM.

uint8_t frRate

The LCD frame rate, the valid range is 30…150.

uint8_t contrast

The LCD contrast, the valid range is 0…100.

uint32_t clkFreq

The LCD clock frequency (ignored for CY_SEGLCD_LSCLK_LF mode, or in CY_SEGLCD_SPEED_LOW mode for MXLCD_ver1), the valid range is 10000…100000000 (Hz)

struct cy_stc_seglcd_font_t
#include <>

Font structure.

Public Members

char_t first

The first character code in the fontMap array.

char_t last

The last character code in the fontMap array.

bool ascii

Specifies whether the font map is indexed accordingly to ASCII character codes: true - the font is ASCII-coded alphanumeric (e.g.

a basic set “space” (ASCII 0x20) - “tilde”(ASCII 0x7E)); false - the font is e.g. pure numeric (0x0…0xF only), or any other custom character set.

uint8_t const *fontMap

The pointer to the font segment/pixel map array.

struct cy_stc_seglcd_disp_t
#include <>

Display structure.

Public Members

uint16_t type

The display type, one of cy_en_seglcd_disp_t or custom.

uint16_t symNum

The number of symbols (digits, characters).

bool invert

Specifies whether the display is inverted or not.

uint32_t const *pixMap

The pointer to the display pixel map array: The array dimension is: uint32_t pixMap[symNum][type].

Each array item should be made using the CY_SEGLCD_PIXEL macro.

cy_stc_seglcd_font_t const *font

The pointer to the font structure suitable for this display.

Note that for the CY_SEGLCD_BAR displays font is not used, so can be NULL.