From acfa53fc5c7cfff5e411dcc32f3d837af4370abb Mon Sep 17 00:00:00 2001 From: Tau Date: Thu, 8 Nov 2018 14:45:55 -0500 Subject: [PATCH] board/slider-cmd.h: Add commands for touch slider PCB --- board/meson.build | 1 + board/slider-cmd.h | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 board/slider-cmd.h diff --git a/board/meson.build b/board/meson.build index 0c515fc..003b4f1 100644 --- a/board/meson.build +++ b/board/meson.build @@ -9,6 +9,7 @@ board_lib = static_library( sources : [ 'io3.c', 'io3.h', + 'slider-cmd.h', 'slider-frame.c', 'slider-frame.h', ], diff --git a/board/slider-cmd.h b/board/slider-cmd.h new file mode 100644 index 0000000..8a19ca7 --- /dev/null +++ b/board/slider-cmd.h @@ -0,0 +1,36 @@ +#pragma once + +#include "board/slider-frame.h" + +enum { + SLIDER_CMD_AUTO_SCAN = 0x01, + SLIDER_CMD_SET_LED = 0x02, + SLIDER_CMD_AUTO_SCAN_START = 0x03, + SLIDER_CMD_AUTO_SCAN_STOP = 0x04, + SLIDER_CMD_RESET = 0x10, + SLIDER_CMD_GET_BOARD_INFO = 0xF0, +}; + +struct slider_req_set_led { + struct slider_hdr hdr; + struct { + uint8_t unk; /* 0x28, decimal 40. meaning unknown. */ + uint8_t rgb[32][3]; + } payload; +}; + +union slider_req_any { + struct slider_hdr hdr; + struct slider_req_set_led set_led; + uint8_t bytes[260]; +}; + +struct slider_resp_get_board_info { + struct slider_hdr hdr; + char version[32]; +}; + +struct slider_resp_auto_scan { + struct slider_hdr hdr; + uint8_t pressure[32]; +};