Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

FT8xx co-processor engine functions. More...

Macros

#define FT8XX_OPT_3D   0
 Co-processor widget is drawn in 3D effect.
#define FT8XX_OPT_RGB565   0
 Co-processor option to decode the JPEG image to RGB565 format.
#define FT8XX_OPT_MONO   1
 Co-processor option to decode the JPEG image to L8 format, i.e., monochrome.
#define FT8XX_OPT_NODL   2
 No display list commands generated for bitmap decoded from JPEG image.
#define FT8XX_OPT_FLAT   256
 Co-processor widget is drawn without 3D effect.
#define FT8XX_OPT_SIGNED   256
 The number is treated as 32 bit signed integer.
#define FT8XX_OPT_CENTERX   512
 Co-processor widget centers horizontally.
#define FT8XX_OPT_CENTERY   1024
 Co-processor widget centers vertically.
#define FT8XX_OPT_CENTER   1536
 Co-processor widget centers horizontally and vertically.
#define FT8XX_OPT_RIGHTX   2048
 The label on the Coprocessor widget is right justified.
#define FT8XX_OPT_NOBACK   4096
 Co-processor widget has no background drawn.
#define FT8XX_OPT_NOTICKS   8192
 Co-processor clock widget is drawn without hour ticks.
#define FT8XX_OPT_NOHM   16384
 Co-processor clock widget is drawn without hour and minutes hands, only seconds hand is drawn.
#define FT8XX_OPT_NOPOINTER   16384
 The Co-processor gauge has no pointer.
#define FT8XX_OPT_NOSECS   32768
 Co-processor clock widget is drawn without seconds hand.
#define FT8XX_OPT_NOHANDS   49152
 Co-processor clock widget is drawn without hour, minutes and seconds hands.

Functions

void ft8xx_copro_cmd (const struct device *dev, uint32_t cmd)
 Execute a display list command by co-processor engine.
void ft8xx_copro_cmd_dlstart (const struct device *dev)
 Start a new display list.
void ft8xx_copro_cmd_swap (const struct device *dev)
 Swap the current display list.
void ft8xx_copro_cmd_fgcolor (const struct device *dev, uint32_t color)
 Set the foreground color.
void ft8xx_copro_cmd_bgcolor (const struct device *dev, uint32_t color)
 Set the background color.
void ft8xx_copro_cmd_slider (const struct device *dev, int16_t x, int16_t y, int16_t width, int16_t height, uint16_t options, uint16_t val, uint16_t range)
 Draw a slider.
void ft8xx_copro_cmd_toggle (const struct device *dev, int16_t x, int16_t y, int16_t width, int16_t font, uint16_t options, uint16_t state, const char *string)
 Draw a toggle switch.
void ft8xx_copro_cmd_track (const struct device *dev, int16_t x, int16_t y, int16_t width, int16_t height, int16_t tag)
 Track touches for a graphics object.
void ft8xx_copro_cmd_text (const struct device *dev, int16_t x, int16_t y, int16_t font, uint16_t options, const char *string)
 Draw text.
void ft8xx_copro_cmd_number (const struct device *dev, int16_t x, int16_t y, int16_t font, uint16_t options, int32_t number)
 Draw a decimal number.
void ft8xx_copro_cmd_calibrate (const struct device *dev, uint32_t *result)
 Execute the touch screen calibration routine.

Detailed Description

FT8xx co-processor engine functions.

Macro Definition Documentation

◆ FT8XX_OPT_3D

#define FT8XX_OPT_3D   0

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor widget is drawn in 3D effect.

◆ FT8XX_OPT_CENTER

#define FT8XX_OPT_CENTER   1536

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor widget centers horizontally and vertically.

◆ FT8XX_OPT_CENTERX

#define FT8XX_OPT_CENTERX   512

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor widget centers horizontally.

◆ FT8XX_OPT_CENTERY

#define FT8XX_OPT_CENTERY   1024

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor widget centers vertically.

◆ FT8XX_OPT_FLAT

#define FT8XX_OPT_FLAT   256

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor widget is drawn without 3D effect.

◆ FT8XX_OPT_MONO

#define FT8XX_OPT_MONO   1

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor option to decode the JPEG image to L8 format, i.e., monochrome.

◆ FT8XX_OPT_NOBACK

#define FT8XX_OPT_NOBACK   4096

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor widget has no background drawn.

