LCOV - code coverage report
Current view: top level - zephyr/drivers/misc/ft8xx - ft8xx_reference_api.h Hit Total Coverage
Test: new.info Lines: 48 50 96.0 %
Date: 2024-12-22 00:14:23

          Line data    Source code
       1           1 : /*
       2             :  * Copyright (c) 2021 Hubert Miś
       3             :  *
       4             :  * SPDX-License-Identifier: Apache-2.0
       5             :  */
       6             : 
       7             : /**
       8             :  * @file
       9             :  * @brief FT8XX reference API
      10             :  */
      11             : 
      12             : #ifndef ZEPHYR_DRIVERS_MISC_FT8XX_FT8XX_REFERENCE_API_H_
      13             : #define ZEPHYR_DRIVERS_MISC_FT8XX_FT8XX_REFERENCE_API_H_
      14             : 
      15             : #include <stdint.h>
      16             : 
      17             : #include <zephyr/drivers/misc/ft8xx/ft8xx_copro.h>
      18             : #include <zephyr/drivers/misc/ft8xx/ft8xx_common.h>
      19             : #include <zephyr/drivers/misc/ft8xx/ft8xx_dl.h>
      20             : #include <zephyr/drivers/misc/ft8xx/ft8xx_memory.h>
      21             : 
      22             : #ifdef __cplusplus
      23             : extern "C" {
      24             : #endif
      25             : 
      26             : /**
      27             :  * @brief FT8xx reference API
      28             :  *
      29             :  * API defined according to FT800 Programmers Guide API reference definition.
      30             :  *
      31             :  * @note Function names defined in this header may easily collide with names
      32             :  *       provided by other modules. Include this header with caution. If naming
      33             :  *       conflict occurs instead of including this header, use @c ft8xx_
      34             :  *       prefixed names.
      35             :  *
      36             :  * @defgroup ft8xx_reference_api FT8xx reference API
      37             :  * @ingroup ft8xx_interface
      38             :  * @{
      39             :  */
      40             : 
      41             : /**
      42             :  * @brief Write 1 byte (8 bits) to FT8xx memory
      43             :  *
      44             :  * @param address Memory address to write to
      45             :  * @param data Byte to write
      46             :  */
      47           1 : static inline void wr8(uint32_t address, uint8_t data)
      48             : {
      49             :         ft8xx_wr8(address, data);
      50             : }
      51             : 
      52             : /**
      53             :  * @brief Write 2 bytes (16 bits) to FT8xx memory
      54             :  *
      55             :  * @param address Memory address to write to
      56             :  * @param data Value to write
      57             :  */
      58           1 : static inline void wr16(uint32_t address, uint16_t data)
      59             : {
      60             :         ft8xx_wr16(address, data);
      61             : }
      62             : 
      63             : /**
      64             :  * @brief Write 4 bytes (32 bits) to FT8xx memory
      65             :  *
      66             :  * @param address Memory address to write to
      67             :  * @param data Value to write
      68             :  */
      69           1 : static inline void wr32(uint32_t address, uint32_t data)
      70             : {
      71             :         ft8xx_wr32(address, data);
      72             : }
      73             : 
      74             : /**
      75             :  * @brief Read 1 byte (8 bits) from FT8xx memory
      76             :  *
      77             :  * @param address Memory address to read from
      78             :  *
      79             :  * @return Value read from memory
      80             :  */
      81           1 : static inline uint8_t rd8(uint32_t address)
      82             : {
      83             :         return ft8xx_rd8(address);
      84             : }
      85             : 
      86             : /**
      87             :  * @brief Read 2 bytes (16 bits) from FT8xx memory
      88             :  *
      89             :  * @param address Memory address to read from
      90             :  *
      91             :  * @return Value read from memory
      92             :  */
      93           1 : static inline uint16_t rd16(uint32_t address)
      94             : {
      95             :         return ft8xx_rd16(address);
      96             : }
      97             : 
      98             : /**
      99             :  * @brief Read 4 bytes (32 bits) from FT8xx memory
     100             :  *
     101             :  * @param address Memory address to read from
     102             :  *
     103             :  * @return Value read from memory
     104             :  */
     105           1 : static inline uint32_t rd32(uint32_t address)
     106             : {
     107             :         return ft8xx_rd32(address);
     108             : }
     109             : 
     110             : 
     111             : /** Co-processor widget is drawn in 3D effect */
     112           1 : #define OPT_3D        FT8XX_OPT_3D
     113             : /** Co-processor option to decode the JPEG image to RGB565 format */
     114           1 : #define OPT_RGB565    FT8XX_OPT_RGB565
     115             : /** Co-processor option to decode the JPEG image to L8 format, i.e., monochrome */
     116           1 : #define OPT_MONO      FT8XX_OPT_MONO
     117             : /** No display list commands generated for bitmap decoded from JPEG image */
     118           1 : #define OPT_NODL      FT8XX_OPT_NODL
     119             : /** Co-processor widget is drawn without 3D effect */
     120           1 : #define OPT_FLAT      FT8XX_OPT_FLAT
     121             : /** The number is treated as 32 bit signed integer */
     122           1 : #define OPT_SIGNED    FT8XX_OPT_SIGNED
     123             : /** Co-processor widget centers horizontally */
     124           1 : #define OPT_CENTERX   FT8XX_OPT_CENTERX
     125             : /** Co-processor widget centers vertically */
     126           1 : #define OPT_CENTERY   FT8XX_OPT_CENTERY
     127             : /** Co-processor widget centers horizontally and vertically */
     128           1 : #define OPT_CENTER    FT8XX_OPT_CENTER
     129             : /** The label on the Coprocessor widget is right justified */
     130           1 : #define OPT_RIGHTX    FT8XX_OPT_RIGHTX
     131             : /** Co-processor widget has no background drawn */
     132           1 : #define OPT_NOBACK    FT8XX_OPT_NOBACK
     133             : /** Co-processor clock widget is drawn without hour ticks.
     134             :  *  Gauge widget is drawn without major and minor ticks.
     135             :  */
     136           1 : #define OPT_NOTICKS   FT8XX_OPT_NOTICKS
     137             : /** Co-processor clock widget is drawn without hour and minutes hands,
     138             :  * only seconds hand is drawn
     139             :  */
     140           1 : #define OPT_NOHM      FT8XX_OPT_NOHM
     141             : /** The Co-processor gauge has no pointer */
     142           1 : #define OPT_NOPOINTER FT8XX_OPT_NOPOINTER
     143             : /** Co-processor clock widget is drawn without seconds hand */
     144           1 : #define OPT_NOSECS    FT8XX_OPT_NOSECS
     145             : /** Co-processor clock widget is drawn without hour, minutes and seconds hands */
     146           1 : #define OPT_NOHANDS   FT8XX_OPT_NOHANDS
     147             : 
     148             : /**
     149             :  * @brief Execute a display list command by co-processor engine
     150             :  *
     151             :  * @param command Display list command to execute
     152             :  */
     153           1 : static inline void cmd(uint32_t command)
     154             : {
     155             :         ft8xx_copro_cmd(command);
     156             : }
     157             : 
     158             : /**
     159             :  * @brief Start a new display list
     160             :  */
     161           1 : static inline void cmd_dlstart(void)
     162             : {
     163             :         ft8xx_copro_cmd_dlstart();
     164             : }
     165             : 
     166             : /**
     167             :  * @brief Swap the current display list
     168             :  */
     169           1 : static inline void cmd_swap(void)
     170             : {
     171             :         ft8xx_copro_cmd_swap();
     172             : }
     173             : 
     174             : /**
     175             :  * @brief Draw text
     176             :  *
     177             :  * By default (x,y) is the top-left pixel of the text and the value of
     178             :  * @p options is zero. OPT_CENTERX centers the text horizontally, OPT_CENTERY
     179             :  * centers it vertically. OPT_CENTER centers the text in both directions.
     180             :  * OPT_RIGHTX right-justifies the text, so that the x is the rightmost pixel.
     181             :  *
     182             :  * @param x x-coordinate of text base, in pixels
     183             :  * @param y y-coordinate of text base, in pixels
     184             :  * @param font Font to use for text, 0-31. 16-31 are ROM fonts
     185             :  * @param options Options to apply
     186             :  * @param s Character string to display, terminated with a null character
     187             :  */
     188           1 : static inline void cmd_text(int16_t x,
     189             :                            int16_t y,
     190             :                            int16_t font,
     191             :                            uint16_t options,
     192             :                            const char *s)
     193             : {
     194             :         ft8xx_copro_cmd_text(x, y, font, options, s);
     195             : }
     196             : 
     197             : /**
     198             :  * @brief Draw a decimal number
     199             :  *
     200             :  * By default (@p x, @p y) is the top-left pixel of the text. OPT_CENTERX
     201             :  * centers the text horizontally, OPT_CENTERY centers it vertically. OPT_CENTER
     202             :  * centers the text in both directions. OPT_RIGHTX right-justifies the text, so
     203             :  * that the @p x is the rightmost pixel. By default the number is displayed
     204             :  * with no leading zeroes, but if a width 1-9 is specified in the @p options,
     205             :  * then the number is padded if necessary with leading zeroes so that it has
     206             :  * the given width. If OPT_SIGNED is given, the number is treated as signed,
     207             :  * and prefixed by a minus sign if negative.
     208             :  *
     209             :  * @param x x-coordinate of text base, in pixels
     210             :  * @param y y-coordinate of text base, in pixels
     211             :  * @param font Font to use for text, 0-31. 16-31 are ROM fonts
     212             :  * @param options Options to apply
     213             :  * @param n The number to display.
     214             :  */
     215           1 : static inline void cmd_number(int16_t x,
     216             :                              int16_t y,
     217             :                              int16_t font,
     218             :                              uint16_t options,
     219             :                              int32_t n)
     220             : {
     221             :         ft8xx_copro_cmd_number(x, y, font, options, n);
     222             : }
     223             : 
     224             : /**
     225             :  * @brief Execute the touch screen calibration routine
     226             :  *
     227             :  * The calibration procedure collects three touches from the touch screen, then
     228             :  * computes and loads an appropriate matrix into REG_TOUCH_TRANSFORM_A-F. To
     229             :  * use it, create a display list and then use CMD_CALIBRATE. The co-processor
     230             :  * engine overlays the touch targets on the current display list, gathers the
     231             :  * calibration input and updates REG_TOUCH_TRANSFORM_A-F.
     232             :  *
     233             :  * @param result Calibration result, written with 0 on failure of calibration
     234             :  */
     235           1 : static inline void cmd_calibrate(uint32_t *result)
     236             : {
     237             :         ft8xx_copro_cmd_calibrate(result);
     238             : }
     239             : 
     240             : 
     241             : /** Rectangular pixel arrays, in various color formats */
     242           1 : #define BITMAPS      FT8XX_BITMAPS
     243             : /** Anti-aliased points, point radius is 1-256 pixels */
     244           1 : #define POINTS       FT8XX_POINTS
     245             : /**
     246             :  * Anti-aliased lines, with width from 0 to 4095 1/16th of pixel units.
     247             :  * (width is from center of the line to boundary)
     248             :  */
     249           1 : #define LINES        FT8XX_LINES
     250             : /** Anti-aliased lines, connected head-to-tail */
     251           1 : #define LINE_STRIP   FT8XX_LINE_STRIP
     252             : /** Edge strips for right */
     253           1 : #define EDGE_STRIP_R FT8XX_EDGE_STRIP_R
     254             : /** Edge strips for left */
     255           1 : #define EDGE_STRIP_L FT8XX_EDGE_STRIP_L
     256             : /** Edge strips for above */
     257           1 : #define EDGE_STRIP_A FT8XX_EDGE_STRIP_A
     258             : /** Edge strips for below */
     259           1 : #define EDGE_STRIP_B FT8XX_EDGE_STRIP_B
     260             : /**
     261             :  * Round-cornered rectangles, curvature of the corners can be adjusted using
     262             :  * LINE_WIDTH
     263             :  */
     264           1 : #define RECTS        FT8XX_RECTS
     265             : 
     266             : /**
     267             :  * @brief Begin drawing a graphics primitive
     268             :  *
     269             :  * The valid primitives are defined as:
     270             :  * - @ref BITMAPS
     271             :  * - @ref POINTS
     272             :  * - @ref LINES
     273             :  * - @ref LINE_STRIP
     274             :  * - @ref EDGE_STRIP_R
     275             :  * - @ref EDGE_STRIP_L
     276             :  * - @ref EDGE_STRIP_A
     277             :  * - @ref EDGE_STRIP_B
     278             :  * - @ref RECTS
     279             :  *
     280             :  * The primitive to be drawn is selected by the @ref BEGIN command. Once the
     281             :  * primitive is selected, it will be valid till the new primitive is selected
     282             :  * by the @ref BEGIN command.
     283             :  *
     284             :  * @note The primitive drawing operation will not be performed until
     285             :  *       @ref VERTEX2II or @ref VERTEX2F is executed.
     286             :  *
     287             :  * @param prim Graphics primitive
     288             :  */
     289           1 : #define BEGIN(prim) FT8XX_BEGIN(prim)
     290             : 
     291             : /**
     292             :  * @brief Clear buffers to preset values
     293             :  *
     294             :  * Setting @p c to true will clear the color buffer of the FT8xx to the preset
     295             :  * value. Setting this bit to false will maintain the color buffer of the FT8xx
     296             :  * with an unchanged value. The preset value is defined in command
     297             :  * @ref CLEAR_COLOR_RGB for RGB channel and CLEAR_COLOR_A for alpha channel.
     298             :  *
     299             :  * Setting @p s to true will clear the stencil buffer of the FT8xx to the preset
     300             :  * value. Setting this bit to false will maintain the stencil buffer of the
     301             :  * FT8xx with an unchanged value. The preset value is defined in command
     302             :  * CLEAR_STENCIL.
     303             :  *
     304             :  * Setting @p t to true will clear the tag buffer of the FT8xx to the preset
     305             :  * value. Setting this bit to false will maintain the tag buffer of the FT8xx
     306             :  * with an unchanged value. The preset value is defined in command CLEAR_TAG.
     307             :  *
     308             :  * @param c Clear color buffer
     309             :  * @param s Clear stencil buffer
     310             :  * @param t Clear tag buffer
     311             :  */
     312           1 : #define CLEAR(c, s, t) FT8XX_CLEAR(c, s, t)
     313             : 
     314             : /**
     315             :  * @brief Specify clear values for red, green and blue channels
     316             :  *
     317             :  * Sets the color values used by a following @ref CLEAR.
     318             :  *
     319             :  * @param red Red value used when the color buffer is cleared
     320             :  * @param green Green value used when the color buffer is cleared
     321             :  * @param blue Blue value used when the color buffer is cleared
     322             :  */
     323           1 : #define CLEAR_COLOR_RGB(red, green, blue) FT8XX_CLEAR_COLOR_RGB(red, green, blue)
     324             : 
     325             : /**
     326             :  * @brief Set the current color red, green and blue
     327             :  *
     328             :  * Sets red, green and blue values of the FT8xx color buffer which will be
     329             :  * applied to the following draw operation.
     330             :  *
     331             :  * @param red Red value for the current color
     332             :  * @param green Green value for the current color
     333             :  * @param blue Blue value for the current color
     334             :  */
     335           1 : #define COLOR_RGB(red, green, blue) FT8XX_COLOR_RGB(red, green, blue)
     336             : 
     337             : /**
     338             :  * @brief End the display list
     339             :  *
     340             :  * FT8xx will ignore all the commands following this command.
     341             :  */
     342           1 : #define DISPLAY() FT8XX_DISPLAY()
     343             : 
     344             : /**
     345             :  * @brief End drawing a graphics primitive
     346             :  *
     347             :  * It is recommended to have an @ref END for each @ref BEGIN. Whereas advanced
     348             :  * users can avoid the usage of @ref END in order to save extra graphics
     349             :  * instructions in the display list RAM.
     350             :  */
     351           1 : #define END() FT8XX_END()
     352             : 
     353             : /**
     354             :  * @brief Specify the width of lines to be drawn with primitive @ref LINES
     355             :  *
     356             :  * Sets the width of drawn lines. The width is the distance from the center of
     357             :  * the line to the outermost drawn pixel, in units of 1/16 pixel. The valid
     358             :  * range is from 16 to 4095 in terms of 1/16th pixel units.
     359             :  *
     360             :  * @note The @ref LINE_WIDTH command will affect the @ref LINES,
     361             :  *       @ref LINE_STRIP, @ref RECTS, @ref EDGE_STRIP_A /B/R/L primitives.
     362             :  *
     363             :  * @param width Line width in 1/16 pixel
     364             :  */
     365           1 : #define LINE_WIDTH(width) FT8XX_LINE_WIDTH(width)
     366             : 
     367             : /**
     368             :  * @brief Attach the tag value for the following graphics objects.
     369             :  *
     370             :  * The initial value of the tag buffer of the FT8xx is specified by command
     371             :  * CLEAR_TAG and taken effect by command @ref CLEAR. @ref TAG command can
     372             :  * specify the value of the tag buffer of the FT8xx that applies to the graphics
     373             :  * objects when they are drawn on the screen. This @ref TAG value will be
     374             :  * assigned to all the following objects, unless the TAG_MASK command is used to
     375             :  * disable it.  Once the following graphics objects are drawn, they are attached
     376             :  * with the tag value successfully. When the graphics objects attached with the
     377             :  * tag value are touched, the register @ref REG_TOUCH_TAG will be updated with
     378             :  * the tag value of the graphics object being touched. If there is no @ref TAG
     379             :  * commands in one display list, all the graphics objects rendered by the
     380             :  * display list will report tag value as 255 in @ref REG_TOUCH_TAG when they
     381             :  * were touched.
     382             :  *
     383             :  * @param s Tag value 1-255
     384             :  */
     385           1 : #define TAG(s) FT8XX_TAG(s)
     386             : 
     387             : /**
     388             :  * @brief Start the operation of graphics primitives at the specified coordinate
     389             :  *
     390             :  * The range of coordinates is from -16384 to +16383 in terms of 1/16th pixel
     391             :  * units.  The negative x coordinate value means the coordinate in the left
     392             :  * virtual screen from (0, 0), while the negative y coordinate value means the
     393             :  * coordinate in the upper virtual screen from (0, 0). If drawing on the
     394             :  * negative coordinate position, the drawing operation will not be visible.
     395             :  *
     396             :  * @param x Signed x-coordinate in 1/16 pixel precision
     397             :  * @param y Signed y-coordinate in 1/16 pixel precision
     398             :  */
     399           1 : #define VERTEX2F(x, y) FT8XX_VERTEX2F(x, y)
     400             : 
     401             : /**
     402             :  * @brief Start the operation of graphics primitive at the specified coordinates
     403             :  *
     404             :  * The valid range of @p handle is from 0 to 31. From 16 to 31 the bitmap handle
     405             :  * is dedicated to the FT8xx built-in font.
     406             :  *
     407             :  * Cell number is the index of bitmap with same bitmap layout and format.
     408             :  * For example, for handle 31, the cell 65 means the character "A" in the
     409             :  * largest built in font.
     410             :  *
     411             :  * @param x x-coordinate in pixels, from 0 to 511
     412             :  * @param y y-coordinate in pixels, from 0 to 511
     413             :  * @param handle Bitmap handle
     414             :  * @param cell Cell number
     415             :  */
     416           1 : #define VERTEX2II(x, y, handle, cell) FT8XX_VERTEX2II(x, y, handle, cell)
     417             : 
     418             : 
     419             : #if defined(CONFIG_FT800)
     420             : /** Main parts of FT800 memory map */
     421             : enum ft8xx_memory_map_t {
     422             :         RAM_G         = FT800_RAM_G,
     423             :         ROM_CHIPID    = FT800_ROM_CHIPID,
     424             :         ROM_FONT      = FT800_ROM_FONT,
     425             :         ROM_FONT_ADDR = FT800_ROM_FONT_ADDR,
     426             :         RAM_DL        = FT800_RAM_DL,
     427             :         RAM_PAL       = FT800_RAM_PAL,
     428             :         REG_          = FT800_REG_,
     429             :         RAM_CMD       = FT800_RAM_CMD
     430             : };
     431             : #else /* Definition of FT810 memory map */
     432             : /** Main parts of FT810 memory map */
     433           0 : enum ft8xx_memory_map_t {
     434             :         RAM_G         = FT810_RAM_G,
     435             :         RAM_DL        = FT810_RAM_DL,
     436             :         REG_          = FT810_REG_,
     437             :         RAM_CMD       = FT810_RAM_CMD
     438             : };
     439             : #endif
     440             : 
     441             : #if defined(CONFIG_FT800)
     442             : /** FT800 register addresses */
     443             : enum ft8xx_register_address_t {
     444             :         REG_ID         = FT800_REG_ID,
     445             :         REG_FRAMES     = FT800_REG_FRAMES,
     446             :         REG_CLOCK      = FT800_REG_CLOCK,
     447             :         REG_FREQUENCY  = FT800_REG_FREQUENCY,
     448             :         REG_RENDERMODE = FT800_REG_RENDERMODE,
     449             :         REG_SNAPY      = FT800_REG_SNAPY,
     450             :         REG_SNAPSHOT   = FT800_REG_SNAPSHOT,
     451             :         REG_CPURESET   = FT800_REG_CPURESET,
     452             :         REG_TAP_CRC    = FT800_REG_TAP_CRC,
     453             :         REG_TAP_MASK   = FT800_REG_TAP_MASK,
     454             :         REG_HCYCLE     = FT800_REG_HCYCLE,
     455             :         REG_HOFFSET    = FT800_REG_HOFFSET,
     456             :         REG_HSIZE      = FT800_REG_HSIZE,
     457             :         REG_HSYNC0     = FT800_REG_HSYNC0,
     458             :         REG_HSYNC1     = FT800_REG_HSYNC1,
     459             :         REG_VCYCLE     = FT800_REG_VCYCLE,
     460             :         REG_VOFFSET    = FT800_REG_VOFFSET,
     461             :         REG_VSIZE      = FT800_REG_VSIZE,
     462             :         REG_VSYNC0     = FT800_REG_VSYNC0,
     463             :         REG_VSYNC1     = FT800_REG_VSYNC1,
     464             :         REG_DLSWAP     = FT800_REG_DLSWAP,
     465             :         REG_ROTATE     = FT800_REG_ROTATE,
     466             :         REG_OUTBITS    = FT800_REG_OUTBITS,
     467             :         REG_DITHER     = FT800_REG_DITHER,
     468             :         REG_SWIZZLE    = FT800_REG_SWIZZLE,
     469             :         REG_CSPREAD    = FT800_REG_CSPREAD,
     470             :         REG_PCLK_POL   = FT800_REG_PCLK_POL,
     471             :         REG_PCLK       = FT800_REG_PCLK,
     472             :         REG_TAG_X      = FT800_REG_TAG_X,
     473             :         REG_TAG_Y      = FT800_REG_TAG_Y,
     474             :         REG_TAG        = FT800_REG_TAG,
     475             :         REG_VOL_PB     = FT800_REG_VOL_PB,
     476             :         REG_VOL_SOUND  = FT800_REG_VOL_SOUND,
     477             :         REG_SOUND      = FT800_REG_SOUND,
     478             :         REG_PLAY       = FT800_REG_PLAY,
     479             :         REG_GPIO_DIR   = FT800_REG_GPIO_DIR,
     480             :         REG_GPIO       = FT800_REG_GPIO,
     481             : 
     482             :         REG_INT_FLAGS  = FT800_REG_INT_FLAGS,
     483             :         REG_INT_EN     = FT800_REG_INT_EN,
     484             :         REG_INT_MASK   = FT800_REG_INT_MASK,
     485             :         REG_PLAYBACK_START = FT800_REG_PLAYBACK_START,
     486             :         REG_PLAYBACK_LENGTH = FT800_REG_PLAYBACK_LENGTH,
     487             :         REG_PLAYBACK_READPTR = FT800_REG_PLAYBACK_READPTR,
     488             :         REG_PLAYBACK_FREQ = FT800_REG_PLAYBACK_FREQ,
     489             :         REG_PLAYBACK_FORMAT = FT800_REG_PLAYBACK_FORMAT,
     490             :         REG_PLAYBACK_LOOP = FT800_REG_PLAYBACK_LOOP,
     491             :         REG_PLAYBACK_PLAY = FT800_REG_PLAYBACK_PLAY,
     492             :         REG_PWM_HZ     = FT800_REG_PWM_HZ,
     493             :         REG_PWM_DUTY   = FT800_REG_PWM_DUTY,
     494             :         REG_MACRO_0    = FT800_REG_MACRO_0,
     495             :         REG_MACRO_1    = FT800_REG_MACRO_1,
     496             : 
     497             :         REG_CMD_READ   = FT800_REG_CMD_READ,
     498             :         REG_CMD_WRITE  = FT800_REG_CMD_WRITE,
     499             :         REG_CMD_DL     = FT800_REG_CMD_DL,
     500             :         REG_TOUCH_MODE = FT800_REG_TOUCH_MODE,
     501             :         REG_TOUCH_ADC_MODE = FT800_REG_TOUCH_ADC_MODE,
     502             :         REG_TOUCH_CHARGE = FT800_REG_TOUCH_CHARGE,
     503             :         REG_TOUCH_SETTLE = FT800_REG_TOUCH_SETTLE,
     504             :         REG_TOUCH_OVERSAMPLE = FT800_REG_TOUCH_OVERSAMPLE,
     505             :         REG_TOUCH_RZTHRESH = FT800_REG_TOUCH_RZTHRESH,
     506             :         REG_TOUCH_RAW_XY = FT800_REG_TOUCH_RAW_XY,
     507             :         REG_TOUCH_RZ   = FT800_REG_TOUCH_RZ,
     508             :         REG_TOUCH_SCREEN_XY = FT800_REG_TOUCH_SCREEN_XY,
     509             :         REG_TOUCH_TAG_XY = FT800_REG_TOUCH_TAG_XY,
     510             :         REG_TOUCH_TAG  = FT800_REG_TOUCH_TAG,
     511             :         REG_TOUCH_TRANSFORM_A = FT800_REG_TOUCH_TRANSFORM_A,
     512             :         REG_TOUCH_TRANSFORM_B = FT800_REG_TOUCH_TRANSFORM_B,
     513             :         REG_TOUCH_TRANSFORM_C = FT800_REG_TOUCH_TRANSFORM_C,
     514             :         REG_TOUCH_TRANSFORM_D = FT800_REG_TOUCH_TRANSFORM_D,
     515             :         REG_TOUCH_TRANSFORM_E = FT800_REG_TOUCH_TRANSFORM_E,
     516             :         REG_TOUCH_TRANSFORM_F = FT800_REG_TOUCH_TRANSFORM_F,
     517             : 
     518             :         REG_TOUCH_DIRECT_XY = FT800_REG_TOUCH_DIRECT_XY,
     519             :         REG_TOUCH_DIRECT_Z1Z2 = FT800_REG_TOUCH_DIRECT_Z1Z2,
     520             : 
     521             :         REG_TRACKER    = FT800_REG_TRACKER
     522             : };
     523             : #else /* Definition of FT810 registers */
     524             : /** FT810 register addresses */
     525           0 : enum ft8xx_register_address_t {
     526             :         REG_TRIM       = FT810_REG_TRIM,
     527             : 
     528             :         REG_ID         = FT810_REG_ID,
     529             :         REG_FRAMES     = FT810_REG_FRAMES,
     530             :         REG_CLOCK      = FT810_REG_CLOCK,
     531             :         REG_FREQUENCY  = FT810_REG_FREQUENCY,
     532             :         REG_RENDERMODE = FT810_REG_RENDERMODE,
     533             :         REG_SNAPY      = FT810_REG_SNAPY,
     534             :         REG_SNAPSHOT   = FT810_REG_SNAPSHOT,
     535             :         REG_CPURESET   = FT810_REG_CPURESET,
     536             :         REG_TAP_CRC    = FT810_REG_TAP_CRC,
     537             :         REG_TAP_MASK   = FT810_REG_TAP_MASK,
     538             :         REG_HCYCLE     = FT810_REG_HCYCLE,
     539             :         REG_HOFFSET    = FT810_REG_HOFFSET,
     540             :         REG_HSIZE      = FT810_REG_HSIZE,
     541             :         REG_HSYNC0     = FT810_REG_HSYNC0,
     542             :         REG_HSYNC1     = FT810_REG_HSYNC1,
     543             :         REG_VCYCLE     = FT810_REG_VCYCLE,
     544             :         REG_VOFFSET    = FT810_REG_VOFFSET,
     545             :         REG_VSIZE      = FT810_REG_VSIZE,
     546             :         REG_VSYNC0     = FT810_REG_VSYNC0,
     547             :         REG_VSYNC1     = FT810_REG_VSYNC1,
     548             :         REG_DLSWAP     = FT810_REG_DLSWAP,
     549             :         REG_ROTATE     = FT810_REG_ROTATE,
     550             :         REG_OUTBITS    = FT810_REG_OUTBITS,
     551             :         REG_DITHER     = FT810_REG_DITHER,
     552             :         REG_SWIZZLE    = FT810_REG_SWIZZLE,
     553             :         REG_CSPREAD    = FT810_REG_CSPREAD,
     554             :         REG_PCLK_POL   = FT810_REG_PCLK_POL,
     555             :         REG_PCLK       = FT810_REG_PCLK,
     556             :         REG_TAG_X      = FT810_REG_TAG_X,
     557             :         REG_TAG_Y      = FT810_REG_TAG_Y,
     558             :         REG_TAG        = FT810_REG_TAG,
     559             :         REG_VOL_PB     = FT810_REG_VOL_PB,
     560             :         REG_VOL_SOUND  = FT810_REG_VOL_SOUND,
     561             :         REG_SOUND      = FT810_REG_SOUND,
     562             :         REG_PLAY       = FT810_REG_PLAY,
     563             :         REG_GPIO_DIR   = FT810_REG_GPIO_DIR,
     564             :         REG_GPIO       = FT810_REG_GPIO,
     565             :         REG_GPIOX_DIR  = FT810_REG_GPIOX_DIR,
     566             :         REG_GPIOX      = FT810_REG_GPIOX,
     567             : 
     568             :         REG_INT_FLAGS  = FT810_REG_INT_FLAGS,
     569             :         REG_INT_EN     = FT810_REG_INT_EN,
     570             :         REG_INT_MASK   = FT810_REG_INT_MASK,
     571             :         REG_PLAYBACK_START = FT810_REG_PLAYBACK_START,
     572             :         REG_PLAYBACK_LENGTH = FT810_REG_PLAYBACK_LENGTH,
     573             :         REG_PLAYBACK_READPTR = FT810_REG_PLAYBACK_READPTR,
     574             :         REG_PLAYBACK_FREQ = FT810_REG_PLAYBACK_FREQ,
     575             :         REG_PLAYBACK_FORMAT = FT810_REG_PLAYBACK_FORMAT,
     576             :         REG_PLAYBACK_LOOP = FT810_REG_PLAYBACK_LOOP,
     577             :         REG_PLAYBACK_PLAY = FT810_REG_PLAYBACK_PLAY,
     578             :         REG_PWM_HZ     = FT810_REG_PWM_HZ,
     579             :         REG_PWM_DUTY   = FT810_REG_PWM_DUTY,
     580             : 
     581             :         REG_CMD_READ   = FT810_REG_CMD_READ,
     582             :         REG_CMD_WRITE  = FT810_REG_CMD_WRITE,
     583             :         REG_CMD_DL     = FT810_REG_CMD_DL,
     584             :         REG_TOUCH_MODE = FT810_REG_TOUCH_MODE,
     585             :         REG_TOUCH_ADC_MODE = FT810_REG_TOUCH_ADC_MODE,
     586             :         REG_TOUCH_CHARGE = FT810_REG_TOUCH_CHARGE,
     587             :         REG_TOUCH_SETTLE = FT810_REG_TOUCH_SETTLE,
     588             :         REG_TOUCH_OVERSAMPLE = FT810_REG_TOUCH_OVERSAMPLE,
     589             :         REG_TOUCH_RZTHRESH = FT810_REG_TOUCH_RZTHRESH,
     590             :         REG_TOUCH_RAW_XY = FT810_REG_TOUCH_RAW_XY,
     591             :         REG_TOUCH_RZ   = FT810_REG_TOUCH_RZ,
     592             :         REG_TOUCH_SCREEN_XY = FT810_REG_TOUCH_SCREEN_XY,
     593             :         REG_TOUCH_TAG_XY = FT810_REG_TOUCH_TAG_XY,
     594             :         REG_TOUCH_TAG  = FT810_REG_TOUCH_TAG,
     595             :         REG_TOUCH_TRANSFORM_A = FT810_REG_TOUCH_TRANSFORM_A,
     596             :         REG_TOUCH_TRANSFORM_B = FT810_REG_TOUCH_TRANSFORM_B,
     597             :         REG_TOUCH_TRANSFORM_C = FT810_REG_TOUCH_TRANSFORM_C,
     598             :         REG_TOUCH_TRANSFORM_D = FT810_REG_TOUCH_TRANSFORM_D,
     599             :         REG_TOUCH_TRANSFORM_E = FT810_REG_TOUCH_TRANSFORM_E,
     600             :         REG_TOUCH_TRANSFORM_F = FT810_REG_TOUCH_TRANSFORM_F,
     601             :         REG_TOUCH_CONFIG = FT810_REG_TOUCH_CONFIG,
     602             : 
     603             :         REG_SPI_WIDTH  = FT810_REG_SPI_WIDTH,
     604             : 
     605             :         REG_TOUCH_DIRECT_XY = FT810_REG_TOUCH_DIRECT_XY,
     606             :         REG_TOUCH_DIRECT_Z1Z2 = FT810_REG_TOUCH_DIRECT_Z1Z2,
     607             : 
     608             :         REG_CMDB_SPACE = FT810_REG_CMDB_SPACE,
     609             :         REG_CMDB_WRITE = FT810_REG_CMDB_WRITE,
     610             : 
     611             :         REG_TRACKER    = FT810_REG_TRACKER,
     612             :         REG_TRACKER1   = FT810_REG_TRACKER1,
     613             :         REG_TRACKER2   = FT810_REG_TRACKER2,
     614             :         REG_TRACKER3   = FT810_REG_TRACKER3,
     615             :         REG_TRACKER4   = FT810_REG_TRACKER4,
     616             :         REG_MEDIAFIFO_READ = FT810_REG_MEDIAFIFO_READ,
     617             :         REG_MEDIAFIFO_WRITE = FT810_REG_MEDIAFIFO_WRITE,
     618             : };
     619             : #endif
     620             : 
     621             : /**
     622             :  * @}
     623             :  */
     624             : 
     625             : #ifdef __cplusplus
     626             : }
     627             : #endif
     628             : 
     629             : #endif /* ZEPHYR_DRIVERS_MISC_FT8XX_FT8XX_REFERENCE_API_H_ */

Generated by: LCOV version 1.14