From 67e3b4d0ac22975fe052558acd175a1f7a80eac6 Mon Sep 17 00:00:00 2001 From: James Devine Date: Tue, 27 Apr 2021 12:59:04 +0100 Subject: [PATCH] add initial touch test module --- targets/jm-touch-test-35-1.0/board.h | 31 ++++++++++++++++++++ targets/jm-touch-test-35-1.0/config.mk | 2 ++ targets/jm-touch-test-35-1.0/profile/touch.c | 9 ++++++ 3 files changed, 42 insertions(+) create mode 100644 targets/jm-touch-test-35-1.0/board.h create mode 100644 targets/jm-touch-test-35-1.0/config.mk create mode 100644 targets/jm-touch-test-35-1.0/profile/touch.c diff --git a/targets/jm-touch-test-35-1.0/board.h b/targets/jm-touch-test-35-1.0/board.h new file mode 100644 index 0000000..9219854 --- /dev/null +++ b/targets/jm-touch-test-35-1.0/board.h @@ -0,0 +1,31 @@ +#define PIN_LED PA_1 +#define PIN_LED_GND -1 + +// RGB LED sink connected to these pins +#define PIN_LED_R PA_10 +#define PIN_LED_G PA_9 +#define PIN_LED_B PB_1 + +// these values calibrate to ~60lux for each of ff0000, 00ff00, 0000ff +#define LED_R_MULT 250 +#define LED_G_MULT 150 +#define LED_B_MULT 42 +#define RGB_LED_PERIOD 600 + +#define PIN_BL_LED PIN_LED_B +#define PIN_BL_PERIOD 300 + +#define PIN_TOUCH0 PA_4 +#define PIN_TOUCH1 PA_5 + +#define PIN_PWR -1 +#define PIN_P0 -1 +#define PIN_P1 -1 + +// #define PIN_SDA PA_10 +// #define PIN_SCL PA_9 +// #define I2C_AF LL_GPIO_AF_4 + +#define UART_PIN PA_2 +#define UART_PIN_AF LL_GPIO_AF_1 +#define USART_IDX 1 diff --git a/targets/jm-touch-test-35-1.0/config.mk b/targets/jm-touch-test-35-1.0/config.mk new file mode 100644 index 0000000..f12bb49 --- /dev/null +++ b/targets/jm-touch-test-35-1.0/config.mk @@ -0,0 +1,2 @@ +MCU = STM32F030x4 +include $(PLATFORM)/mk/stm32f0.mk diff --git a/targets/jm-touch-test-35-1.0/profile/touch.c b/targets/jm-touch-test-35-1.0/profile/touch.c new file mode 100644 index 0000000..7f32566 --- /dev/null +++ b/targets/jm-touch-test-35-1.0/profile/touch.c @@ -0,0 +1,9 @@ +#include "jdprofile.h" + +FIRMWARE_IDENTIFIER(0x375c4bf6, "JM Touch Test v1.0"); + + +void app_init_services() { + touch_init(PIN_TOUCH0); + touch_init(PIN_TOUCH1); +}