◆ FT8XX_OPT_NODL

#define FT8XX_OPT_NODL   2

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

No display list commands generated for bitmap decoded from JPEG image.

◆ FT8XX_OPT_NOHANDS

#define FT8XX_OPT_NOHANDS   49152

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor clock widget is drawn without hour, minutes and seconds hands.

◆ FT8XX_OPT_NOHM

#define FT8XX_OPT_NOHM   16384

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor clock widget is drawn without hour and minutes hands, only seconds hand is drawn.

◆ FT8XX_OPT_NOPOINTER

#define FT8XX_OPT_NOPOINTER   16384

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

The Co-processor gauge has no pointer.

◆ FT8XX_OPT_NOSECS

#define FT8XX_OPT_NOSECS   32768

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor clock widget is drawn without seconds hand.

◆ FT8XX_OPT_NOTICKS

#define FT8XX_OPT_NOTICKS   8192

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor clock widget is drawn without hour ticks.

Gauge widget is drawn without major and minor ticks.

◆ FT8XX_OPT_RGB565

#define FT8XX_OPT_RGB565   0

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Co-processor option to decode the JPEG image to RGB565 format.

◆ FT8XX_OPT_RIGHTX

#define FT8XX_OPT_RIGHTX   2048

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

The label on the Coprocessor widget is right justified.

◆ FT8XX_OPT_SIGNED

#define FT8XX_OPT_SIGNED   256

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

The number is treated as 32 bit signed integer.

Function Documentation

◆ ft8xx_copro_cmd()

void ft8xx_copro_cmd ( const struct device * dev,
uint32_t cmd )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Execute a display list command by co-processor engine.

Parameters
devDevice structure
cmdDisplay list command to execute

◆ ft8xx_copro_cmd_bgcolor()

void ft8xx_copro_cmd_bgcolor ( const struct device * dev,
uint32_t color )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Set the background color.

New background color, as a 24-bit RGB number. Red is the most significant 8 bits, blue is the least. So 0xff0000 is bright red. Background color is applicable for things that the user cannot move. Example behind gauges and sliders etc.

Parameters
devDevice structure
colorColor to set

◆ ft8xx_copro_cmd_calibrate()

void ft8xx_copro_cmd_calibrate ( const struct device * dev,
uint32_t * result )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Execute the touch screen calibration routine.

The calibration procedure collects three touches from the touch screen, then computes and loads an appropriate matrix into REG_TOUCH_TRANSFORM_A-F. To use it, create a display list and then use CMD_CALIBRATE. The co-processor engine overlays the touch targets on the current display list, gathers the calibration input and updates REG_TOUCH_TRANSFORM_A-F.

Parameters
devDevice structure
resultCalibration result, written with 0 on failure of calibration

◆ ft8xx_copro_cmd_dlstart()

void ft8xx_copro_cmd_dlstart ( const struct device * dev)

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Start a new display list.

Parameters
devDevice structure

◆ ft8xx_copro_cmd_fgcolor()

void ft8xx_copro_cmd_fgcolor ( const struct device * dev,
uint32_t color )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Set the foreground color.

New foreground color, as a 24-bit RGB number. Red is the most significant 8 bits, blue is the least. So 0xff0000 is bright red. Foreground color is applicable for things that the user can move such as handles and buttons ("affordances").

Parameters
devDevice structure
colorColor to set

◆ ft8xx_copro_cmd_number()

void ft8xx_copro_cmd_number ( const struct device * dev,
int16_t x,
int16_t y,
int16_t font,
uint16_t options,
int32_t number )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Draw a decimal number.

By default (x, y) is the top-left pixel of the text. FT8XX_OPT_CENTERX centers the text horizontally, FT8XX_OPT_CENTERY centers it vertically. FT8XX_OPT_CENTER centers the text in both directions. FT8XX_OPT_RIGHTX right-justifies the text, so that the x is the rightmost pixel. By default the number is displayed with no leading zeroes, but if a width 1-9 is specified in the options, then the number is padded if necessary with leading zeroes so that it has the given width. If FT8XX_OPT_SIGNED is given, the number is treated as signed, and prefixed by a minus sign if negative.

Parameters
devDevice structure
xx-coordinate of text base, in pixels
yy-coordinate of text base, in pixels
fontFont to use for text, 0-31. 16-31 are ROM fonts
optionsOptions to apply
numberThe number to display.

