From 59a147dc188328825f015bf1ba558411cc75ae31 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Mon, 15 Jul 2019 14:03:50 +0200 Subject: [PATCH] LED Matrix pin mappings moved to hal file --- src/hal/wemos32oled.h | 27 --------------------------- src/hal/wemosLEDMatrix.h | 30 ++++++++++++++++++++++++++++++ src/paxcounter.conf | 19 +------------------ 3 files changed, 31 insertions(+), 45 deletions(-) create mode 100644 src/hal/wemosLEDMatrix.h diff --git a/src/hal/wemos32oled.h b/src/hal/wemos32oled.h index 49911a37..3b59e450 100644 --- a/src/hal/wemos32oled.h +++ b/src/hal/wemos32oled.h @@ -7,41 +7,14 @@ #include -// Hardware related definitions for TTGO T-Beam board -// (only) for older T-Beam version T22_V05 eternal wiring LORA_IO1 to GPIO33 is needed! -// -// pinouts taken from http://tinymicros.com/wiki/TTGO_T-Beam - #define HAS_LED NOT_A_PIN // no LED -//#define HAS_LORA 1 // comment out if device shall not send data via LoRa -//#define CFG_sx1276_radio 1 // HPD13A LoRa SoC -//#define BOARD_HAS_PSRAM // use extra 4MB external RAM -//#define HAS_BUTTON GPIO_NUM_39 // on board button (next to reset) -//#define BAT_MEASURE_ADC ADC1_GPIO35_CHANNEL // battery probe GPIO pin -> ADC1_CHANNEL_7 -//#define BAT_VOLTAGE_DIVIDER 2 // voltage divider 100k/100k on board - -// GPS settings -//#define HAS_GPS 1 // use on board GPS -//#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 // UBlox NEO 6M -//#define GPS_INT GPIO_NUM_34 // 30ns accurary timepulse, to be external wired on pcb: NEO 6M Pin#3 -> GPIO34 - -// enable only if device has these sensors, otherwise comment these lines -// BME680 sensor on I2C bus -//#define HAS_BME 1 // Enable BME sensors in general -//#define HAS_BME680 SDA, SCL -//#define BME680_ADDR BME680_I2C_ADDR_PRIMARY // !! connect SDIO of BME680 to GND !! - -// display (if connected) #define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C #define MY_OLED_SDA (5) #define MY_OLED_SCL (4) #define MY_OLED_RST U8X8_PIN_NONE #define DISPLAY_FLIP 1 // use if display is rotated -// user defined sensors (if connected) -//#define HAS_SENSORS 1 // comment out if device has user defined sensors - #define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature #endif diff --git a/src/hal/wemosLEDMatrix.h b/src/hal/wemosLEDMatrix.h new file mode 100644 index 00000000..fbe0c04b --- /dev/null +++ b/src/hal/wemosLEDMatrix.h @@ -0,0 +1,30 @@ +// clang-format off +// upload_speed 921600 +// board lolin32 + +#ifndef _WEMOS32LEDMATRIX_H +#define _WEMOS32LEDMATRIX_H + +#include + +#define HAS_LED NOT_A_PIN // no LED + +// LED Matrix display settings +#define HAS_MATRIX_DISPLAY 1 // Uncomment to enable LED matrix display output +#define LED_MATRIX_WIDTH 64 // Width in pixels (LEDs) of your display +#define LED_MATRIX_HEIGHT 16 // Height in pixels (LEDs ) of your display + +// Pin numbers work fine for Wemos Lolin32 board (all used pins are on 1 side of the board) +#define MATRIX_DISPLAY_SCAN_US 500 // Matrix display scan rate in microseconds (1ms is about 'acceptable') +#define LED_MATRIX_LATCHPIN 13 // Connects to LAT pin on display (Latch) +#define LED_MATRIX_CLOCKPIN 32 // Connects to CLK pin on display (Clock) +#define LED_MATRIX_EN_74138 12 // Connects to EN pin on display (Output Enable) +#define LED_MATRIX_LA_74138 14 // Connects to LA pin on display +#define LED_MATRIX_LB_74138 27 // Connects to LB pin on display +#define LED_MATRIX_LC_74138 25 // Connects to LC pin on display +#define LED_MATRIX_LD_74138 26 // Connects to LD pin on display +#define LED_MATRIX_DATA_R1 33 // Connects to R1 pin on display + +#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature + +#endif \ No newline at end of file diff --git a/src/paxcounter.conf b/src/paxcounter.conf index 395f7c79..13b6c0b7 100644 --- a/src/paxcounter.conf +++ b/src/paxcounter.conf @@ -106,21 +106,4 @@ #define CAYENNE_ACTUATOR 10 // actuator commands #define CAYENNE_DEVICECONFIG 11 // device period configuration #define CAYENNE_SENSORREAD 13 // sensor period configuration -#define CAYENNE_SENSORENABLE 14 // sensor enable configuration - -// LED Matrix display settings. -// Note: LED Matrix will only show number of found devices, no other information will be shown for now -//#define HAS_MATRIX_DISPLAY 1 // Uncomment to enable LED matrix display output -#define LED_MATRIX_WIDTH 64 // Width in pixels (LEDs) of your display -#define LED_MATRIX_HEIGHT 16 // Height in pixels (LEDs ) of your display - -// Pin numbers work fine for Wemos Lolin32 board (all used pins are on 1 side of the board) -#define MATRIX_DISPLAY_SCAN_US 500 // Matrix display scan rate in microseconds (1ms is about 'acceptable') -#define LED_MATRIX_LATCHPIN 13 // Connects to LAT pin on display -#define LED_MATRIX_CLOCKPIN 32 // Connects to CLK pin on display -#define LED_MATRIX_EN_74138 12 // Connects to OE pin on display -#define LED_MATRIX_LA_74138 14 // Connects to LA pin on display -#define LED_MATRIX_LB_74138 27 // Connects to LB pin on display -#define LED_MATRIX_LC_74138 25 // Connects to LC pin on display -#define LED_MATRIX_LD_74138 26 // Connects to LD pin on display -#define LED_MATRIX_DATA_R1 33 // Connects to R1 pin on display \ No newline at end of file +#define CAYENNE_SENSORENABLE 14 // sensor enable configuration \ No newline at end of file