mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 09:45:21 +03:00
Add TX16S
This commit is contained in:
parent
9321d486ab
commit
989381de33
15 changed files with 112 additions and 25 deletions
|
@ -351,6 +351,8 @@ elseif(PCB STREQUAL X10 AND PCBREV STREQUAL EXPRESS)
|
|||
set(FLAVOUR x10express)
|
||||
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL T16)
|
||||
set(FLAVOUR t16)
|
||||
elseif(PCB STREQUAL X10 AND PCBREV STREQUAL TX16S)
|
||||
set(FLAVOUR tx16s)
|
||||
else()
|
||||
string(TOLOWER ${PCB} FLAVOUR)
|
||||
endif()
|
||||
|
|
|
@ -205,7 +205,7 @@ enum TrainerMode {
|
|||
};
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T16) || defined(ALLOW_TRAINER_MULTI)
|
||||
#if defined(RADIO_FAMILY_T16) || defined(ALLOW_TRAINER_MULTI)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_MULTI
|
||||
#elif defined(BLUETOOTH)
|
||||
#define TRAINER_MODE_MAX() TRAINER_MODE_SLAVE_BLUETOOTH
|
||||
|
|
|
@ -137,7 +137,7 @@ class DarkblueTheme: public Theme
|
|||
calibTrackpBackground = BitmapBuffer::load(getThemePath("trackp_background.png"));
|
||||
|
||||
delete calibHorus;
|
||||
#if defined(RADIO_T16)
|
||||
#if defined(RADIO_FAMILY_T16)
|
||||
calibHorus = BitmapBuffer::load(getThemePath("t16.bmp"));
|
||||
#elif defined(PCBX10)
|
||||
if(STICKS_PWM_ENABLED()) {
|
||||
|
|
|
@ -174,7 +174,7 @@ class DefaultTheme: public Theme
|
|||
calibTrackpBackground = BitmapBuffer::load(getThemePath("trackp_background.png"));
|
||||
|
||||
delete calibHorus;
|
||||
#if defined(RADIO_T16)
|
||||
#if defined(RADIO_FAMILY_T16)
|
||||
calibHorus = BitmapBuffer::load(getThemePath("t16.bmp"));
|
||||
#elif defined(PCBX10)
|
||||
if(STICKS_PWM_ENABLED()) {
|
||||
|
|
|
@ -316,9 +316,9 @@ bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
|
|||
if (menuTab && !menuCalibrationState) {
|
||||
int cc = curr;
|
||||
switch (event) {
|
||||
#if defined(PCBX12S)
|
||||
#if defined(KEYS_GPIO_REG_PGUP)
|
||||
case EVT_KEY_FIRST(KEY_PGDN):
|
||||
#elif defined(PCBX10)
|
||||
#else
|
||||
case EVT_KEY_BREAK(KEY_PGDN):
|
||||
#endif
|
||||
if (s_editMode>0)
|
||||
|
@ -327,9 +327,9 @@ bool check(event_t event, uint8_t curr, const MenuHandlerFunc * menuTab, uint8_t
|
|||
if (++cc == menuTabSize)
|
||||
cc = 0;
|
||||
break;
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PGUP)
|
||||
case EVT_KEY_FIRST(KEY_PGUP):
|
||||
#if defined(PCBX10)
|
||||
#else
|
||||
case EVT_KEY_LONG(KEY_PGDN):
|
||||
#endif
|
||||
if (s_editMode>0)
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#if defined(PCBX12S)
|
||||
#include "lua/lua_exports_x12s.inc" // this line must be after lua headers
|
||||
#elif defined(RADIO_T16)
|
||||
#elif defined(RADIO_FAMILY_T16)
|
||||
#include "lua/lua_exports_t16.inc"
|
||||
#elif defined(PCBX10)
|
||||
#include "lua/lua_exports_x10.inc"
|
||||
|
|
|
@ -546,7 +546,7 @@ bool setTrimValue(uint8_t phase, uint8_t idx, int trim);
|
|||
|
||||
#if defined(PCBSKY9X)
|
||||
#define ROTARY_ENCODER_GRANULARITY (2 << g_eeGeneral.rotarySteps)
|
||||
#elif defined(RADIO_T16)
|
||||
#elif defined(RADIO_FAMILY_T16)
|
||||
#define ROTARY_ENCODER_GRANULARITY (1)
|
||||
#else
|
||||
#define ROTARY_ENCODER_GRANULARITY (2)
|
||||
|
|
|
@ -128,6 +128,8 @@ const char * getBasename(const char * path);
|
|||
#define OTX_FOURCC 0x3478746F // otx for X12S
|
||||
#elif defined(RADIO_T16)
|
||||
#define OTX_FOURCC 0x3F78746F // otx for Jumper T16
|
||||
#elif defined(RADIO_TX16S)
|
||||
#define OTX_FOURCC 0x3878746F // otx for Radiomaster TX16S
|
||||
#elif defined(PCBX10)
|
||||
#define OTX_FOURCC 0x3778746F // otx for X10
|
||||
#elif defined(PCBX9E)
|
||||
|
|
|
@ -71,7 +71,7 @@ void rotaryEncoderInit()
|
|||
|
||||
void rotaryEncoderCheck()
|
||||
{
|
||||
#if defined(RADIO_T16)
|
||||
#if defined(RADIO_FAMILY_T16)
|
||||
static uint8_t state = 0;
|
||||
uint8_t pins = ROTARY_ENCODER_POSITION();
|
||||
|
||||
|
|
|
@ -51,9 +51,18 @@ if (PCB STREQUAL X10)
|
|||
elseif (PCBREV STREQUAL T16)
|
||||
set(FLAVOUR t16)
|
||||
set(LUA_EXPORT lua_export_t16)
|
||||
add_definitions(-DRADIO_FAMILY_T16)
|
||||
add_definitions(-DRADIO_T16)
|
||||
option(INTERNAL_MODULE_MULTI "Support for MULTI internal module" OFF)
|
||||
option(BLUETOOTH "Support for bluetooth module" OFF)
|
||||
elseif (PCBREV STREQUAL TX16S)
|
||||
set(FLAVOUR tx16s)
|
||||
set(LUA_EXPORT lua_export_t16)
|
||||
add_definitions(-DRADIO_FAMILY_T16)
|
||||
add_definitions(-DRADIO_TX16S)
|
||||
option(INTERNAL_MODULE_MULTI "Support for MULTI internal module" OFF)
|
||||
option(BLUETOOTH "Support for bluetooth module" OFF)
|
||||
set(AUX_SERIAL ON)
|
||||
else()
|
||||
set(FLAVOUR x10)
|
||||
option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module" ON)
|
||||
|
@ -203,9 +212,15 @@ if(BLUETOOTH)
|
|||
set(SRC ${SRC} bluetooth.cpp)
|
||||
endif()
|
||||
|
||||
if (AUX_SERIAL)
|
||||
add_definitions(-DAUX_SERIAL)
|
||||
set(AUX_SERIAL_DRIVER ../common/arm/stm32/aux_serial_driver.cpp)
|
||||
endif()
|
||||
|
||||
set(FIRMWARE_TARGET_SRC
|
||||
${FIRMWARE_TARGET_SRC}
|
||||
${LCD_DRIVER}
|
||||
${AUX_SERIAL_DRIVER}
|
||||
board.cpp
|
||||
backlight_driver.cpp
|
||||
../common/arm/stm32/pwr_driver.cpp
|
||||
|
|
|
@ -41,7 +41,7 @@ void watchdogInit(unsigned int duration)
|
|||
IWDG->KR = 0xCCCC; // start
|
||||
}
|
||||
|
||||
#if defined(PCBX10) && !defined(RADIO_T16)
|
||||
#if defined(PCBX10) && !defined(RADIO_FAMILY_T16)
|
||||
void sportUpdateInit()
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
|
@ -163,7 +163,7 @@ void boardInit()
|
|||
|
||||
ledInit();
|
||||
|
||||
#if defined(PCBX10) && !defined(RADIO_T16)
|
||||
#if defined(PCBX10) && !defined(RADIO_FAMILY_T16)
|
||||
sportUpdateInit();
|
||||
#endif
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ extern uint16_t sessionTimer;
|
|||
|
||||
#define SLAVE_MODE() (g_model.trainerData.mode == TRAINER_MODE_SLAVE)
|
||||
|
||||
#if defined(PCBX10) && !defined(RADIO_T16)
|
||||
#if defined(PCBX10) && !defined(RADIO_FAMILY_T16)
|
||||
#define TRAINER_CONNECTED() (GPIO_ReadInputDataBit(TRAINER_DETECT_GPIO, TRAINER_DETECT_GPIO_PIN) == Bit_SET)
|
||||
#else
|
||||
#define TRAINER_CONNECTED() (GPIO_ReadInputDataBit(TRAINER_DETECT_GPIO, TRAINER_DETECT_GPIO_PIN) == Bit_RESET)
|
||||
|
@ -524,7 +524,7 @@ void backlightEnable(uint8_t dutyCycle = 0);
|
|||
#define BACKLIGHT_LEVEL_MAX 100
|
||||
#if defined(PCBX12S)
|
||||
#define BACKLIGHT_LEVEL_MIN 5
|
||||
#elif defined(RADIO_T16)
|
||||
#elif defined(RADIO_FAMILY_T16)
|
||||
#define BACKLIGHT_LEVEL_MIN 1
|
||||
#else
|
||||
#define BACKLIGHT_LEVEL_MIN 46
|
||||
|
@ -543,7 +543,11 @@ void usbJoystickUpdate();
|
|||
#elif defined(RADIO_T16)
|
||||
#define USB_NAME "Jumper T16"
|
||||
#define USB_MANUFACTURER 'J', 'u', 'm', 'p', 'e', 'r', ' ', ' ' /* 8 bytes */
|
||||
#define USB_PRODUCT 'T', '1', '6', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#define USB_PRODUCT 'T', '1', '6', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#elif defined(RADIO_TX16S)
|
||||
#define USB_NAME "RadioMas TX16S"
|
||||
#define USB_MANUFACTURER 'R', 'a', 'd', 'i', 'o', 'M', 'a', 's' /* 8 bytes */
|
||||
#define USB_PRODUCT 'T', 'X', '1', '6', 'S', ' ', ' ', ' ' /* 8 Bytes */
|
||||
#elif defined(PCBX10)
|
||||
#define USB_NAME "FrSky X10"
|
||||
#define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */
|
||||
|
@ -585,7 +589,7 @@ extern uint32_t telemetryErrors;
|
|||
void telemetryPortInvertedInit(uint32_t baudrate);
|
||||
|
||||
// Sport update driver
|
||||
#if defined(PCBX10) && !defined(RADIO_T16)
|
||||
#if defined(PCBX10) && !defined(RADIO_FAMILY_T16)
|
||||
void sportUpdatePowerOn();
|
||||
void sportUpdatePowerOff();
|
||||
#define SPORT_UPDATE_POWER_ON() sportUpdatePowerOn()
|
||||
|
@ -595,6 +599,26 @@ void sportUpdatePowerOff();
|
|||
#define SPORT_UPDATE_POWER_OFF()
|
||||
#endif
|
||||
|
||||
// Second serial port driver
|
||||
#if defined(AUX_SERIAL_GPIO)
|
||||
#define DEBUG_BAUDRATE 115200
|
||||
extern uint8_t auxSerialMode;
|
||||
void auxSerialInit(unsigned int mode, unsigned int protocol);
|
||||
void auxSerialPutc(char c);
|
||||
#define auxSerialTelemetryInit(protocol) auxSerialInit(UART_MODE_TELEMETRY, protocol)
|
||||
void auxSerialSbusInit();
|
||||
void auxSerialStop();
|
||||
void auxSerialPowerOn();
|
||||
void auxSerialPowerOff();
|
||||
#if defined(AUX_SERIAL_PWR_GPIO)
|
||||
#define AUX_SERIAL_POWER_ON() auxSerialPowerOn()
|
||||
#define AUX_SERIAL__POWER_OFF() auxSerialPowerOff()
|
||||
#else
|
||||
#define AUX_SERIAL_POWER_ON()
|
||||
#define AUX_SERIAL__POWER_OFF()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Haptic driver
|
||||
void hapticInit();
|
||||
void hapticDone();
|
||||
|
|
|
@ -38,6 +38,21 @@
|
|||
#define KEYS_GPIO_PIN_DOWN GPIO_Pin_6 // PI.06
|
||||
#define KEYS_GPIO_REG_RIGHT GPIOC->IDR
|
||||
#define KEYS_GPIO_PIN_RIGHT GPIO_Pin_4 // PC.04
|
||||
#elif defined(RADIO_TX16S)
|
||||
#define KEYS_GPIO_REG_ENTER GPIOI->IDR
|
||||
#define KEYS_GPIO_PIN_ENTER GPIO_Pin_8 // PI.08
|
||||
#define KEYS_GPIO_REG_PGUP GPIOC->IDR
|
||||
#define KEYS_GPIO_PIN_PGUP GPIO_Pin_13 // PC.13
|
||||
#define KEYS_GPIO_REG_PGDN GPIOI->IDR
|
||||
#define KEYS_GPIO_PIN_PGDN GPIO_Pin_11 // PI.11
|
||||
#define KEYS_GPIO_REG_UP GPIOI->IDR
|
||||
#define KEYS_GPIO_PIN_UP GPIO_Pin_6 // PI.06
|
||||
#define KEYS_GPIO_REG_DOWN GPIOI->IDR
|
||||
#define KEYS_GPIO_PIN_DOWN GPIO_Pin_4 // PI.04
|
||||
#define KEYS_GPIO_REG_LEFT GPIOI->IDR
|
||||
#define KEYS_GPIO_PIN_LEFT GPIO_Pin_7 // PI.07
|
||||
#define KEYS_GPIO_REG_RIGHT GPIOI->IDR
|
||||
#define KEYS_GPIO_PIN_RIGHT GPIO_Pin_5 // PI.05
|
||||
#elif defined(PCBX10)
|
||||
#define KEYS_GPIO_REG_ENTER GPIOI->IDR
|
||||
#define KEYS_GPIO_PIN_ENTER GPIO_Pin_8 // PI.08
|
||||
|
@ -167,10 +182,17 @@
|
|||
#define TRIMS_GPIO_REG_LSU GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_LSU GPIO_Pin_13 // PB.13
|
||||
#elif defined(PCBX10)
|
||||
#if defined(RADIO_TX16S)
|
||||
#define TRIMS_GPIO_REG_LHL GPIOA->IDR
|
||||
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_6 // PA.06
|
||||
#define TRIMS_GPIO_REG_LHR GPIOC->IDR
|
||||
#define TRIMS_GPIO_PIN_LHR GPIO_Pin_4 // PC.04
|
||||
#else
|
||||
#define TRIMS_GPIO_REG_LHL GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_LHL GPIO_Pin_8 // PB.08
|
||||
#define TRIMS_GPIO_REG_LHR GPIOB->IDR
|
||||
#define TRIMS_GPIO_PIN_LHR GPIO_Pin_9 // PB.09
|
||||
#endif
|
||||
#define TRIMS_GPIO_REG_LVD GPIOG->IDR
|
||||
#define TRIMS_GPIO_PIN_LVD GPIO_Pin_12 // PG.12
|
||||
#define TRIMS_GPIO_REG_LVU GPIOJ->IDR
|
||||
|
@ -211,11 +233,21 @@
|
|||
#define KEYS_GPIOI_PINS (KEYS_GPIO_PIN_PGDN | KEYS_GPIO_PIN_LEFT | KEYS_GPIO_PIN_DOWN | SWITCHES_GPIO_PIN_A_L | GPIO_Pin_4)
|
||||
#define KEYS_GPIOJ_PINS (SWITCHES_GPIO_PIN_D_H | TRIMS_GPIO_PIN_RVU | TRIMS_GPIO_PIN_LVD | TRIMS_GPIO_PIN_LVU | TRIMS_GPIO_PIN_RSD)
|
||||
#elif defined(PCBX10)
|
||||
#define KEYS_GPIOB_PINS (GPIO_Pin_12 | GPIO_Pin_15 | GPIO_Pin_14 | GPIO_Pin_13 | GPIO_Pin_8 | GPIO_Pin_9)
|
||||
#if defined(RADIO_TX16S)
|
||||
#define KEYS_GPIOB_PINS (GPIO_Pin_12 | GPIO_Pin_15 | GPIO_Pin_14 | GPIO_Pin_13)
|
||||
#else
|
||||
#define KEYS_GPIOB_PINS (GPIO_Pin_12 | GPIO_Pin_15 | GPIO_Pin_14 | GPIO_Pin_13 | GPIO_Pin_8 | GPIO_Pin_9)
|
||||
#endif
|
||||
#define KEYS_GPIOD_PINS (GPIO_Pin_11 | GPIO_Pin_3 | GPIO_Pin_7 | GPIO_Pin_13)
|
||||
#define KEYS_GPIOE_PINS (GPIO_Pin_3)
|
||||
#define KEYS_GPIOG_PINS (SWITCHES_GPIO_PIN_D_L | SWITCHES_GPIO_PIN_G_H | SWITCHES_GPIO_PIN_G_L | SWITCHES_GPIO_PIN_H | TRIMS_GPIO_PIN_LVD)
|
||||
#if defined(RADIO_TX16S)
|
||||
#define KEYS_GPIOA_PINS (GPIO_Pin_6)
|
||||
#define KEYS_GPIOC_PINS (GPIO_Pin_4 | GPIO_Pin_13)
|
||||
#define KEYS_GPIOH_PINS (GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_14 | GPIO_Pin_15)
|
||||
#else
|
||||
#define KEYS_GPIOH_PINS (GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_14 | GPIO_Pin_15)
|
||||
#endif
|
||||
#define KEYS_GPIOI_PINS (GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_11 | GPIO_Pin_15)
|
||||
#define KEYS_GPIOJ_PINS (SWITCHES_GPIO_PIN_D_H | TRIMS_GPIO_PIN_LVU | TRIMS_GPIO_PIN_RVD | TRIMS_GPIO_PIN_RVU | GPIO_Pin_8)
|
||||
#endif
|
||||
|
@ -288,10 +320,12 @@
|
|||
#define ADC_DMA_Stream DMA2_Stream0
|
||||
#define ADC_SET_DMA_FLAGS() ADC_DMA->LIFCR = (DMA_LIFCR_CTCIF0 | DMA_LIFCR_CHTIF0 | DMA_LIFCR_CTEIF0 | DMA_LIFCR_CDMEIF0 | DMA_LIFCR_CFEIF0)
|
||||
#define ADC_TRANSFER_COMPLETE() (ADC_DMA->LISR & DMA_LISR_TCIF0)
|
||||
#if defined(RADIO_T16)
|
||||
#define ADC_VREF_PREC2 300
|
||||
#if defined(RADIO_TX16S)
|
||||
#define ADC_VREF_PREC2 330
|
||||
#elif defined(RADIO_T16)
|
||||
#define ADC_VREF_PREC2 300
|
||||
#else
|
||||
#define ADC_VREF_PREC2 250
|
||||
#define ADC_VREF_PREC2 250
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -304,7 +338,7 @@
|
|||
|
||||
// S.Port update connector
|
||||
#define SPORT_MAX_BAUDRATE 250000 // < 400000
|
||||
#if defined(PCBX10) && !defined(RADIO_T16)
|
||||
#if defined(PCBX10) && !defined(RADIO_FAMILY_T16)
|
||||
#define SPORT_UPDATE_RCC_AHB1Periph RCC_AHB1Periph_GPIOH
|
||||
#define SPORT_UPDATE_PWR_GPIO GPIOH
|
||||
#define SPORT_UPDATE_PWR_GPIO_PIN GPIO_Pin_13 // PH.13
|
||||
|
@ -343,7 +377,7 @@
|
|||
#endif
|
||||
|
||||
// Serial Port (DEBUG)
|
||||
#if defined(PCBX12S)
|
||||
#if defined(PCBX12S) || defined(RADIO_TX16S)
|
||||
#define AUX_SERIAL_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA1)
|
||||
#define AUX_SERIAL_RCC_APB1Periph RCC_APB1Periph_USART3
|
||||
#define AUX_SERIAL_GPIO GPIOB
|
||||
|
@ -546,11 +580,16 @@
|
|||
#define AUDIO_DMA DMA1
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_T16)
|
||||
#if defined(RADIO_FAMILY_T16)
|
||||
#define AUDIO_UNMUTE_DELAY 120 // ms
|
||||
#define AUDIO_MUTE_DELAY 500 // ms
|
||||
#endif
|
||||
|
||||
#if defined(RADIO_TX16S)
|
||||
// Only slight noise with 868MHz > 1W, if complaints later remove and set AUDIO_UNMUTE_DELAY to 150
|
||||
#undef AUDIO_MUTE_GPIO_PIN
|
||||
#endif
|
||||
|
||||
// I2C Bus
|
||||
#define I2C_RCC_AHB1Periph RCC_AHB1Periph_GPIOB
|
||||
#define I2C_RCC_APB1Periph RCC_APB1Periph_I2C1
|
||||
|
@ -589,7 +628,7 @@
|
|||
#define HAPTIC_TIMER_COMPARE_VALUE HAPTIC_GPIO_TIMER->CCR2
|
||||
#endif
|
||||
|
||||
#if !defined(RADIO_T16)
|
||||
#if !defined(RADIO_FAMILY_T16)
|
||||
#define EXTERNAL_ANTENNA
|
||||
#endif
|
||||
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_DMA2)
|
||||
|
|
|
@ -24,7 +24,7 @@ uint32_t readKeys()
|
|||
{
|
||||
uint32_t result = 0;
|
||||
|
||||
#if defined(PCBX12S)
|
||||
#if defined(KEYS_GPIO_REG_PGUP)
|
||||
if (~KEYS_GPIO_REG_PGUP & KEYS_GPIO_PIN_PGUP)
|
||||
result |= 1 << KEY_PGUP;
|
||||
#endif
|
||||
|
|
|
@ -56,6 +56,11 @@ boards = {
|
|||
"PCBREV": "T16",
|
||||
"INTERNAL_MODULE_MULTI": "YES"
|
||||
},
|
||||
"TX16S": {
|
||||
"PCB": "X10",
|
||||
"PCBREV": "TX16S",
|
||||
"INTERNAL_MODULE_MULTI": "YES"
|
||||
},
|
||||
"T12": {
|
||||
"PCB": "X7",
|
||||
"PCBREV": "T12",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue