Component - Static Segment LCD (LCD_SegStatic) V2.20 Datasheet.pdf

®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
2.20
Features
 1 to 61 pixels or symbols
 10- to 150-Hz refresh rate
 User-defined pixel or symbol map with optional 7-segment,
14-segment, 16-segment, and bar graph calculation routines

Direct drive static (one common) LCDs
General Description
The Static Segment LCD (LCD_SegStatic) component can directly drive 3.3-V and 5.0-V LCD
glass. This component provides an easy method of configuring the PSoC device for your custom
or standard glass.
Each LCD pixel/symbol may be either on or off. The Static Segment LCD component also
provides advanced support to simplify the following types of display structures within the glass:




7-Segment numeral
14-Segment alphanumeric
16-Segment alphanumeric
1- to 255-element bar graph
When to Use a Static Segment LCD
Use the Static Segment Drive LCD component when you need to directly drive 3.3-V or 5.0-V
LCD glass in a static mode (for glass configurations that have only one common line). The Static
Segment LCD component does not require the target PSoC device to provide LCD drive
hardware resources. The component can be used on any target chip that has sufficient pins to
support the required number of common and segment lines.
Input/Output Connections
There are no visible connections for the component on the schematic canvas; however, the
various signals can be connected to pins using the Design-Wide Resources Pin Editor.
Cypress Semiconductor Corporation • 198 Champion Court • San Jose, CA 95134-1709 • 408-943-2600
Document Number: 001-85172 Rev. **
Revised December 7, 2012
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
Component Parameters
Drag a Static Segment LCD component onto your design and double-click it to open the
Configure dialog.
Basic Configuration Tab
Number of segment lines
Defines the number of segment lines in the user-defined display. The default is 4.
Frame rate, Hz
Determines the refresh rate of the display. Possible values are 10 Hz to 150 Hz. The default is
30 Hz.
Enable Ganging Commons
Select this check box to gang PSoC pins to drive common signal. If enabled then two PSoC pin
will be allocated common signal. This is used to drive larger displays.
Page 2 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
Display Helpers Tab
Display Helpers allow you to configure a group of display segments to be used together as one
of several predefined display element types:


7-, 14-, or 16-segment displays
Linear or circular bar graph display
The character-based display helpers can be used to combine multiple display symbols to create
multicharacter display elements.
Document Number: 001-85172 Rev. **
Page 3 of 26
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
Helpers / Selected Helpers
You may add one or more helpers to the Selected Helpers list by selecting the desired helper
type in the Helpers list and clicking the right-arrow button. If there are not enough pins to support
the new helper, it will not be added. To delete a helper, select it in the Selected Helpers list and
click the left-arrow button.
The order in which the selected helpers appear in the list is significant. By default, the first Helper
of a given type added to the Selected Helper list is named with a 0 suffix, the next one of the
same type will have a suffix of 1, and so on. If a selected helper is removed from the list, the
remaining helpers are not renamed. When a helper is added, the name will use the lowest
available suffix.
APIs are provided for each helper. Refer to the Application Programming Interface section for
more information.

7 Segment Helper – This helper may be one to five digits in length and can display either
hexadecimal digits 0 to F or decimal 16-bit unsigned integer (uint16) values. A decimal point
is not supported by the helper functions.

14 Segment Helper – This helper may be up to 20 characters in length. It may display a
single ASCII character or a null terminated string. Possible values are standard ASCII
printable characters (with codes from 0 to 127).

16 Segment Helper – This helper may be up to 20 characters in length. It may display a
single ASCII character or a complete null terminated string. Possible values are standard
ASCII characters and table of extended codes (with codes from 0 to 255). A table of
extended codes is not supplied.

