Radiomaster T8 (#8219)

This commit is contained in:
3djc
2021-01-15 17:19:25 +01:00
committed by GitHub
parent c139c6eefd
commit 1f01fa6d47
79 changed files with 1051 additions and 143 deletions
+31 -6
View File
@@ -27,8 +27,8 @@
#include "board_common.h"
#include "hal.h"
#if defined(RADIO_TX12)
#define NAVIGATION_X7_TX12
#if defined(RADIO_TX12) || defined(RADIO_TX12)
#define NAVIGATION_X7_TX12
#endif
#if defined(ROTARY_ENCODER_NAVIGATION)
@@ -152,7 +152,7 @@ void extmoduleSendInvertedByte(uint8_t byte);
// Trainer driver
#define SLAVE_MODE() (g_model.trainerData.mode == TRAINER_MODE_SLAVE)
#if defined(PCBX9D) || (defined(PCBX9DP) && PCBREV < 2019)
#if defined(TRAINER_DETECT_GPIO)
// Trainer detect is a switch on the jack
#define TRAINER_CONNECTED() (GPIO_ReadInputDataBit(TRAINER_DETECT_GPIO, TRAINER_DETECT_GPIO_PIN) == Bit_RESET)
#elif defined(PCBXLITES)
@@ -270,6 +270,10 @@ enum EnumKeys
KEY_COUNT,
KEY_MAX = KEY_COUNT - 1,
#if defined(KEYS_GPIO_REG_BIND)
KEY_BIND,
#endif
#if defined(ROTARY_ENCODER_NAVIGATION)
KEY_PLUS,
KEY_MINUS,
@@ -355,7 +359,7 @@ enum EnumSwitchesPositions
SW_SE1,
SW_SE2,
#endif
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) || defined(PCBX7) || defined(PCBXLITES) || defined(PCBX9LITES)
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) || defined(PCBX7) || defined(PCBXLITES) || defined(PCBX9LITES) || defined(RADIO_T8)
SW_SF0,
SW_SF1,
SW_SF2,
@@ -365,7 +369,7 @@ enum EnumSwitchesPositions
SW_SG1,
SW_SG2,
#endif
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) || (defined(PCBX7) && !defined(RADIO_TX12))
#if defined(PCBX9D) || defined(PCBX9DP) || defined(PCBX9E) || (defined(PCBX7) && !defined(RADIO_TX12)) || defined(RADIO_T8)
SW_SH0,
SW_SH1,
SW_SH2,
@@ -442,6 +446,11 @@ enum EnumSwitchesPositions
#define STORAGE_NUM_SWITCHES NUM_SWITCHES
#define DEFAULT_SWITCH_CONFIG (SWITCH_3POS << 10) + (SWITCH_3POS << 8) + (SWITCH_TOGGLE << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_TOGGLE << 0)
#define DEFAULT_POTS_CONFIG (POT_WITH_DETENT << 0) + (POT_WITH_DETENT << 2);
#elif defined(RADIO_T8)
#define NUM_SWITCHES 4
#define STORAGE_NUM_SWITCHES 8
#define DEFAULT_SWITCH_CONFIG (SWITCH_2POS << 6) + (SWITCH_3POS << 4) + (SWITCH_3POS << 2) + (SWITCH_2POS << 0);
#define DEFAULT_POTS_CONFIG (0)
#elif defined(PCBX7ACCESS)
#define NUM_SWITCHES 7
#define STORAGE_NUM_SWITCHES 8
@@ -544,6 +553,11 @@ enum Analogs {
#define NUM_SLIDERS 0
#define STORAGE_NUM_POTS 1
#define STORAGE_NUM_SLIDERS 0
#elif defined(RADIO_T8)
#define NUM_POTS 0
#define NUM_SLIDERS 0
#define STORAGE_NUM_POTS 2
#define STORAGE_NUM_SLIDERS 0
#elif defined(PCBXLITE) || defined(PCBX7)
#define NUM_POTS 2
#define NUM_SLIDERS 0
@@ -644,6 +658,11 @@ extern uint16_t adcValues[NUM_ANALOGS];
#define BATTERY_WARN 66 // 6.6V
#define BATTERY_MIN 67 // 6.7V
#define BATTERY_MAX 83 // 8.3V
#elif defined(RADIO_T8)
// 1S Li-ion / Lipo
#define BATTERY_WARN 33 // 3.3V
#define BATTERY_MIN 32 // 3.2V
#define BATTERY_MAX 42 // 4.2V
#else
// NI-MH 7.2V
#define BATTERY_WARN 65 // 6.5V
@@ -710,6 +729,10 @@ uint8_t isBacklightEnabled();
#define USB_NAME "Radiomaster TX12"
#define USB_MANUFACTURER 'R', 'M', '_', 'T', 'X', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'R', 'M', ' ', 'T', 'X', '1', '2', ' ' /* 8 Bytes */
#elif defined(RADIO_T8)
#define USB_NAME "Radiomaster T8"
#define USB_MANUFACTURER 'R', 'M', '_', 'T', 'X', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'R', 'M', ' ', 'T', '8', ' ', ' ', ' ' /* 8 Bytes */
#else
#define USB_NAME "FrSky Taranis"
#define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */
@@ -864,8 +887,10 @@ void bluetoothDisable();
#endif
// USB Charger
#if defined(USB_CHARGER)
void usbChargerInit();
bool usbChargerLed();
#endif
// LED driver
void ledInit();
@@ -889,7 +914,7 @@ void ledBlue();
#define IS_LCD_RESET_NEEDED() true
#define LCD_CONTRAST_MIN 10
#define LCD_CONTRAST_MAX 30
#if defined(RADIO_TX12)
#if defined(RADIO_TX12) || defined(RADIO_T8)
#define LCD_CONTRAST_DEFAULT 21
#else
#define LCD_CONTRAST_DEFAULT 15