rmi/fuze+: add product info in the debug screen

Change-Id: Id06dbe0909e37587a45a2ebf5b0beab93cd44f61
This commit is contained in:
Amaury Pouly 2013-12-08 11:12:39 +01:00
parent b69ea1873d
commit b163fb9eac
3 changed files with 13 additions and 7 deletions

View file

@ -26,6 +26,8 @@
#define RMI_DEVICE_CONTROL 0x0 /* $0000 */
#define RMI_INTERRUPT_ENABLE 0x1 /* $0001 */
#define RMI_INTERRUPT_REQUEST 0x3 /* $0003 */
#define RMI_PRODUCT_INFO 0x204 /* $0204 */
#define RMI_PRODUCT_INFO_LEN 4
#define RMI_PRODUCT_ID 0x210 /* $0210 */
#define RMI_PRODUCT_ID_LEN 16
#define RMI_2D_TOUCHPAD_FUNCTION 0x10

View file

@ -947,6 +947,7 @@ bool dbg_hw_info(void)
lcd_update();
yield();
}
return false;
}
bool dbg_ports(void)

View file

@ -36,10 +36,13 @@ bool button_debug_screen(void)
{
char product_id[RMI_PRODUCT_ID_LEN];
rmi_read(RMI_PRODUCT_ID, RMI_PRODUCT_ID_LEN, product_id);
uint8_t product_info[RMI_PRODUCT_INFO_LEN];
rmi_read(RMI_PRODUCT_INFO, RMI_PRODUCT_INFO_LEN, product_info);
char product_info_str[RMI_PRODUCT_INFO_LEN * 2 + 1];
for(int i = 0; i < RMI_PRODUCT_INFO_LEN; i++)
snprintf(product_info_str + 2 * i, 3, "%02x", product_info[i]);
int x_max = rmi_read_single(RMI_2D_SENSOR_XMAX_MSB(0)) << 8 | rmi_read_single(RMI_2D_SENSOR_XMAX_LSB(0));
int y_max = rmi_read_single(RMI_2D_SENSOR_YMAX_MSB(0)) << 8 | rmi_read_single(RMI_2D_SENSOR_YMAX_LSB(0));
int func_presence = rmi_read_single(RMI_FUNCTION_PRESENCE(RMI_2D_TOUCHPAD_FUNCTION));
int sensor_prop = rmi_read_single(RMI_2D_SENSOR_PROP2(0));
int sensor_resol = rmi_read_single(RMI_2D_SENSOR_RESOLUTION(0));
int min_dist = rmi_read_single(RMI_2D_MIN_DIST);
int gesture_settings = rmi_read_single(RMI_2D_GESTURE_SETTINGS);
@ -78,7 +81,7 @@ bool button_debug_screen(void)
lcd_clear_display();
int btns = button_read_device();
lcd_putsf(0, 0, "button bitmap: %x", btns);
lcd_putsf(0, 1, "RMI: id=%s p=%x s=%x", product_id, func_presence, sensor_prop);
lcd_putsf(0, 1, "RMI: id=%s info=%s", product_id, product_info_str);
lcd_putsf(0, 2, "xmax=%d ymax=%d res=%d", x_max, y_max, sensor_resol);
lcd_putsf(0, 3, "attn=%d ctl=%x int=%x",
imx233_pinctrl_get_gpio(0, 27) ? 0 : 1,