Bargraph and Dial Helper – These helpers are used for bar graphs and dial indicators with 1
to 255 segments. The bar graph may be a single selected pixel or the selected pixel and all
the pixels to the left or right of the specified pixel
Page 4 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
Helper function configuration
This section of the dialog allows you to configure a helper; this includes adding or removing
symbols to or from a helper as well as naming the pixels.
Select a helper from the Selected Helpers list.
Click the [+] or [x] button to add or remove a symbol for the selected helper. The maximum
number of symbols you may add depends on the helper type and the total number of pixels
supported by the component. If the number of available pins is not sufficient to support a new
symbol, it will not be added.
To rename a pixel that is a part of a helper function, select the pixel on the symbol image in the
Helper function configuration display. The current name displays in the selected pixel name
field and it can be modified as desired.
Pixel Naming
The default pixel names have the form “PIX#”, where “#” is the number of the pixel in incremental
order starting from the upper right corner of the Pixel Mapping Table.
The default naming for pixels associated with a helper symbol have a different format. The
default name consists of a prefix portion, common to all of the pixels in a symbol, and a unique
segment identifier. The default prefix indicates the helper type and the symbol instance. For
example, the default name of a pixel in one of the symbols in a 7 Segment display helper might
be “H7SEG4_A” where:
H7
Indicates the pixel is part of a 7 Segment helper
SEG4
Indicates the pixel is part of the symbol designated as the fourth 7-segment
symbol in the project
A
Identifies the unique segment within the 7-segment symbol
For default pixel names, only the unique portion of the pixel name is shown on the symbol
image. If you modify the pixel name, then the entire name is shown on the symbol image even if
it has a prefix in common.
Note All pixel names must be unique.
When a helper function symbol element is assigned to a pixel in the Pixel Mapping Table
(described below), the pixel assumes the name of the helper symbol element. The helper symbol
element name supersedes the default pixel name, but does not replace it. You cannot re use the
default pixel name of pixels that are associated with a helper function.
Document Number: 001-85172 Rev. **
Page 5 of 26
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
Character Encoding
All high-level helper APIs have their own lookup tables. The tables include a set of encoded pixel
states, which construct a specific character reflection. The following examples show how the
specific character can be encoded (segment names may be different than shown in the
customizer).
7 Segment Encoding
14 Segment Encoding
16 Segment Encoding
Pixel Mapping Table
The Pixel Mapping Table is a representation of the frame buffer. For the API functions to work
properly, each pixel from the Helper function configuration must be assigned to a pixel
location in the Pixel Mapping Table. Refer to the datasheet for your LCD glass for the
information you will need to make the correct assignments.
To assign pixels, select the desired pixel in the Helper function configuration panel and drag it
to the correct location in the Pixel Mapping Table.
You can rename a pixel in the Pixel Mapping Table by double clicking on the pixel in the table
display and entering the desired name. You can use this method to name a pixel that is not
associated with one of the available helper types.
The Print button prints the pixel mapping table.
Clock Selection
The Static Segment LCD component uses one internal clock and does not require an external
clock. Once the component is placed, the clock is automatically dedicated to the LCD
component. The clock generates frame rate frequency.
Page 6 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Application Programming Interface
Application Programming Interface (API) routines allow you to configure the component using
software. The following table lists and describes the interface to each function. The subsequent
sections cover each function in more detail.
By default, PSoC Creator assigns the instance name “LCD_SegStatic_1” to the first instance of a
component in a given design. You can rename the instance to any unique value that follows the
syntactic rules for identifiers. The instance name becomes the prefix of every global function
name, variable, and constant symbol. For readability, the instance name used in the following
table is “LCD_SegStatic.”
Function
Description
LCD_SegStatic_Start()
Starts the LCD component and DMA channels. Initializes the frame buffer.
Does not clear the frame buffer RAM if it was previously defined.
LCD_SegStatic_Stop()
Disables the LCD component and associated interrupts and DMA channels.
Does not clear the frame buffer.
LCD_SegStatic_EnableInt()
Enables the LCD interrupts. Not required if LCD_SegStatic_Start() is called.
LCD_SegStatic_DisableInt()
Disables the LCD interrupt. Not required if LCD_SegStatic_Stop() is called.
LCD_SegStatic_ClearDisplay()
Clears the display RAM of the frame buffer.
LCD_SegStatic_WritePixel()
Sets or clears a pixel based on PixelState. The pixel is addressed by a
packed number.
LCD_SegStatic_ReadPixel()
Reads the state of a pixel in the frame buffer. The pixel is addressed by a
packed number.
LCD_SegStatic_WriteInvertState() Inverts the display based on an input parameter.
LCD_SegStatic_ReadInvertState(
)
Returns the current value of the display invert state: normal or inverted.
LCD_SegStatic_Sleep()
Stops the LCD and saves the user configuration.
LCD_SegStatic_Wakeup()
Restores and enables the user configuration.
LCD_SegStatic_Init()
Configures every-frame interrupt and initializes the frame buffer.
LCD_SegStatic_Enable()
Enables clock generation for the component.
LCD_SegStatic_SaveConfig()
Saves the LCD configuration.
LCD_SegStatic_RestoreConfig()
Restores the LCD configuration.
Note: Function names that contain a suffix “n” indicate that multiple display helpers of the same
symbol type were created in the component customizer. Specific display helper elements are
controlled by the API functions with the respective “n” index value in the function name.
Cypress Semiconductor Corporation • 198 Champion Court • San Jose, CA 95134-1709 • 408-943-2600
Document Number: 001-85172 Rev. **
Revised December 7, 2012
®
Static Segment LCD (LCD_SegStatic)
PSoC Creator™ Component Datasheet
Global Variables
Variable
LCD_SegStatic_initV
ar
Description
Indicates whether the LCD_SegStatic has been initialized. The variable is initialized to 0
and set to 1 the first time LCD_SegStatic_Start() is called. This allows the component to
restart without reinitialization after the first call to the LCD_SegStatic_Start() routine.
If reinitialization of the component is required, then the LCD_SegStatic_Init() function can
be called before the LCD_SegStatic_Start() or LCD_SegStatic_Enable() function.
uint8 LCD_SegStatic_Start(void)
Description:
Starts the LCD component, DMA channels, frame buffer, and hardware. Does not clear
the frame buffer RAM.
Parameters:
None
Return Value:
uint8 cystatus: Standard API return values.
Return Value
Side Effects:
Description
CYRET_BAD_PARAM
One or more function parameters were invalid
CYRET_SUCCESS
Function completed successfully
None
void LCD_SegStatic_Stop(void)
Description:
Disables the LCD component and associated interrupts and DMA channels. Automatically
blanks the display to avoid damage from DC offsets. Does not clear the frame buffer.
Parameters:
None
Return Value:
None
Side Effects:
None
void LCD_SegStatic_EnableInt(void)
Description:
Enables the LCD interrupts. Not required if LCD_SegStatic_Start() is called. An interrupt
occurs after every LCD update (TD completion).
Parameters:
None
Return Value:
None
Side Effects:
None
Page 8 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
void LCD_SegStatic_DisableInt(void)
Description:
Disables the LCD interrupts. Not required if LCD_SegStatic_Stop() is called.
Parameters:
None
Return Value:
None
Side Effects:
None
void LCD_SegStatic_ClearDisplay(void)
Description:
This function clears the display RAM of the page buffer.
Parameters:
None
Return Value:
None
Side Effects:
None
uint8 LCD_SegStatic_WritePixel(uint16 PixelNumber, uint8 PixelState)
Description:
This function sets or clears a pixel in the frame buffer based on the PixelState parameter.
The pixel is addressed with a packed number.
Parameters:
uint16 PixelNumber: The packed number that points to the pixel’s location in the frame
buffer. The lowest three bits in the LSB low nibble are the bit position in the byte, the LSB
upper nibble (four bits) is the byte address in the multiplex row and the MSB low nibble
(four bits) is the multiplex row number.
uint8 PixelState: The PixelNumber specified is set to this pixel state. Symbolic names for
the pixel state are provided, and their associated values are shown here:
Value
Return Value:
LCD_SegStatic_PIXEL_STATE_OFF
Set the pixel to off.
LCD_SegStatic_PIXEL_STATE_ON
Set the pixel to on.
LCD_SegStatic_PIXEL_STATE_INVERT
Invert the pixel’s current state.
uint8 Status: Pass or fail based on a range check of the byte address and multiplex row
number. No check is performed on bit position.
Return Value
Side Effects:
Description
Description
CYRET_BAD_PARAM
Packed byte address or row value was invalid
CYRET_SUCCESS
Function completed successfully
None
Document Number: 001-85172 Rev. **
Page 9 of 26
®
Static Segment LCD (LCD_SegStatic)
PSoC Creator™ Component Datasheet
uint8 LCD_SegStatic_ReadPixel(uint16 PixelNumber)
Description:
This function reads a pixel’s state in the frame buffer. The pixel is addressed by a packed
number.
Parameters:
uint16: PixelNumber: The packed number that points to the pixel’s location in the frame
buffer. The lowest three bits in the LSB low nibble are the bit position in the byte, the LSB
upper nibble (four bits) is the byte address in the multiplex row and the MSB low nibble
(four bits) is the multiplex row number.
Return Value:
uint8 PixelState: Returns the current status of the PixelNumber specified.
Value
Side Effects:
Description
0
The pixel is off.
1
The pixel is on.
None
uint8 LCD_Seg_WriteInvertState(uint8 invertState)
Description:
This function inverts the display based on an input parameter.
Parameters:
uint8 invertState: Sets the invert state of the display.
Value
Description
LCD_SegStatic_NORMAL_STATE
Normal noninverted display.
LCD_SegStatic_INVERTED_STATE Inverted display.
Return Value:
uint8 cystatus: Standard API return values.
Value
Side Effects:
Page 10 of 26
Description
CYRET_SUCCESS
Function completed successfully.
CYRET_BAD_PARAM
Evaluation of invertState parameter is failed.
None
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
uint8 LCD_Seg_ReadInvertState(void)
Description:
This function returns the current value of the display invert state: normal or inverted.
Parameters:
None
Return Value:
(uint8) invertState: The invert state of the display.
Value
LCD_SegStatic_NORMAL_STATE
Description
Normal noninverted display.
LCD_SegStatic_INVERTED_STATE Inverted display.
Side Effects:
None
void LCD_SegStatic_Init(void)
Description:
Initializes or restores the component according to the customizer Configure dialog
settings. It is not necessary to call LCD_SegStatic_Init() because the
LCD_SegStatic_Start() routine calls this function and is the preferred method to begin
component operation. Configures every frame interrupt and initializes the frame buffer.
Parameters:
None
Return Value:
None
Side Effects:
None
Document Number: 001-85172 Rev. **
Page 11 of 26
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
void LCD_SegStatic_Enable(void)
Description:
Enables clock generation for the component.
Parameters:
None
Return Value:
None
Side Effects:
None
Note The following four APIs are not supported on PSoC 5.
void LCD_SegStatic_Sleep(void)
Description:
This is the preferred routine to prepare the component for sleep. The
LCD_SegStatic_Sleep() routine saves the current component state. Then it calls the
LCD_SegStatic_Stop() function and calls LCD_SegStatic_SaveConfig() to save the
hardware configuration.
Call the LCD_SegStatic_Sleep() function before calling the CyPmSleep() or the
CyPmHibernate() function. Refer to the PSoC Creator System Reference Guide for more
information about power management functions.
Parameters:
None
Return Value:
None
Side Effects:
Don’t change component pin drive modes.
void LCD_SegStatic_Wakeup(void)
Description:
This is the preferred routine to restore the component to the state when
LCD_SegStatic_Sleep() was called. The LCD_SegStatic_Wakeup() function calls the
LCD_SegStatic_RestoreConfig() function to restore the configuration. If the component
was enabled before the LCD_SegStatic_Sleep() function was called, the
LCD_SegStatic_Wakeup() function will also re-enable the component.
Parameters:
None
Return Value:
None
Side Effects:
Calling the LCD_SegStatic_Wakeup() function without first calling the
LCD_SegStatic_Sleep() or LCD_SegStatic_SaveConfig() function may produce
unexpected behavior.
Page 12 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
void LCD_SegStatic_SaveConfig(void)
Description:
This function saves the component configuration and nonretention registers. It also saves
the current component parameter values, as defined in the Configure dialog or as
modified by appropriate APIs. This function is called by the LCD_SegStatic_Sleep()
function.
Parameters:
None
Return Value:
None
Side Effects:
None
void LCD_SegStatic_RestoreConfig(void)
Description:
This function restores the component configuration and nonretention registers. It also
restores the component parameter values to what they were before calling the
LCD_SegStatic_Sleep() function.
Parameters:
None
Return
Value:
None
Side
Effects:
Calling the LCD_SegStatic_RestoreConfig() function without first calling the
LCD_SegStatic_Sleep() or LCD_SegStatic_SaveConfig() function may produce unexpected
behavior.
Optional Helper APIs
The following APIs are present only when the respective helper has been selected in the
Configure dialog.
Function
LCD_SegStatic_Write7SegDigit_n
Description
Displays a hexadecimal digit on an array of 7-segment display elements.
LCD_SegStatic_Write7SegNumber_n Displays an integer value on a one- to five-digit array of 7-segment display
elements.
LCD_SegStatic_WriteBargraph_n
Displays an integer location on a linear or circular bar graph
LCD_SegStatic_PutChar14Seg_n
Displays a character on an array of 14-segment alphanumeric character
display elements.
LCD_SegStatic_WriteString14Seg_n
Displays a null terminated character string on an array of 14-segment
alphanumeric character display elements.
LCD_SegStatic_PutChar16Seg_n
Displays a character on an array of 16-segment alphanumeric character
display elements.
LCD_SegStatic_WriteString16Seg_n
Displays a null terminated character string on an array of 16-segment
alphanumeric character display elements.
Document Number: 001-85172 Rev. **
Page 13 of 26
®
Static Segment LCD (LCD_SegStatic)
PSoC Creator™ Component Datasheet
void LCD_SegStatic_Write7SegDigit_n(uint8 Digit, uint8 Position)
Description:
This function displays a hexadecimal digit on an array of 7-segment display elements.
Digits can be hexadecimal values in the range of 0 to 9 and A to F. The customizer
Display Helpers facility must be used to define the pixel set associated with the 7segment display elements Multiple 7-segment display elements can be defined in the
frame buffer and are addressed through the suffix (n) in the function name. This function
is only included if a 7-segment display element is defined in the component customizer.
Parameters:
uint8 Digit: Unsigned integer value in the range of 0 to 15 to be displayed as a
hexadecimal digit.
uint8 Position: Position of the digit as counted right to left starting at 0 on the right. If the
position is outside the defined display area, the character is not displayed.
Return Value:
None
Side Effects:
None
void LCD_SegStatic Write7SegNumber_n(uint16 Value, uint8 Position,
uint8 Mode)
Description:
This function displays a 16-bit integer value on a one- to five-digit array of 7-segment
display elements. The customizer Display Helpers facility must be used to define the pixel
set associated with the 7-segment display elements. Multiple 7-segment display element
groups can be defined in the frame buffer and are addressed through the suffix (n) in the
function name. Sign conversion, sign display, decimal points, and other custom features
must be handled by application-specific user code. This function is only included if a 7segment display element is defined in the component customizer.
Parameters:
uint16 Value: The unsigned integer value to be displayed.
uint8 Position: The position of the least significant digit as counted right to left starting at
0 on the right. If the defined display area contains fewer digits then the Value requires,
the most significant digit or digits will not be displayed
uint8 Mode: Sets the display mode. Can be zero or one.
Value
0
No leading 0s are displayed.
1
Leading 0s are displayed
Return Value:
None
Side Effects:
None
Page 14 of 26
Description
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
void LCD_SegStatic_WriteBargraph_n(uint16 Location, uint8 Mode)
Description:
This function displays an 8-bit integer location on a 1- to 255-segment bar graph
(numbered left to right).The bar graph may be any user-defined size between 1 and 255
segments. A bar graph may also be created in a circle to display rotary position. The
customizer Display Helpers facility must be used to define the pixel set associated with
the bar graph display elements Multiple bar graph displays can be created in the frame
buffer and are addressed through the suffix (n) in the function name. This function is only
included if a bar graph display element is defined in the component customizer
Parameters:
uint16 Location: The unsigned integer location to be displayed. Valid values are from
zero to the number of segments in the bar graph. A zero value turns all bar graph
elements off. Values greater than the number of segments in the bar graph result in all
elements on.
uint8 Mode: Sets the bar graph display mode.
Value
Description
0
Specified location segment is turned on
1
The location segment and all segments to the left are turned on
–1
The location segment and all segments to the right are turned on.
2-10
Display the location segment and 2 to 10 segments to the right. This
mode can be used to create wide indicators.
Return Value:
None
Side Effects:
None
void LCD_SegStatic_PutChar14Seg_n(uint8 Character, uint8 Position)
Description:
This function displays an 8-bit character on an array of 14-segment alphanumeric
character display elements. The customizer Display Helpers facility must be used to
define the pixel set associated with the 14-segment display element. Multiple 14-segment
alphanumeric display element groups can be defined in the frame buffer and are
addressed through the suffix (n) in the function name. This function is only included if a
14-segment element is defined in the component customizer.
Parameters:
uint8 Character: The ASCII value of the character to display (printable characters with
ASCII values 0 to 127)
uint8 Position: The position of the character as counted left to right starting at 0 on the
left. If the position is outside the defined display area, the character is not displayed.
Return Value:
None
Side Effects:
None
Document Number: 001-85172 Rev. **
Page 15 of 26
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
void LCD_SegStatic_WriteString14Seg_n(*uint8 Character, uint8 Position)
Description:
This function displays a null terminated character string on an array of 14-segment
alphanumeric character display elements. The customizer Display Helpers facility must
be used to define the pixel set associated with the 14-segment display elements Multiple
14-segment alphanumeric display element groups can be defined in the frame buffer and
are addressed through the suffix (n) in the function name. This function is only included if
a 14-segment display element is defined in the component customizer
Parameters:
*uint8 Character: The pointer to the null terminated character string.
uint8 Position: The position of the first character as counted left to right starting at 0 on
the left. If the length of the string exceeds the size of the defined display area, the extra
characters are not displayed.
Return Value:
None
Side Effects:
Doesn’t clear display prior data output. All the locations that weren’t affected will remain
their previous pixel states.
void LCD_SegStatic_PutChar16Seg_n(uint8 Character, uint8 Position)
Description:
This function displays an 8-bit character on an array of 16-segment alphanumeric
character display elements. The customizer Display Helpers facility must be used to
define the pixel set associated with the 16-segment display elements. Multiple 16segment alphanumeric display element groups can be defined in the frame buffer and are
addressed through the suffix (n) in the function name. This function is only included if a
16-segment display element is defined in the component customizer
Parameters:
uint8 Character: The ASCII value of the character to display (printable ASCII and table
extended characters with values 0 to 255)
uint8 Position: The position of the character as counted left to right starting at 0 on the
left. If the position is outside the defined display area, the character is not displayed.
Return Value:
None
Side Effects:
None
Page 16 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
(void) LCD_SegStatic_WriteString16Seg_n(*uint8 Character, uint8 Position)
Description:
This function displays a null terminated character string on an array of 16-segment
alphanumeric character display elements. The customizer Display Helpers facility must
be used to define the pixel set associated with the 16-segment display elements. Multiple
16-segment alphanumeric display element groups can be defined in the frame buffer and
are addressed through the suffix (n) in the function name. This function is only included if
a 16-segment display element is defined in the component customizer.
Parameters:
*uint8 Character: The pointer to the null terminated character string.
uint8 Position: The position of the first character as counted left to right starting at 0 on
the left. If the length of the string exceeds the size of the defined display area, the extra
characters are not displayed.
Return Value:
None
Side Effects:
Doesn’t clear display prior data output. All the locations that weren’t affected will remain
their previous pixel states.
Pins APIs
These API functions are used to change the drive mode of pins used by the Static Segment LCD
component. These APIs are most often used to place Static Segment LCD component pins into
the HI-Z mode to minimize leakage while the device is in a low-power mode.
Function
Description
LCD_SegStatic_ComPort_SetDriveMode
Sets the drive mode for the pin used by a common line of the Static
Segment LCD component.
LCD_SegStatic_SegPort_SetDriveMode
Sets the drive mode for all pins used by segment lines of the Static
Segment LCD component.
void LCD_SegStatic_ComPort_SetDriveMode(uint8 mode)
Description:
Sets the drive mode for the pin used by a common line of the Static Segment LCD
component.
Parameters:
uint8 mode: The desired drive mode. See the Pins component datasheet for information
on drive modes.
Return Value:
None
Side Effects:
None
Document Number: 001-85172 Rev. **
Page 17 of 26
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
LCD_SegStatic_SegPort_SetDriveMode(uint8 mode)
Description:
Sets the drive mode for all pins used by segment lines of the Static Segment LCD
component.
Parameters:
uint8 mode: The desired drive mode. See the Pins component datasheet for
information on drive modes.
Return Value:
None
Side Effects:
None
Defines
LCD_SegStatic_SEG_NUM
This macro defines the number of segment lines for the user-defined display current
configuration of the component.
LCD_SegStatic_FRAME_RATE
This macro defines the refresh rate for the user-defined display current configuration of the
component.
LCD_SegStatic_WRITE_PIXEL
This is a macro define of the LCD_SegStatic_WritePixel() function that returns void.
LCD_SegStatic_READ_PIXEL
This is a macro define of the LCD_SegStatic_ReadPixel() function.
LCD_SegStatic_FIND_PIXEL
This macro calculates pixel location in the frame buffer. It uses information from the customizer
pixel table and information about physical pins dedicated for the LCD. This macro is the basis of
the pixel mapping mechanism. Every pixel name from the pixel table is defined with the
calculated pixel location in the frame buffer. APIs use pixel names to access the respective pixel.
MISRA Compliance
This section describes the MISRA-C:2004 compliance and deviations for the component. There
are two types of deviations defined:


