ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_touch_gt911_regs.h File Reference

Register layout for the GoodIX GT911 capacitive touch controller. More...

#include <stdint.h>
Include dependency graph for ra8_touch_gt911_regs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  ra8_touch_gt911_addr_t : uint8_t {
  k_ra8_touch_gt911_addr_low = 0x5DU ,
  k_ra8_touch_gt911_addr_high = 0x14U
}
 I2C target addresses for the GT911. More...
enum  ra8_touch_gt911_reg_t : uint16_t {
  k_ra8_touch_gt911_reg_command = 0x8040U ,
  k_ra8_touch_gt911_reg_config = 0x8047U ,
  k_ra8_touch_gt911_reg_product = 0x8140U ,
  k_ra8_touch_gt911_reg_firmware = 0x8144U ,
  k_ra8_touch_gt911_reg_xres = 0x8146U ,
  k_ra8_touch_gt911_reg_yres = 0x8148U ,
  k_ra8_touch_gt911_reg_status = 0x814EU ,
  k_ra8_touch_gt911_reg_point0 = 0x814FU
}
 16-bit register pointers used by the driver. More...
enum  ra8_touch_gt911_cmd_t : uint8_t {
  k_ra8_touch_gt911_cmd_clear_status = 0x00U ,
  k_ra8_touch_gt911_cmd_software_reset = 0x02U
}
 Values written into k_ra8_touch_gt911_reg_command. More...
enum  ra8_touch_gt911_status_mask_t : uint8_t {
  k_ra8_touch_gt911_status_count_mask = 0x0FU ,
  k_ra8_touch_gt911_status_large_mask = 0x40U ,
  k_ra8_touch_gt911_status_ready_mask = 0x80U
}
 Bit layout of the status byte at k_ra8_touch_gt911_reg_status. More...
enum  ra8_touch_gt911_geometry_t : uint8_t {
  k_ra8_touch_gt911_max_points = 5U ,
  k_ra8_touch_gt911_point_bytes = 8U ,
  k_ra8_touch_gt911_id_bytes = 4U ,
  k_ra8_touch_gt911_reg_ptr_bytes = 2U
}
 Compile-time geometry constants for the controller. More...
enum  ra8_touch_gt911_point_offset_t : uint8_t {
  k_ra8_touch_gt911_point_off_track = 0U ,
  k_ra8_touch_gt911_point_off_x_lsb = 1U ,
  k_ra8_touch_gt911_point_off_x_msb = 2U ,
  k_ra8_touch_gt911_point_off_y_lsb = 3U ,
  k_ra8_touch_gt911_point_off_y_msb = 4U ,
  k_ra8_touch_gt911_point_off_size_lsb = 5U ,
  k_ra8_touch_gt911_point_off_size_msb = 6U ,
  k_ra8_touch_gt911_point_off_reserved = 7U
}
 Byte offsets of each field inside one 8-byte point record. More...

Detailed Description

Register layout for the GoodIX GT911 capacitive touch controller.

Tag
[Ring 3 / HAL] {World: NS}

The GT911 is a 5-point projected-capacitive touch IC commonly paired with parallel TFT panels in the 5"-10" size range. It is the touch backend for the EK-RA8D2 ereader carrier this project targets, sitting on the I2C0 bus alongside other low-speed peripherals.

Address space (16-bit register pointers):

Offset Name Width Purpose
0x8040 GTP_COMMAND 8 Command (0x00 sleep, 0x01 wake)
0x8047 CONFIG_VERSION 8 First byte of config block
0x8140 PRODUCT_ID (4 char) 32 "911"\0 ASCII id
0x8144 FIRMWARE_VERSION 16 Little-endian firmware revision
0x8146 X_RESOLUTION 16 Reported panel X resolution
0x8148 Y_RESOLUTION 16 Reported panel Y resolution
0x814E STATUS 8 bit7 buffer-ready, bits[3:0] cnt
0x814F POINT[0..4] base 8x5 Five 8-byte point records

Per-point record (8 bytes, little-endian for the 16-bit fields):

