ESP32-PaxCounter/src/hal/ttgobeam10.h

81 lines
2.3 KiB
C
Raw Normal View History

2019-09-02 18:17:37 +02:00
// clang-format off
// upload_speed 921600
// board ttgo-t-beam
#ifndef _TTGOBEAM_H
#define _TTGOBEAM_H
#include <stdint.h>
/*
Hardware related definitions for TTGO T-Beam board
2020-06-19 14:10:40 +02:00
for T-Beam version T22_V10 + T22_V11
pinouts taken from https://github.com/lewisxhe/TTGO-T-Beam
/// Button functions: ///
2020-12-06 19:59:19 +01:00
Power, short press -> set device on / while device is on: goto sleep
2020-12-24 16:54:20 +01:00
Power, long press -> set device off
User, short press -> flip display page
User, long press -> send a button message
Reset -> reset device
*/
2021-05-07 19:41:36 +02:00
#define HAS_DISPLAY 1
#define MY_DISPLAY_SDA SDA
#define MY_DISPLAY_SCL SCL
#define MY_DISPLAY_RST NOT_A_PIN
//#define MY_DISPLAY_FLIP 1 // use if display is rotated
2019-09-02 18:17:37 +02:00
#define HAS_LORA 1 // comment out if device shall not send data via LoRa
#define CFG_sx1276_radio 1 // HPD13A LoRa SoC
2019-09-09 20:33:29 +02:00
#define HAS_BUTTON GPIO_NUM_38 // middle on board button
2020-12-06 19:59:19 +01:00
#define HAS_LED GPIO_NUM_4 // not present on all T-Beam 1.0 boards
#define LED_ACTIVE_LOW 1
2019-09-02 18:17:37 +02:00
2020-05-09 22:49:00 +02:00
// power management settings
#define HAS_PMU 1 // has AXP192 chip
2022-08-17 19:05:41 +02:00
#define XPOWERS_CHIP_AXP192 1
2020-05-09 22:49:00 +02:00
#define PMU_INT GPIO_NUM_35 // battery interrupt
2022-09-17 18:34:30 +02:00
#define PMU_CHG_CURRENT XPOWERS_AXP192_CHG_CUR_1000MA // battery charge current
2020-05-09 22:49:00 +02:00
// possible values (mA):
// 100/190/280/360/450/550/630/700/780/880/960/1000/1080/1160/1240/1320
2022-09-17 18:34:30 +02:00
#define PMU_CHG_CUTOFF XPOWERS_AXP192_CHG_VOL_4V2 // battery charge cutoff
2020-05-09 22:49:00 +02:00
// possible values (V):
2022-08-17 19:05:41 +02:00
// 4V1/4V15/4V2/4V36
2020-12-18 18:40:26 +01:00
2019-09-02 18:17:37 +02:00
// GPS settings
#define HAS_GPS 1 // use on board GPS
#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_34, GPIO_NUM_12 // UBlox NEO 6M
2019-09-09 20:33:29 +02:00
#define GPS_INT GPIO_NUM_37 // 30ns accurary timepulse generated by NEO 6M Pin #3
2019-09-02 18:17:37 +02:00
// enable only if device has these sensors, otherwise comment these lines
// BME680 sensor on I2C bus
2020-12-18 18:40:26 +01:00
//#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 !!
2019-09-02 18:17:37 +02:00
//#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature
#endif
/*
2020-06-19 14:10:40 +02:00
// T-Beam V10/V11 has on board power management by AXP192 PMU chip:
//
// DCDC1 0.7-3.5V @ 1200mA -> OLED
// DCDC3 0.7-3.5V @ 700mA -> ESP32 (keep this on!)
// LDO1 30mA -> GPS Backup
// LDO2 200mA -> LORA
// LDO3 200mA -> GPS
// Wiring for I2C OLED display:
//
// Signal Header OLED
// 3V3 7 VCC
// GND 8 GND
// IO22(SCL) 9 SCL
// IO21(SDA) 10 SDA
//
*/