pull/2/head
ng91 2020-09-13 22:49:41 +02:00
commit cf888219d8
13 changed files with 5052 additions and 1374 deletions

View File

@ -1,6 +1,7 @@
# TR-9
**Read ERRATA.txt before building the mainboard!**
TR-9 is a handheld transceiver (HT) for the M17 standard. Its specification can be found [here](https://github.com/sp5wwp/M17_spec).
This repo contains SW4STM32 project for the TR-9 board, TR-9 case design files, KiCAD schematics, gerber files and a sample codeplug. CubeMX version used: **4.27.0**.
# Hardware
The heart of TR-9 is STM32F777VI microcontroller. The handheld also contains:
@ -19,5 +20,3 @@ RF output level can be regulated by the software. The maximum power output is 3
# Software
M17 standard was designed having [Codec2](https://github.com/drowe67/codec2) vocoder in mind. TR-9 takes advantage of STM's internal Advanced Encryption Standard (AES) hardware for optional end-to-end encryption. There is a possibility of using other block ciphers and scrambling.
This repo contains SW4STM32 project for the TR-9 board.

Binary file not shown.

View File

@ -0,0 +1,148 @@
/***************************************************
Arduino TFT graphics library targetted at the UNO
and Mega boards.
This library has been derived from the Adafruit_GFX
library and the associated driver library. See text
at the end of this file.
This is a standalone library that contains the
hardware driver, the graphics funtions and the
proportional fonts.
The larger fonts are Run Length Encoded to reduce
their FLASH footprint.
****************************************************/
#define INITR_GREENTAB 0x0
#define INITR_REDTAB 0x1
#define INITR_BLACKTAB 0x2
#define INITR_GREENTAB2 0x3 // Use if you get random pixels on two edges of green tab display
#define INITB 0xB
// Stop fonts being loaded multiple times
#ifndef _TFT_ST7735H_
#define _TFT_ST7735H_
//These enumerate the text plotting alignment (reference datum point)
#define TL_DATUM 0 // Top left (default)
#define TC_DATUM 1 // Top centre
#define TR_DATUM 2 // Top right
#define ML_DATUM 3 // Middle left
#define CL_DATUM 3 // Centre left, same as above
#define MC_DATUM 4 // Middle centre
#define CC_DATUM 4 // Centre centre, same as above
#define MR_DATUM 5 // Middle right
#define CR_DATUM 5 // Centre right, same as above
#define BL_DATUM 6 // Bottom left
#define BC_DATUM 7 // Bottom centre
#define BR_DATUM 8 // Bottom right
// Change the width and height if required (defined in portrait mode)
// or use the constructor to over-ride defaults
#define ST7735_TFTWIDTH 128
#define ST7735_TFTHEIGHT 160
// These are the ST7735 control registers
// some flags for initR() :(
#define ST7735_TFTWIDTH 128
#define ST7735_TFTHEIGHT 160
#define ST7735_NOP 0x00
#define ST7735_SWRESET 0x01
#define ST7735_RDDID 0x04
#define ST7735_RDDST 0x09
#define ST7735_SLPIN 0x10
#define ST7735_SLPOUT 0x11
#define ST7735_PTLON 0x12
#define ST7735_NORON 0x13
#define ST7735_INVOFF 0x20
#define ST7735_INVON 0x21
#define ST7735_DISPOFF 0x28
#define ST7735_DISPON 0x29
#define ST7735_CASET 0x2A
#define ST7735_RASET 0x2B
#define ST7735_RAMWR 0x2C
#define ST7735_RAMRD 0x2E
#define ST7735_PTLAR 0x30
#define ST7735_COLMOD 0x3A
#define ST7735_MADCTL 0x36
#define ST7735_FRMCTR1 0xB1
#define ST7735_FRMCTR2 0xB2
#define ST7735_FRMCTR3 0xB3
#define ST7735_INVCTR 0xB4
#define ST7735_DISSET5 0xB6
#define ST7735_PWCTR1 0xC0
#define ST7735_PWCTR2 0xC1
#define ST7735_PWCTR3 0xC2
#define ST7735_PWCTR4 0xC3
#define ST7735_PWCTR5 0xC4
#define ST7735_VMCTR1 0xC5
#define ST7735_RDID1 0xDA
#define ST7735_RDID2 0xDB
#define ST7735_RDID3 0xDC
#define ST7735_RDID4 0xDD
#define ST7735_PWCTR6 0xFC
#define ST7735_GMCTRP1 0xE0
#define ST7735_GMCTRN1 0xE1
#define MADCTL_MY 0x80
#define MADCTL_MX 0x40
#define MADCTL_MV 0x20
#define MADCTL_ML 0x10
#define MADCTL_RGB 0x00
#define MADCTL_BGR 0x08
#define MADCTL_MH 0x04
// Color definitions for backwards compatibility
#define CL_BLACK 0x0000 /* 0, 0, 0 */
#define CL_NAVY 0x000F /* 0, 0, 128 */
#define CL_DARKGREEN 0x03E0 /* 0, 128, 0 */
#define CL_DARKCYAN 0x03EF /* 0, 128, 128 */
#define CL_MAROON 0x7800 /* 128, 0, 0 */
#define CL_PURPLE 0x780F /* 128, 0, 128 */
#define CL_OLIVE 0x7BE0 /* 128, 128, 0 */
#define CL_LIGHTGREY 0xC618 /* 192, 192, 192 */
#define CL_DARKGREY 0x7BEF /* 128, 128, 128 */
#define CL_BLUE 0x001F /* 0, 0, 255 */
#define CL_GREEN 0x07E0 /* 0, 255, 0 */
#define CL_CYAN 0x07FF /* 0, 255, 255 */
#define CL_RED 0xF800 /* 255, 0, 0 */
#define CL_MAGENTA 0xF81F /* 255, 0, 255 */
#define CL_YELLOW 0xFFE0 /* 255, 255, 0 */
#define CL_WHITE 0xFFFF /* 255, 255, 255 */
#define CL_ORANGE 0xFD20 /* 255, 165, 0 */
#define CL_GREENYELLOW 0xAFE5 /* 173, 255, 47 */
#endif
/***************************************************
ORIGINAL LIBRARY HEADER
This is our library for the Adafruit ST7735 Breakout and Shield
----> http://www.adafruit.com/products/1651
Check out the links above for our tutorials and wiring diagrams
These displays use SPI to communicate, 4 or 5 pins are required to
interface (RST is optional)
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
Updated with new functions by Bodmer 14/4/15
****************************************************/

1714
cubemx/Inc/font_1.h 100644

File diff suppressed because it is too large Load Diff

View File

@ -60,6 +60,7 @@ void EXTI0_IRQHandler(void);
void DMA1_Stream5_IRQHandler(void);
void DMA1_Stream6_IRQHandler(void);
void ADC_IRQHandler(void);
void USART2_IRQHandler(void);
void USART3_IRQHandler(void);
void TIM5_IRQHandler(void);
void TIM7_IRQHandler(void);

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1014,6 +1014,9 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
__HAL_LINKDMA(huart,hdmatx,hdma_usart2_tx);
/* USART2 interrupt Init */
HAL_NVIC_SetPriority(USART2_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(USART2_IRQn);
/* USER CODE BEGIN USART2_MspInit 1 */
/* USER CODE END USART2_MspInit 1 */
@ -1102,6 +1105,9 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
/* USART2 DMA DeInit */
HAL_DMA_DeInit(huart->hdmatx);
/* USART2 interrupt DeInit */
HAL_NVIC_DisableIRQ(USART2_IRQn);
/* USER CODE BEGIN USART2_MspDeInit 1 */
/* USER CODE END USART2_MspDeInit 1 */

View File

@ -49,6 +49,7 @@ extern DMA_HandleTypeDef hdma_dac1;
extern TIM_HandleTypeDef htim5;
extern TIM_HandleTypeDef htim7;
extern DMA_HandleTypeDef hdma_usart2_tx;
extern UART_HandleTypeDef huart2;
extern UART_HandleTypeDef huart3;
/******************************************************************************/
@ -259,6 +260,20 @@ void ADC_IRQHandler(void)
/* USER CODE END ADC_IRQn 1 */
}
/**
* @brief This function handles USART2 global interrupt.
*/
void USART2_IRQHandler(void)
{
/* USER CODE BEGIN USART2_IRQn 0 */
/* USER CODE END USART2_IRQn 0 */
HAL_UART_IRQHandler(&huart2);
/* USER CODE BEGIN USART2_IRQn 1 */
/* USER CODE END USART2_IRQn 1 */
}
/**
* @brief This function handles USART3 global interrupt.
*/

View File

@ -0,0 +1,35 @@
# This is an TR-9 board with a single STM32F777VITx chip
#
# Generated by System Workbench for STM32
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
source [find interface/stlink.cfg]
set WORKAREASIZE 0x8000
transport select "hla_swd"
set CHIPNAME STM32F777VITx
set BOARDNAME TR-9
# CHIPNAMES state
# Enable debug when in low power modes
set ENABLE_LOW_POWER 1
# Stop Watchdog counters when halt
set STOP_WATCHDOG 1
# STlink Debug clock frequency
set CLOCK_FREQ 480
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
# BCTM CPU variables
source [find target/stm32f7x.cfg]

View File

@ -218,6 +218,7 @@ NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false
NVIC.TIM5_IRQn=true\:0\:0\:false\:false\:true\:true
NVIC.TIM7_IRQn=true\:0\:0\:false\:false\:true\:true
NVIC.USART2_IRQn=true\:0\:0\:false\:false\:true\:true
NVIC.USART3_IRQn=true\:15\:0\:true\:false\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false
PA0/WKUP.Signal=ADCx_IN0
@ -299,9 +300,10 @@ PB9.GPIOParameters=GPIO_Label
PB9.GPIO_Label=WIFI_EN
PB9.Locked=true
PB9.Signal=GPIO_Output
PC1.GPIOParameters=GPIO_Label
PC1.GPIOParameters=PinState,GPIO_Label
PC1.GPIO_Label=XO_EN
PC1.Locked=true
PC1.PinState=GPIO_PIN_SET
PC1.Signal=GPIO_Output
PC12.GPIOParameters=GPIO_PuPd
PC12.GPIO_PuPd=GPIO_PULLDOWN
@ -347,16 +349,18 @@ PD1.GPIO_Label=LED_RED
PD1.Locked=true
PD1.PinState=GPIO_PIN_SET
PD1.Signal=GPIO_Output
PD10.GPIOParameters=GPIO_Label
PD10.GPIOParameters=GPIO_Speed,GPIO_Label
PD10.GPIO_Label=ADF_SDATA
PD10.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PD10.Locked=true
PD10.Signal=GPIO_Output
PD11.GPIOParameters=GPIO_Label
PD11.GPIO_Label=ADF_SREAD
PD11.Locked=true
PD11.Signal=GPIO_Input
PD12.GPIOParameters=GPIO_Label
PD12.GPIOParameters=GPIO_Speed,GPIO_Label
PD12.GPIO_Label=ADF_SCLK
PD12.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PD12.Locked=true
PD12.Signal=GPIO_Output
PD13.GPIOParameters=GPIO_Label
@ -389,8 +393,9 @@ PD8.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PD8.Locked=true
PD8.PinState=GPIO_PIN_SET
PD8.Signal=GPIO_Output
PD9.GPIOParameters=GPIO_Label
PD9.GPIOParameters=GPIO_Speed,GPIO_Label
PD9.GPIO_Label=ADF_SLE
PD9.GPIO_Speed=GPIO_SPEED_FREQ_VERY_HIGH
PD9.Locked=true
PD9.Signal=GPIO_Output
PE0.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultEXTI
@ -431,9 +436,9 @@ PE9.GPIOParameters=GPIO_Label
PE9.GPIO_Label=N6
PE9.Locked=true
PE9.Signal=GPIO_Output
PH0/OSC_IN.Mode=HSE-External-Oscillator
PH0/OSC_IN.Mode=HSE-External-Clock-Source
PH0/OSC_IN.Signal=RCC_OSC_IN
PH1/OSC_OUT.Mode=HSE-External-Oscillator
PH1/OSC_OUT.Mode=HSE-External-Clock-Source
PH1/OSC_OUT.Signal=RCC_OSC_OUT
PinOutPanel.RotationAngle=0
ProjectManager.AskForMigrate=true
@ -553,10 +558,13 @@ SH.GPXTI14.0=GPIO_EXTI14
SH.GPXTI14.ConfNb=1
SH.S_TIM3_CH2.0=TIM3_CH2,PWM Generation2 CH2
SH.S_TIM3_CH2.ConfNb=1
SPI1.CalculateBaudRate=54.0 MBits/s
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
SPI1.CalculateBaudRate=27.0 MBits/s
SPI1.DataSize=SPI_DATASIZE_9BIT
SPI1.Direction=SPI_DIRECTION_1LINE
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,BaudRatePrescaler,NSSPMode
SPI1.Mode=SPI_MODE_MASTER
SPI1.NSSPMode=SPI_NSS_PULSE_DISABLE
SPI1.VirtualType=VM_MASTER
SPI2.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
SPI2.CalculateBaudRate=27.0 MBits/s
@ -567,7 +575,9 @@ SPI2.Mode=SPI_MODE_MASTER
SPI2.NSSPMode=SPI_NSS_PULSE_DISABLE
SPI2.VirtualType=VM_MASTER
TIM3.Channel-PWM\ Generation2\ CH2=TIM_CHANNEL_2
TIM3.IPParameters=Channel-PWM Generation2 CH2
TIM3.IPParameters=Channel-PWM Generation2 CH2,Period,Prescaler
TIM3.Period=999
TIM3.Prescaler=215
TIM4.IPParameters=Prescaler,Period
TIM4.Period=999
TIM4.Prescaler=269

View File

@ -1,16 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE targetDefinitions [
<!ELEMENT targetDefinitions (board)>
<!ELEMENT board (name, dbgIF+, dbgDEV, mcuId)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT dbgIF (#PCDATA)>
<!ELEMENT dbgDEV (#PCDATA)>
<!ELEMENT mcuId (#PCDATA)>
<!ATTLIST board id CDATA #REQUIRED>
]>
<!DOCTYPE targetDefinitions [
<!ELEMENT targetDefinitions (board)>
<!ELEMENT board (name,dbgIF+,dbgDEV,mcuId)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT dbgIF (#PCDATA)>
<!ELEMENT dbgDEV (#PCDATA)>
<!ELEMENT mcuId (#PCDATA)>
<!ATTLIST board id CDATA #REQUIRED>
]>
<targetDefinitions>
<board id="tr-9">
<board id="TR-9">
<name>TR-9</name>
<dbgIF>SWD</dbgIF>
<dbgDEV>ST-Link</dbgDEV>