project deviations – deviations that are applicable for all PSoC Creator components
specific deviations – deviations that are applicable only for this component
Page 18 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
This section provides information on component-specific deviations. Project deviations are
described in the MISRA Compliance section of the System Reference Guide along with
information on the MISRA compliance verification environment.
The Static Segment LCD component has not been verified for MISRA-C:2004 coding guidelines
compliance.
Sample Firmware Source Code
PSoC Creator provides numerous example projects that include schematics and example code
in the Find Example Project dialog. For component-specific examples, open the dialog from the
Component Catalog or an instance of the component in a schematic. For general examples,
open the dialog from the Start Page or File menu. As needed, use the Filter Options in the
dialog to narrow the list of projects available to select.
Refer to the “Find Example Project” topic in the PSoC Creator Help for more information.
Functional Description
The Static Segment LCD component provides a powerful and flexible mechanism for driving
different types of LCD glass. The configuration dialog provides access to the parameters that
can be used to customize the component. A standard set of API routines provide control of the
display and of specific pixels. Additional display APIs are generated based on the type and
number of display helpers defined.
Default Configuration
The default configuration of the LCD_SegStatic component provides a generic Direct LCD
Segment drive controller. The default LCD_SegStatic configuration is:



Four segment lines
30-Hz refresh rate
No display helpers are defined. Default API generation will not include functions for any of the
supported display elements.
Document Number: 001-85172 Rev. **
Page 19 of 26
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
Block Diagram and Configuration
The following diagram shows the schematic representation of the Static Segment LCD
component. The component does not require special-purpose LCD drive hardware. The
component makes use of the DMA and standard digital port I/Os.
This diagram shows the internal schematic for the Static Segment LCD component. It consists of
a DMA component, ISR component, clock component, and two LCD ports.