Off Field Notes
0 track_id Persistent contact id, 0..15
1 x_lsb X coordinate low byte
2 x_msb X coordinate high byte
3 y_lsb Y coordinate low byte
4 y_msb Y coordinate high byte
5 size_lsb Contact area size low byte (pressure)
6 size_msb Contact area size high byte
7 reserved Always 0

Cross-checked against GoodIX "GT911 Programming Guide" rev 0.1 (publicly distributed reference; this project does not vendor the document).

Definition in file ra8_touch_gt911_regs.h.

Enumeration Type Documentation

◆ ra8_touch_gt911_addr_t

enum ra8_touch_gt911_addr_t : uint8_t

I2C target addresses for the GT911.

The GT911 latches its 7-bit address from the INT pin level at reset: INT low yields 0x5D, INT high yields 0x14. The factory default on the EK-RA8D2 ereader carrier is 0x5D.

Enumerator
k_ra8_touch_gt911_addr_low 

Default 7-bit target address.

k_ra8_touch_gt911_addr_high 

Alternate 7-bit target address.

Definition at line 66 of file ra8_touch_gt911_regs.h.

◆ ra8_touch_gt911_cmd_t

enum ra8_touch_gt911_cmd_t : uint8_t

Values written into k_ra8_touch_gt911_reg_command.

Enumerator
k_ra8_touch_gt911_cmd_clear_status 

Acknowledge a touch frame.

k_ra8_touch_gt911_cmd_software_reset 

Soft reset.

Definition at line 90 of file ra8_touch_gt911_regs.h.

◆ ra8_touch_gt911_geometry_t

Compile-time geometry constants for the controller.

Enumerator
k_ra8_touch_gt911_max_points 

Max simultaneous contacts.

k_ra8_touch_gt911_point_bytes 

Bytes per per-point record.

k_ra8_touch_gt911_id_bytes 

Length of PRODUCT_ID payload.

k_ra8_touch_gt911_reg_ptr_bytes 

16-bit register-pointer width.

Definition at line 109 of file ra8_touch_gt911_regs.h.

◆ ra8_touch_gt911_point_offset_t

Byte offsets of each field inside one 8-byte point record.

Enumerator
k_ra8_touch_gt911_point_off_track 

track_id field.

k_ra8_touch_gt911_point_off_x_lsb 

X low byte.

k_ra8_touch_gt911_point_off_x_msb 

X high byte.

k_ra8_touch_gt911_point_off_y_lsb 

Y low byte.

k_ra8_touch_gt911_point_off_y_msb 

Y high byte.

k_ra8_touch_gt911_point_off_size_lsb 

Size low byte.

k_ra8_touch_gt911_point_off_size_msb 

Size high byte.

k_ra8_touch_gt911_point_off_reserved 

Always 0.

Definition at line 120 of file ra8_touch_gt911_regs.h.

◆ ra8_touch_gt911_reg_t

enum ra8_touch_gt911_reg_t : uint16_t

16-bit register pointers used by the driver.

Enumerator
k_ra8_touch_gt911_reg_command 

Command register.

k_ra8_touch_gt911_reg_config 

First byte of config block.

k_ra8_touch_gt911_reg_product 

4-byte product id.

k_ra8_touch_gt911_reg_firmware 

Firmware revision.

k_ra8_touch_gt911_reg_xres 

Reported X resolution.

k_ra8_touch_gt911_reg_yres 

Reported Y resolution.

k_ra8_touch_gt911_reg_status 

Status / point-count byte.

k_ra8_touch_gt911_reg_point0 

First per-point record.

Definition at line 75 of file ra8_touch_gt911_regs.h.

◆ ra8_touch_gt911_status_mask_t

Bit layout of the status byte at k_ra8_touch_gt911_reg_status.

Enumerator
k_ra8_touch_gt911_status_count_mask 

bits[3:0] active touch count.

k_ra8_touch_gt911_status_large_mask 

bit6 large-detect.

k_ra8_touch_gt911_status_ready_mask 

bit7 buffer-ready.

Definition at line 99 of file ra8_touch_gt911_regs.h.