|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
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. | |
FT8xx co-processor engine functions.
| #define FT8XX_OPT_3D 0 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor widget is drawn in 3D effect.
| #define FT8XX_OPT_CENTER 1536 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor widget centers horizontally and vertically.
| #define FT8XX_OPT_CENTERX 512 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor widget centers horizontally.
| #define FT8XX_OPT_CENTERY 1024 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor widget centers vertically.
| #define FT8XX_OPT_FLAT 256 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor widget is drawn without 3D effect.
| #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.
| #define FT8XX_OPT_NOBACK 4096 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor widget has no background drawn.
| #define FT8XX_OPT_NODL 2 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
No display list commands generated for bitmap decoded from JPEG image.
| #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.
| #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.
| #define FT8XX_OPT_NOPOINTER 16384 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
The Co-processor gauge has no pointer.
| #define FT8XX_OPT_NOSECS 32768 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor clock widget is drawn without seconds hand.
| #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.
| #define FT8XX_OPT_RGB565 0 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Co-processor option to decode the JPEG image to RGB565 format.
| #define FT8XX_OPT_RIGHTX 2048 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
The label on the Coprocessor widget is right justified.
| #define FT8XX_OPT_SIGNED 256 |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
The number is treated as 32 bit signed integer.
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Execute a display list command by co-processor engine.
| dev | Device structure |
| cmd | Display list command to execute |
#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.
| dev | Device structure |
| color | Color to set |
#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.
| dev | Device structure |
| result | Calibration result, written with 0 on failure of calibration |
| void ft8xx_copro_cmd_dlstart | ( | const struct device * | dev | ) |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Start a new display list.
| dev | Device structure |
#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").
| dev | Device structure |
| color | Color to set |
| 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.
| dev | Device structure |
| x | x-coordinate of text base, in pixels |
| y | y-coordinate of text base, in pixels |
| font | Font to use for text, 0-31. 16-31 are ROM fonts |
| options | Options to apply |
| number | The number to display. |
| 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.
| dev | Device structure |
| x | x-coordinate of slider top-left, in pixels |
| y | y-coordinate of slider top-left, in pixels |
| width | Width of slider, in pixels |
| height | Height of slider, in pixels |
| options | Options to apply |
| val | Displayed value of slider, between 0 and range inclusive |
| range | Maximum value |
| void ft8xx_copro_cmd_swap | ( | const struct device * | dev | ) |
#include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
Swap the current display list.
| dev | Device structure |
| 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.
| dev | Device structure |
| x | x-coordinate of text base, in pixels |
| y | y-coordinate of text base, in pixels |
| font | Font to use for text, 0-31. 16-31 are ROM fonts |
| options | Options to apply |
| string | Character string to display, terminated with a null character |
| 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.
| dev | Device structure |
| x | x-coordinate of top-left of toggle, in pixels |
| y | y-coordinate of top-left of toggle, in pixels |
| width | Width of toggle, in pixels |
| font | Font to use for text, 0-31. 16-31 are ROM fonts |
| options | Options to apply |
| state | State of the toggle: 0 is off, 65535 is on |
| string | String label for toggle |
| 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:
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.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.
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.| dev | Device structure |
| x | x-coordinate |
| y | y-coordinate |
| width | Width of track area, in pixels. |
| height | Height of track area, in pixels. |
| tag | Tag of the graphics object to be tracked, 1-255 |