The DMA component is used to transfer data from the frame buffer to the LCD data registers
through the aliased memory area.

The LCD Ports (Com and Seg) are used to map the logical signals to physical pins. There are
two instances of the LCD Port; one for common lines and one for segment lines.

ISR component available for user interrupt.
Top-Level Architecture
The architecture of the component is very simple. It only uses a few blocks. The base of the
component is a frame buffer that contains LCD data. The frame buffer can be modified using the
LCD_SegStatic_WritePixel() function or a high-level function that refers to this function. The
DMA then transfers the LCD data to port registers using aliased memory. The DMA transactions
are triggered by an internal clock set with a precalculated value to provide a proper refresh rate
for the LCD.
Resources
The Static Segment LCD component uses one DMA component and one ISR. Also component
utilizes an I/O pin for common and one pin for each segment line.
Page 20 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Static Segment LCD (LCD_SegStatic)
API Memory Usage
The component memory usage varies significantly, depending on the compiler, device, number
of APIs used and component configuration. The following table provides the memory usage for
all APIs available in the given component configuration.
The measurements have been done with the associated compiler configured in Release mode
with optimization set for Size. For a specific design the map file generated by the compiler can
be analyzed to determine the memory usage.
Basic: Low-level API functions set without any high-level helper API
Basic, 7-segment helper: Low-level API functions set + 7-segment helper API
Basic, 14-segment helper: Low-level API functions set + 14-segment helper API
Basic, 16-segment helper: Low-level API functions set + 16-segment helper API
Basic, Bar Graph helper: Low-level API functions set + bar graph helper high-level API
PSoC 3 (Keil_PK51)
Configuration
PSoC 5 (GCC)
PSoC 5LP (GCC)
Flash
SRAM
Flash
SRAM
Flash
SRAM
Bytes
Bytes
Bytes
Bytes
Bytes
Bytes
Basic
1607
40
774
49
774
49
Basic, 7-segment helper
1936
40
914
49
914
49
Basic, 14-segment
helper
2079
40
1144
49
1144
49
Basic, 16-segment
helper
2083
40
1148
49
1148
49
Basic, Bar Graph helper
2068
40
1014
49
1014
49
DC and AC Electrical Characteristics
N/A
Component Changes
This section lists the major changes in the component from the previous version.
Version
Description of Changes
Reason for Changes / Impact
2.20
Added MISRA Compliance section.
The component was not verified for MISRA compliance.
Removed a note that states it is impossible
to modify number of common lines after
helper function was added.
Component now allows modifying number of commons
when helper is added.
Updated API Memory Usage table.
Document Number: 001-85172 Rev. **
Page 21 of 26
Static Segment LCD (LCD_SegStatic)
Version
Description of Changes
®
PSoC Creator™ Component Datasheet
Reason for Changes / Impact
Fixed issue in description of
LCD_SegStatic_Write7SegNumber_n ().
Parameter “Value” is of type uint16 but
datasheet stated that it is uint8.
Fixed issue in description of
LCD_SegStatic_WriteBargraph_n().
Parameter “Location” is of type uint16 but
datasheet stated that it is uint8.
Fixed issue with
LCD_SegStatic_WriteStringDotMatrix_n()
and Seg_Display_WriteString16Seg_n()
Previous implementation expected a null pointer to
terminate the string instead of a single zero byte. That
could cause an incorrect string to be displayed.
API.
Fixed issue with
LCD_SegStatic_WriteBargraph_n() API.
Previously this API didn't clear its previous output on
display. This could cause unexpected results to be
displayed on the LCD.
Fixed issue with
Previously this API didn't clear its previous output on
LCD_SegStatic_Write7SegNumber_n() API. display. This could cause unexpected results to be
displayed on the LCD.
2.10
Changed default instance name from
LCD_SegStat to LCD_SegStatic.
Added characterization data to datasheet
Added two new APIs:
LCD_SegStatic_ReadInvertState();
LCD_SegStatic_WriteInvertState();
LCD_SegStatic_WriteInvertState() allows to invert the
entire LCD glass. This feature can be used for testing
purposes.
LCD_SegStatic_ReadInvertState() used for reading thr
sate of a display if it in normal or inverted state.
Fixed LCD_SegStatic_Write7SegNumber()
API.
There was a bug in the API wich overrrided the last digit
of the number displated on the LCD with 0. The issue
only occured when "leading zeroes" mode of output was
used.
Added all component APIs with the
CYREENTRANT keyword when they are
included in the .cyre file.
Add the capability for customers to specify any individual
generated functions as reentrant.
Enable ganging commons checkbox added This a new feature that is helpful for driving large displays.
to the component customizer.
2.0
Low-power APIs support was removed for
PSoC 5 silicon.
The following APIs were added to conditional compilation:
LCD_SegStat_SaveConfig();
LCD_SegStat_RestoreConfig();
LCD_SegStat_Sleep();
LCD_SegStat_Wakeup().
These APIs are not included to the project if it runs on a
PSoC 5 device.
Page 22 of 26
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Version
Static Segment LCD (LCD_SegStatic)
Description of Changes
Reason for Changes / Impact
Fixed LCD_SegStat_Stop() API issue.
The LCD_SegStat_Stop() function wasn't releasing the
DMA configuration. That caused the component to stop
functioning after several LCD_SegStat_Start() ->
LCD_SegStat_Stop() sequences. This was happening
because the component ran out of DMA resources that
were allocated in the LCD_SegStat_Start() function and
not released in the LCD_SegStat_Stop() API. Proper
DMA release procedure was implemented and used in
the LCD_SegStat_Stop() API.
Changed WRITE_PIXEL() macros definition There is no need to analyze the return value of the
from
LCD_SegStat_WritePixel() API inside component
realization, so the macros were updated to handle that.
#define
LCD_SegStat_WRITE_PIXEL(pixelNumber,
pixelState)
LCD_SegStat_WritePixel(pixelNumber,
pixelState)
to
#define
LCD_SegStat_WRITE_PIXEL(pixelNumber,
pixelState) (void)
LCD_SegStat_WritePixel(pixelNumber,
pixelState)
Deleted following obsolete names from
header file:
These names were marked as obsolete in the previous
component version.
LCD_SegStat_Buffer
LCD_SegStat_Channel
LCD_SegStat_TermOut
LCD_SegStat_TD
LCD_SegStat_GCommons
LCD_SegStat_Commons
Function LCD_SegStat_WriteBargraph()
was optimized.
Document Number: 001-85172 Rev. **
Code refactoring allowed the component to save some
space in flash memory for this API.
Page 23 of 26
Static Segment LCD (LCD_SegStatic)
Version
1.50.a
®
PSoC Creator™ Component Datasheet
Description of Changes
Reason for Changes / Impact
Functions
LCD_SegStat_WriteString14Seg() and
LCD_SegStat_WriteString16Seg() were
optimized.
Array indexing was changed to pointer indexing, which
allowed the component to save some RAM space and get
better execution time from these functions.
Fixed multiple variable declarations in one
line all over the source code.
This was violating internal code standards specification.
LCD_SegStat_Write7SegNumber() API
implementation was optimized.
There was some ineffective code in the
LCD_SegStat_Write7SegNumber() API that was reflected
in longer execution time of this API.
Fixed LCD_SegStat_Wakeup() API.
The LCD_SegStat_Wakeup() API always returned
CYRET_LOCKED even if the function executed correctly.
Implemented procedure for proper return status handling.
Added manual call workaround to
LCD_SegStat_Stop() description in
datasheet
Missing call to LCD_SegStat_DmaDispose() in the
LCD_SegStat_Stop() routine.
Added Pin APIs section to datasheet.
Minor datasheet edits and updates.
1.50
Added sleep and wakeup APIs.
To support low power modes.
Added backup structure which stores the
state of the component.
Backup structure stores component state
(enabled/disabled) prior to entering sleep mode. When
LCD_SegStat_Wakeup() API called to wake the
component from sleep this structure puts the component
back into the state it was before entering the Sleep mode.
Added tooltip in the Helpers tab.
This was done because the default size of the Configure
dialog does not show the Pixel Mapping Table.
Added numeric up-down controls and edit
fields for Number of Segment Lines set
enabled even if user added helper
functions, earlier they were disabled.
Previously, if you wanted to change the number of
segment lines after adding helpers, you had to delete all
helpers and lose all configuration information. After
adding a helper to a segment LCD component, you can
go back and change the number of segment lines. If the
number of segments increases, everything is clear. If the
number of segments decreases, you will see a warning
that you may lose configuration information.
If you have assigned pixels on segment lines that you
want to remove, they will be unassigned.
Added error provider for selected pixel
name text box. If you enter a wrong value in
the text box, an error icon appears and you
cannot leave the text box until the value is
correct. Error icon has a tool tip with a
problem description.
Page 24 of 26
Error provider is a better way to handle incorrect values.
It is used instead of showing message boxes.
Document Number: 001-85172 Rev. **
®
PSoC Creator™ Component Datasheet
Version
Static Segment LCD (LCD_SegStatic)
Description of Changes
Reason for Changes / Impact
Following global variables were redefined
with low camel case names:
Coding standards require variables to follow low camel
case naming style. These variables became obsolete and
will be removed in future.
#define `$LCD_SegStat`_Buffer
#define `$LCD_SegStat`_Channel
#define `$LCD_SegStat`_TermOut
#define `$LCD_SegStat`_TD
#define `$$LCD_SegStat`_GCommons
#define `$$LCD_SegStat`_Commons
1.30.b
Added information to the component that
advertizes its compatibility with silicon
revisions.
The tool reports an error/warning if the component is used
on incompatible silicon. If this happens, update to a
revision that supports your target device.
Made change log cumulative for v1.30
datasheet
1.30.a
Moved local parameters to formal
parameter list.
To address a defect that existed in PSoC Creator v1.0
Beta 4.1 and earlier, the component was updated so that
it could continue to be used in newer versions of the tool.
This component used local parameters, which are not
exposed to the user, to do background calculations on
user input. These parameters have been changed to
formal parameters which are visible, but un-editable.
There are no functional changes to the component but the
affected parameters are now visible in the “expression
view” of the customizer dialog.
1.30
Updated generated source code.
Added StaticSegLCD_INT.c file to component's library.
Component's source code was changed to use CyLib.h
function for internal interrupt configuration.
Added a fix for DMA to work properly in 32-bit address
space.
Added an equation to component source file which selects
proper termination signal from DMA.
1.20.b
Added information to the component that
advertizes its compatibility with silicon
revisions.
The tool reports an error/warning if the component is used
on incompatible silicon. If this happens, update to a
revision that supports your target device.
Made datasheet change log cumulative
1.10.b
Added information to the component that
advertizes its compatibility with silicon
revisions.
Document Number: 001-85172 Rev. **
The tool reports an error/warning if the component is
used on incompatible silicon. If this happens, update to a
revision that supports your target device.
Page 25 of 26
Static Segment LCD (LCD_SegStatic)
®
PSoC Creator™ Component Datasheet
Version
Description of Changes
Reason for Changes / Impact
1.10.a
Moved local parameters to formal
parameter list.
To address a defect that existed in PSoC Creator v1.0
Beta 4.1 and earlier, the component was updated so that
it could continue to be used in newer versions of the tool.
This component used local parameters, which are not
exposed to the user, to do background calculations on
user input. These parameters have been changed to
formal parameters which are visible, but un-editable.
There are no functional changes to the component but
the affected parameters are now visible in the
“expression view” of the customizer dialog.
© Cypress Semiconductor Corporation, 2012. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of
any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used
for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for
use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in lifesupport systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.
PSoC® is a registered trademark, and PSoC Creator™ and Programmable System-on-Chip™ are trademarks of Cypress Semiconductor Corp. All other trademarks or registered trademarks
referenced herein are property of the respective corporations.
Any Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and
foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create
derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in
conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as
specified above is prohibited without the express written permission of Cypress.
Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein.
Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in lifesupport systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems application
implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges.
Use may be limited by and subject to the applicable Cypress software license agreement.
Page 26 of 26
Document Number: 001-85172 Rev. **