◆ ft8xx_copro_cmd_slider()

void ft8xx_copro_cmd_slider ( const struct device * dev,
int16_t x,
int16_t y,
int16_t width,
int16_t height,
uint16_t options,
uint16_t val,
uint16_t range )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Draw a slider.

If width is greater than height, the scroll bar is drawn horizontally. If height is greater than width, the scroll bar is drawn vertically.

By default the slider is drawn with a 3D effect. FT8XX_OPT_FLAT removes the 3D effect.

Parameters
devDevice structure
xx-coordinate of slider top-left, in pixels
yy-coordinate of slider top-left, in pixels
widthWidth of slider, in pixels
heightHeight of slider, in pixels
optionsOptions to apply
valDisplayed value of slider, between 0 and range inclusive
rangeMaximum value

◆ ft8xx_copro_cmd_swap()

void ft8xx_copro_cmd_swap ( const struct device * dev)

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Swap the current display list.

Parameters
devDevice structure

◆ ft8xx_copro_cmd_text()

void ft8xx_copro_cmd_text ( const struct device * dev,
int16_t x,
int16_t y,
int16_t font,
uint16_t options,
const char * string )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Draw text.

By default (x, y) is the top-left pixel of the text and the value of options is zero. FT8XX_OPT_CENTERX centers the text horizontally, FT8XX_OPT_CENTERY centers it vertically. FT8XX_OPT_CENTER centers the text in both directions. FT8XX_OPT_RIGHTX right-justifies the text, so that the x is the rightmost pixel.

Parameters
devDevice structure
xx-coordinate of text base, in pixels
yy-coordinate of text base, in pixels
fontFont to use for text, 0-31. 16-31 are ROM fonts
optionsOptions to apply
stringCharacter string to display, terminated with a null character

◆ ft8xx_copro_cmd_toggle()

void ft8xx_copro_cmd_toggle ( const struct device * dev,
int16_t x,
int16_t y,
int16_t width,
int16_t font,
uint16_t options,
uint16_t state,
const char * string )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Draw a toggle switch.

By default the toggle is drawn with a 3D effect and the value option is zero. FT8XX_OPT_FLAT removes the 3D effect and its value is 256.

In string, a character value of 255 (it can be written as \xff ) separates the off and on labels.

Parameters
devDevice structure
xx-coordinate of top-left of toggle, in pixels
yy-coordinate of top-left of toggle, in pixels
widthWidth of toggle, in pixels
fontFont to use for text, 0-31. 16-31 are ROM fonts
optionsOptions to apply
stateState of the toggle: 0 is off, 65535 is on
stringString label for toggle

◆ ft8xx_copro_cmd_track()

void ft8xx_copro_cmd_track ( const struct device * dev,
int16_t x,
int16_t y,
int16_t width,
int16_t height,
int16_t tag )

#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>

Track touches for a graphics object.

This command will enable co-processor engine to track the touch on the particular graphics object with one valid tag value assigned. Then, co-processor engine will update the REG_TRACKER periodically with the frame rate of LCD display panel.

Co-processor engine tracks the graphics object in rotary tracker mode and linear tracker mode:

  • Rotary tracker mode Track the angle between the touching point and the center of graphics object specified by tag value. The value is in units of 1/65536 of a circle. 0 means that the angle is straight down, 0x4000 left, 0x8000 up, and 0xC000 right from the center.
  • Linear tracker mode If width is greater than height, track the relative distance of touching point to the width of graphics object specified by tag value. If width is not greater than height, track the relative distance of touching point to the height of graphics object specified by tag value. The value is in units of 1/65536 of the width or height of graphics object. The distance of touching point refers to the distance from the top left pixel of graphics object to the coordinate of touching point.

For linear tracker functionality, x represents x-coordinate of track area top-left and y represents y-coordinate of track area top-left. Both parameters are in pixels.

For rotary tracker functionality, x represents x-coordinate of track area center and y represents y-coordinate of track area center. Both parameters are in pixels.

Note
A width and height of (1,1) means that the tracker is rotary, and reports an angle value in REG_TRACKER. A width and height of (0,0) disables the track functionality of co-processor engine.
Parameters
devDevice structure
xx-coordinate
yy-coordinate
widthWidth of track area, in pixels.
heightHeight of track area, in pixels.
tagTag of the graphics object to be tracked, 1-255