├── .gitignore ├── .gitmodules ├── ADF7021.cpp ├── ADF7021.h ├── BUILD.md ├── BitRB.cpp ├── BitRB.h ├── CWIdTX.cpp ├── CWIdTX.h ├── CalDMR.cpp ├── CalDMR.h ├── CalRSSI.cpp ├── CalRSSI.h ├── Config.h ├── DMRDMORX.cpp ├── DMRDMORX.h ├── DMRDMOTX.cpp ├── DMRDMOTX.h ├── DMRDefines.h ├── DMRIdleRX.cpp ├── DMRIdleRX.h ├── DMRRX.cpp ├── DMRRX.h ├── DMRSlotRX.cpp ├── DMRSlotRX.h ├── DMRSlotType.cpp ├── DMRSlotType.h ├── DMRTX.cpp ├── DMRTX.h ├── DStarDefines.h ├── DStarRX.cpp ├── DStarRX.h ├── DStarTX.cpp ├── DStarTX.h ├── Debug.h ├── Globals.h ├── I2CHost.cpp ├── I2CHost.h ├── IO.cpp ├── IO.h ├── IOArduino.cpp ├── IOSTM.cpp ├── LICENCE ├── M17Defines.h ├── M17RX.cpp ├── M17RX.h ├── M17TX.cpp ├── M17TX.h ├── MMDVM_HS.cpp ├── MMDVM_HS.ino ├── Makefile ├── NXDNDefines.h ├── NXDNRX.cpp ├── NXDNRX.h ├── NXDNTX.cpp ├── NXDNTX.h ├── P25Defines.h ├── P25RX.cpp ├── P25RX.h ├── P25TX.cpp ├── P25TX.h ├── POCSAGDefines.h ├── POCSAGTX.cpp ├── POCSAGTX.h ├── README.md ├── SerialArduino.cpp ├── SerialPort.cpp ├── SerialPort.h ├── SerialRB.cpp ├── SerialRB.h ├── SerialSTM.cpp ├── Utils.cpp ├── Utils.h ├── YSFDefines.h ├── YSFRX.cpp ├── YSFRX.h ├── YSFTX.cpp ├── YSFTX.h ├── bootloader.ld ├── configs ├── D2RG_MMDVM_HS.h ├── LoneStar_USB.h ├── MMDVM_HS_Dual_Hat-12mhz.h ├── MMDVM_HS_Dual_Hat.h ├── MMDVM_HS_Hat-12mhz.h ├── MMDVM_HS_Hat.h ├── NanoDV_NPI.h ├── NanoDV_USB.h ├── Nano_hotSPOT.h ├── SkyBridge_RPi.h ├── ZUMspot_Libre.h ├── ZUMspot_RPi.h ├── ZUMspot_USB.h ├── ZUMspot_dualband.h ├── ZUMspot_duplex.h ├── generic_duplex_gpio.h ├── generic_duplex_usb.h └── generic_gpio.h ├── normal.ld ├── scripts ├── build_fw.sh ├── install_buildtools.sh ├── install_fw_custom.sh ├── install_fw_d2rg_mmdvmhs.sh ├── install_fw_dualband.sh ├── install_fw_duplex.sh ├── install_fw_duplex_gpio.sh ├── install_fw_duplex_gpio_opi.sh ├── install_fw_duplex_usb.sh ├── install_fw_gen_gpio.sh ├── install_fw_hsdualhat-12mhz.sh ├── install_fw_hsdualhat.sh ├── install_fw_hshat-12mhz.sh ├── install_fw_hshat.sh ├── install_fw_librekit.sh ├── install_fw_lonestar_usb.sh ├── install_fw_nanodv_npi.sh ├── install_fw_nanodv_usb.sh ├── install_fw_nanohs.sh ├── install_fw_rpi.sh ├── install_fw_skybridge_rpi.sh └── install_fw_usb.sh ├── stm32f10x_link.ld ├── stm32f4xx_link.ld ├── stm32f7xx_link.ld └── version.h /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.o 3 | 4 | bin/ 5 | 6 | GitVersion\.h 7 | 8 | .vscode/ 9 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "STM32F10X_Lib"] 2 | path = STM32F10X_Lib 3 | url = https://github.com/juribeparada/STM32F10X_Lib 4 | -------------------------------------------------------------------------------- /BitRB.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | TX fifo control - Copyright (C) KI6ZUM 2015 3 | Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 4 | Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the 18 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #include "BitRB.h" 23 | 24 | const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U}; 25 | 26 | #define WRITE_BIT1(p,i,b) p[(i)>>3] = (b) ? (p[(i)>>3] | BIT_MASK_TABLE[(i)&7]) : (p[(i)>>3] & ~BIT_MASK_TABLE[(i)&7]) 27 | #define READ_BIT1(p,i) ((p[(i)>>3] & BIT_MASK_TABLE[(i)&7]) >> (7 - ((i)&7))) 28 | 29 | CBitRB::CBitRB(uint16_t length) : 30 | m_length(length), 31 | m_bits(NULL), 32 | m_control(NULL), 33 | m_head(0U), 34 | m_tail(0U), 35 | m_full(false), 36 | m_overflow(false) 37 | { 38 | m_bits = new uint8_t[length / 8U]; 39 | m_control = new uint8_t[length / 8U]; 40 | } 41 | 42 | uint16_t CBitRB::getSpace() const 43 | { 44 | uint16_t n = 0U; 45 | 46 | if (m_tail == m_head) 47 | n = m_full ? 0U : m_length; 48 | else if (m_tail < m_head) 49 | n = m_length - m_head + m_tail; 50 | else 51 | n = m_tail - m_head; 52 | 53 | if (n > m_length) 54 | n = 0U; 55 | 56 | return n; 57 | } 58 | 59 | uint16_t CBitRB::getData() const 60 | { 61 | if (m_tail == m_head) 62 | return m_full ? m_length : 0U; 63 | else if (m_tail < m_head) 64 | return m_head - m_tail; 65 | else 66 | return m_length - m_tail + m_head; 67 | } 68 | 69 | bool CBitRB::put(uint8_t bit, uint8_t control) 70 | { 71 | if (m_full) { 72 | m_overflow = true; 73 | return false; 74 | } 75 | 76 | WRITE_BIT1(m_bits, m_head, bit); 77 | WRITE_BIT1(m_control, m_head, control); 78 | 79 | m_head++; 80 | if (m_head >= m_length) 81 | m_head = 0U; 82 | 83 | if (m_head == m_tail) 84 | m_full = true; 85 | 86 | return true; 87 | } 88 | 89 | bool CBitRB::get(uint8_t& bit, uint8_t& control) 90 | { 91 | if (m_head == m_tail && !m_full) 92 | return false; 93 | 94 | bit = READ_BIT1(m_bits, m_tail); 95 | control = READ_BIT1(m_control, m_tail); 96 | 97 | m_full = false; 98 | 99 | m_tail++; 100 | if (m_tail >= m_length) 101 | m_tail = 0U; 102 | 103 | return true; 104 | } 105 | 106 | bool CBitRB::hasOverflowed() 107 | { 108 | bool overflow = m_overflow; 109 | 110 | m_overflow = false; 111 | 112 | return overflow; 113 | } 114 | 115 | -------------------------------------------------------------------------------- /BitRB.h: -------------------------------------------------------------------------------- 1 | /* 2 | Serial fifo control - Copyright (C) KI6ZUM 2015 3 | Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 4 | Copyright (C) 2016,2017 by Andy Uribe CA6JAU 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the 18 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 | Boston, MA 02110-1301, USA. 20 | */ 21 | 22 | #if !defined(BITRB_H) 23 | #define BITRB_H 24 | 25 | #if defined(STM32F10X_MD) 26 | #include "stm32f10x.h" 27 | #elif defined(STM32F4XX) 28 | #include "stm32f4xx.h" 29 | #elif defined(STM32F7XX) 30 | #include "stm32f7xx.h" 31 | #else 32 | #include 33 | #endif 34 | 35 | class CBitRB { 36 | public: 37 | CBitRB(uint16_t length); 38 | 39 | uint16_t getSpace() const; 40 | 41 | uint16_t getData() const; 42 | 43 | bool put(uint8_t bit, uint8_t control); 44 | 45 | bool get(uint8_t& bit, uint8_t& control); 46 | 47 | bool hasOverflowed(); 48 | 49 | private: 50 | uint16_t m_length; 51 | volatile uint8_t* m_bits; 52 | volatile uint8_t* m_control; 53 | volatile uint16_t m_head; 54 | volatile uint16_t m_tail; 55 | volatile bool m_full; 56 | bool m_overflow; 57 | }; 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /CWIdTX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2015 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016 by Colin Durbridge G4EML 4 | * Copyright (C) 2017 by Andy Uribe CA6JAU 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #if !defined(CWIDTX_H) 22 | #define CWIDTX_H 23 | 24 | #include "Config.h" 25 | 26 | class CCWIdTX { 27 | public: 28 | CCWIdTX(); 29 | 30 | void process(); 31 | 32 | uint8_t write(const uint8_t* data, uint8_t length); 33 | 34 | void reset(); 35 | 36 | private: 37 | uint8_t m_poBuffer[300U]; 38 | uint16_t m_poLen; 39 | uint16_t m_poPtr; 40 | uint8_t m_n; 41 | }; 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /CalDMR.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2015 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016 by Colin Durbridge G4EML 4 | * Copyright (C) 2018 by Andy Uribe CA6JAU 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #if !defined(CALDMR_H) 22 | #define CALDMR_H 23 | 24 | #include "Config.h" 25 | #include "DMRDefines.h" 26 | 27 | enum DMRCAL1K { 28 | DMRCAL1K_IDLE, 29 | DMRCAL1K_VH, 30 | DMRCAL1K_VOICE, 31 | DMRCAL1K_VT, 32 | DMRCAL1K_WAIT 33 | }; 34 | 35 | class CCalDMR { 36 | public: 37 | CCalDMR(); 38 | 39 | void process(); 40 | void dmrdmo1k(); 41 | void createDataDMO1k(uint8_t n); 42 | 43 | uint8_t write(const uint8_t* data, uint8_t length); 44 | 45 | private: 46 | bool m_transmit; 47 | DMRCAL1K m_state; 48 | uint8_t m_dmr1k[DMR_FRAME_LENGTH_BYTES + 1U]; 49 | uint8_t m_audioSeq; 50 | uint32_t m_count; 51 | }; 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /CalRSSI.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "Config.h" 21 | 22 | #if defined(SEND_RSSI_DATA) 23 | 24 | #include "Globals.h" 25 | #include "CalRSSI.h" 26 | 27 | CCalRSSI::CCalRSSI() : 28 | m_count(0U), 29 | m_navg(0U), 30 | m_accum(0U), 31 | m_min(0xFFFFU), 32 | m_max(0x0000U) 33 | { 34 | } 35 | 36 | void CCalRSSI::process() 37 | { 38 | m_count++; 39 | 40 | if (m_count >= 32000U) { 41 | uint16_t rssi = io.readRSSI(); 42 | m_count = 0U; 43 | m_navg++; 44 | 45 | m_accum += rssi; 46 | 47 | if (rssi > m_max) 48 | m_max = rssi; 49 | if (rssi < m_min) 50 | m_min = rssi; 51 | 52 | if (m_navg >= 6U) { 53 | uint16_t ave = m_accum / 6U; 54 | 55 | uint8_t buffer[6U]; 56 | buffer[0U] = (m_max >> 8) & 0xFFU; 57 | buffer[1U] = (m_max >> 0) & 0xFFU; 58 | buffer[2U] = (m_min >> 8) & 0xFFU; 59 | buffer[3U] = (m_min >> 0) & 0xFFU; 60 | buffer[4U] = (ave >> 8) & 0xFFU; 61 | buffer[5U] = (ave >> 0) & 0xFFU; 62 | 63 | serial.writeRSSIData(buffer, 6U); 64 | 65 | m_navg = 0U; 66 | m_accum = 0U; 67 | m_min = 0xFFFFU; 68 | m_max = 0x0000U; 69 | } 70 | 71 | } 72 | } 73 | 74 | #endif -------------------------------------------------------------------------------- /CalRSSI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(CALRSSI_H) 21 | #define CALRSSI_H 22 | 23 | #include "Config.h" 24 | 25 | #if defined(SEND_RSSI_DATA) 26 | 27 | class CCalRSSI { 28 | public: 29 | CCalRSSI(); 30 | 31 | void process(); 32 | 33 | private: 34 | uint32_t m_count; 35 | uint8_t m_navg; 36 | uint32_t m_accum; 37 | uint16_t m_min; 38 | uint16_t m_max; 39 | }; 40 | 41 | #endif 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /DMRDMORX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(DMRDMORX_H) 21 | #define DMRDMORX_H 22 | 23 | #include "DMRDefines.h" 24 | 25 | const uint16_t DMO_BUFFER_LENGTH_BITS = 576U; 26 | 27 | enum DMORX_STATE { 28 | DMORXS_NONE, 29 | DMORXS_VOICE, 30 | DMORXS_DATA 31 | }; 32 | 33 | class CDMRDMORX { 34 | public: 35 | CDMRDMORX(); 36 | 37 | void databit(bool bit); 38 | void setColorCode(uint8_t colorCode); 39 | 40 | void reset(); 41 | 42 | private: 43 | uint64_t m_patternBuffer; 44 | uint8_t m_buffer[DMO_BUFFER_LENGTH_BITS / 8U]; // 72 bytes 45 | uint8_t frame[DMR_FRAME_LENGTH_BYTES + 3U]; 46 | uint16_t m_dataPtr; 47 | uint16_t m_syncPtr; 48 | uint16_t m_startPtr; 49 | uint16_t m_endPtr; 50 | uint8_t m_control; 51 | uint8_t m_syncCount; 52 | uint8_t m_colorCode; 53 | DMORX_STATE m_state; 54 | uint8_t m_n; 55 | uint8_t m_type; 56 | 57 | void correlateSync(); 58 | void bitsToBytes(uint16_t start, uint8_t count, uint8_t* buffer); 59 | void writeRSSIData(uint8_t* frame); 60 | 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /DMRDMOTX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016 by Colin Durbridge G4EML 4 | * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #if !defined(DMRDMOTX_H) 22 | #define DMRDMOTX_H 23 | 24 | #include "DMRDefines.h" 25 | 26 | #include "SerialRB.h" 27 | 28 | class CDMRDMOTX { 29 | public: 30 | CDMRDMOTX(); 31 | 32 | uint8_t writeData(const uint8_t* data, uint8_t length); 33 | 34 | void process(); 35 | 36 | void setCal(bool start); 37 | 38 | void setTXDelay(uint8_t delay); 39 | 40 | uint16_t getSpace() const; 41 | 42 | private: 43 | CSerialRB m_fifo; 44 | uint8_t m_poBuffer[80U]; 45 | uint16_t m_poLen; 46 | uint16_t m_poPtr; 47 | uint16_t m_txDelay; 48 | bool m_delay; 49 | bool m_cal; 50 | 51 | void writeByte(uint8_t c); 52 | void createCal(); 53 | 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /DMRIdleRX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2017,2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(DMRIDLERX_H) 21 | #define DMRIDLERX_H 22 | 23 | #include "Config.h" 24 | 25 | #if defined(DUPLEX) 26 | 27 | #include "DMRDefines.h" 28 | 29 | const uint16_t DMR_IDLE_LENGTH_BITS = 320U; 30 | 31 | class CDMRIdleRX { 32 | public: 33 | CDMRIdleRX(); 34 | 35 | void databit(bool bit); 36 | 37 | void setColorCode(uint8_t colorCode); 38 | 39 | void reset(); 40 | 41 | private: 42 | uint64_t m_patternBuffer; 43 | uint8_t m_buffer[DMR_IDLE_LENGTH_BITS / 8U]; 44 | uint16_t m_dataPtr; 45 | uint16_t m_endPtr; 46 | uint8_t m_colorCode; 47 | 48 | void bitsToBytes(uint16_t start, uint8_t count, uint8_t* buffer); 49 | }; 50 | 51 | #endif 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /DMRRX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "Config.h" 21 | 22 | #if defined(DUPLEX) 23 | 24 | #include "Globals.h" 25 | #include "DMRRX.h" 26 | 27 | CDMRRX::CDMRRX() : 28 | m_control_old(0U) 29 | { 30 | } 31 | 32 | void CDMRRX::databit(bool bit, const uint8_t control) 33 | { 34 | if (control != m_control_old) { 35 | m_control_old = control; 36 | if (control) 37 | m_slotRX.start(true); 38 | else 39 | m_slotRX.start(false); 40 | } 41 | 42 | io.setDecode(m_slotRX.databit(bit)); 43 | } 44 | 45 | void CDMRRX::setColorCode(uint8_t colorCode) 46 | { 47 | m_slotRX.setColorCode(colorCode); 48 | } 49 | 50 | void CDMRRX::setDelay(uint8_t delay) 51 | { 52 | m_slotRX.setDelay(delay); 53 | } 54 | 55 | void CDMRRX::reset() 56 | { 57 | m_slotRX.reset(); 58 | } 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /DMRRX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(DMRRX_H) 21 | #define DMRRX_H 22 | 23 | #include "Config.h" 24 | 25 | #if defined(DUPLEX) 26 | 27 | #include "DMRSlotRX.h" 28 | 29 | class CDMRRX { 30 | public: 31 | CDMRRX(); 32 | 33 | void databit(bool bit, const uint8_t control); 34 | 35 | void setColorCode(uint8_t colorCode); 36 | void setDelay(uint8_t delay); 37 | 38 | void reset(); 39 | 40 | private: 41 | CDMRSlotRX m_slotRX; 42 | uint8_t m_control_old; 43 | }; 44 | 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /DMRSlotRX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2017,2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(DMRSLOTRX_H) 21 | #define DMRSLOTRX_H 22 | 23 | #include "Config.h" 24 | 25 | #if defined(DUPLEX) 26 | 27 | #include "DMRDefines.h" 28 | 29 | const uint16_t DMR_BUFFER_LENGTH_BITS = 576U; 30 | 31 | enum DMRRX_STATE { 32 | DMRRXS_NONE, 33 | DMRRXS_VOICE, 34 | DMRRXS_DATA 35 | }; 36 | 37 | class CDMRSlotRX { 38 | public: 39 | CDMRSlotRX(); 40 | 41 | void start(bool slot); 42 | 43 | bool databit(bool bit); 44 | 45 | void setColorCode(uint8_t colorCode); 46 | void setDelay(uint8_t delay); 47 | 48 | void reset(); 49 | 50 | private: 51 | bool m_slot; 52 | uint64_t m_patternBuffer; 53 | uint8_t m_buffer[DMR_BUFFER_LENGTH_BITS / 8U]; // 72 bytes 54 | uint16_t m_dataPtr; 55 | 56 | uint8_t frame1[DMR_FRAME_LENGTH_BYTES + 3U]; 57 | uint16_t m_syncPtr1; 58 | uint16_t m_startPtr1; 59 | uint16_t m_endPtr1; 60 | uint8_t m_control1; 61 | uint8_t m_syncCount1; 62 | DMRRX_STATE m_state1; 63 | uint8_t m_n1; 64 | uint8_t m_type1; 65 | 66 | uint8_t frame2[DMR_FRAME_LENGTH_BYTES + 3U]; 67 | uint16_t m_syncPtr2; 68 | uint16_t m_startPtr2; 69 | uint16_t m_endPtr2; 70 | uint8_t m_control2; 71 | uint8_t m_syncCount2; 72 | DMRRX_STATE m_state2; 73 | uint8_t m_n2; 74 | uint8_t m_type2; 75 | 76 | uint16_t m_delayPtr; 77 | uint8_t m_colorCode; 78 | uint16_t m_delay; 79 | 80 | void procSlot1(); 81 | void procSlot2(); 82 | void correlateSync(); 83 | void bitsToBytes(uint16_t start, uint8_t count, uint8_t* buffer); 84 | void writeRSSIData1(); 85 | void writeRSSIData2(); 86 | void reset1(); 87 | void reset2(); 88 | }; 89 | 90 | #endif 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /DMRSlotType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 by Jonathan Naylor G4KLX 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(DMRSLOTTYPE_H) 20 | #define DMRSLOTTYPE_H 21 | 22 | class CDMRSlotType { 23 | public: 24 | CDMRSlotType(); 25 | 26 | void decode(const uint8_t* frame, uint8_t& colorCode, uint8_t& dataType) const; 27 | 28 | void encode(uint8_t colorCode, uint8_t dataType, uint8_t* frame) const; 29 | 30 | private: 31 | 32 | uint8_t decode2087(const uint8_t* data) const; 33 | uint32_t getSyndrome1987(uint32_t pattern) const; 34 | }; 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /DMRTX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016 by Colin Durbridge G4EML 4 | * Copyright (C) 2017 by Andy Uribe CA6JAU 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #if !defined(DMRTX_H) 22 | #define DMRTX_H 23 | 24 | #include "Config.h" 25 | 26 | #if defined(DUPLEX) 27 | 28 | #include "DMRDefines.h" 29 | 30 | #include "SerialRB.h" 31 | 32 | enum DMRTXSTATE { 33 | DMRTXSTATE_IDLE, 34 | DMRTXSTATE_SLOT1, 35 | DMRTXSTATE_CACH1, 36 | DMRTXSTATE_SLOT2, 37 | DMRTXSTATE_CACH2, 38 | DMRTXSTATE_CAL 39 | }; 40 | 41 | class CDMRTX { 42 | public: 43 | CDMRTX(); 44 | 45 | uint8_t writeData1(const uint8_t* data, uint8_t length); 46 | uint8_t writeData2(const uint8_t* data, uint8_t length); 47 | 48 | uint8_t writeShortLC(const uint8_t* data, uint8_t length); 49 | uint8_t writeAbort(const uint8_t* data, uint8_t length); 50 | 51 | void setStart(bool start); 52 | 53 | void process(); 54 | 55 | uint8_t getSpace1() const; 56 | uint8_t getSpace2() const; 57 | 58 | void setColorCode(uint8_t colorCode); 59 | 60 | private: 61 | CSerialRB m_fifo[2U]; 62 | DMRTXSTATE m_state; 63 | uint8_t m_idle[DMR_FRAME_LENGTH_BYTES]; 64 | uint8_t m_cachPtr; 65 | uint8_t m_shortLC[12U]; 66 | uint8_t m_newShortLC[12U]; 67 | uint8_t m_markBuffer[40U]; 68 | uint8_t m_poBuffer[40U]; 69 | uint16_t m_poLen; 70 | uint16_t m_poPtr; 71 | uint32_t m_frameCount; 72 | bool m_abort[2U]; 73 | uint8_t m_control_old; 74 | 75 | void createData(uint8_t slotIndex); 76 | void createCACH(uint8_t txSlotIndex, uint8_t rxSlotIndex); 77 | void writeByte(uint8_t c, uint8_t control); 78 | }; 79 | 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /DStarDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2015 by Jonathan Naylor G4KLX 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(DSTARDEFINES_H) 20 | #define DSTARDEFINES_H 21 | 22 | const unsigned int DSTAR_HEADER_LENGTH_BYTES = 41U; 23 | const unsigned int DSTAR_HEADER_LENGTH_BITS = DSTAR_HEADER_LENGTH_BYTES * 8U; 24 | 25 | const unsigned int DSTAR_FEC_SECTION_LENGTH_BYTES = 83U; 26 | const unsigned int DSTAR_FEC_SECTION_LENGTH_BITS = 660U; 27 | 28 | const unsigned int DSTAR_DATA_LENGTH_BYTES = 12U; 29 | const unsigned int DSTAR_DATA_LENGTH_BITS = DSTAR_DATA_LENGTH_BYTES * 8U; 30 | 31 | const uint8_t DSTAR_EOT_BYTES[] = {0x55, 0x55, 0x55, 0x55, 0xC8, 0x7A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; 32 | const unsigned int DSTAR_EOT_LENGTH_BYTES = 6U; 33 | const unsigned int DSTAR_EOT_LENGTH_BITS = DSTAR_EOT_LENGTH_BYTES * 8U; 34 | 35 | const uint8_t DSTAR_DATA_SYNC_LENGTH_BYTES = 3U; 36 | const uint8_t DSTAR_DATA_SYNC_LENGTH_BITS = DSTAR_DATA_SYNC_LENGTH_BYTES * 8U; 37 | 38 | const uint8_t DSTAR_DATA_SYNC_BYTES[] = {0x9E, 0x8D, 0x32, 0x88, 0x26, 0x1A, 0x3F, 0x61, 0xE8, 0x55, 0x2D, 0x16}; 39 | 40 | const uint8_t DSTAR_SLOW_DATA_TYPE_TEXT = 0x40U; 41 | const uint8_t DSTAR_SLOW_DATA_TYPE_HEADER = 0x50U; 42 | 43 | const uint8_t DSTAR_SCRAMBLER_BYTES[] = {0x70U, 0x4FU, 0x93U}; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /DStarRX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(DSTARRX_H) 21 | #define DSTARRX_H 22 | 23 | #include "DStarDefines.h" 24 | 25 | const uint16_t DSTAR_BUFFER_LENGTH_BITS = 800U; 26 | 27 | enum DSRX_STATE { 28 | DSRXS_NONE, 29 | DSRXS_HEADER, 30 | DSRXS_DATA 31 | }; 32 | 33 | class CDStarRX { 34 | public: 35 | CDStarRX(); 36 | 37 | void databit(bool bit); 38 | 39 | void reset(); 40 | 41 | private: 42 | DSRX_STATE m_rxState; 43 | uint64_t m_patternBuffer; 44 | uint8_t m_rxBuffer[DSTAR_BUFFER_LENGTH_BITS / 8U]; 45 | unsigned int m_rxBufferBits; 46 | unsigned int m_dataBits; 47 | unsigned int m_mar; 48 | int m_pathMetric[4U]; 49 | unsigned int m_pathMemory0[42U]; 50 | unsigned int m_pathMemory1[42U]; 51 | unsigned int m_pathMemory2[42U]; 52 | unsigned int m_pathMemory3[42U]; 53 | uint8_t m_fecOutput[42U]; 54 | 55 | void processNone(bool bit); 56 | void processHeader(bool bit); 57 | void processData(bool bit); 58 | bool rxHeader(uint8_t* in, uint8_t* out); 59 | void acs(int* metric); 60 | void viterbiDecode(int* data); 61 | void traceBack(); 62 | bool checksum(const uint8_t* header) const; 63 | void writeRSSIHeader(unsigned char* header); 64 | void writeRSSIData(unsigned char* data); 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /DStarTX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(DSTARTX_H) 21 | #define DSTARTX_H 22 | 23 | #include "SerialRB.h" 24 | 25 | class CDStarTX { 26 | public: 27 | CDStarTX(); 28 | 29 | uint8_t writeHeader(const uint8_t* header, uint8_t length); 30 | uint8_t writeData(const uint8_t* data, uint8_t length); 31 | uint8_t writeEOT(); 32 | 33 | void process(); 34 | 35 | void setTXDelay(uint8_t delay); 36 | 37 | uint16_t getSpace() const; 38 | 39 | private: 40 | CSerialRB m_buffer; 41 | uint8_t m_poBuffer[90U]; 42 | uint16_t m_poLen; 43 | uint16_t m_poPtr; 44 | uint16_t m_txDelay; // In bytes 45 | bool m_delay; 46 | 47 | void txHeader(const uint8_t* in, uint8_t* out) const; 48 | void writeByte(uint8_t c); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(DEBUG_H) 20 | #define DEBUG_H 21 | 22 | #include "Config.h" 23 | #include "Globals.h" 24 | 25 | #if defined(ENABLE_DEBUG) 26 | 27 | #define DEBUG1(a) serial.writeDebug((a)) 28 | #define DEBUG2(a,b) serial.writeDebug((a),(b)) 29 | #define DEBUG2I(a,b) serial.writeDebugI((a),(b)) 30 | #define DEBUG3(a,b,c) serial.writeDebug((a),(b),(c)) 31 | #define DEBUG4(a,b,c,d) serial.writeDebug((a),(b),(c),(d)) 32 | #define DEBUG5(a,b,c,d,e) serial.writeDebug((a),(b),(c),(d),(e)) 33 | 34 | #else 35 | 36 | #define DEBUG1(a) 37 | #define DEBUG2(a,b) 38 | #define DEBUG2I(a,b) 39 | #define DEBUG3(a,b,c) serial.writeDebug((a),(b),(c)) 40 | #define DEBUG4(a,b,c,d) 41 | #define DEBUG5(a,b,c,d,e) 42 | 43 | #endif 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /I2CHost.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(I2CHost_H) 20 | #define I2CHost_H 21 | 22 | #include "Config.h" 23 | 24 | #if defined(STM32_I2C_HOST) 25 | 26 | #define I2C_CLK_FREQ 100000U 27 | #define I2C_TX_FIFO_SIZE 512U 28 | #define I2C_RX_FIFO_SIZE 512U 29 | 30 | class CI2CHost { 31 | public: 32 | CI2CHost(); 33 | 34 | void Init(void); 35 | void I2C_EVHandler(void); 36 | uint8_t AvailI2C(void); 37 | uint8_t ReadI2C(void); 38 | void WriteI2C(const uint8_t* data, uint16_t length); 39 | 40 | private: 41 | void I2C2_ClearFlag(void); 42 | uint16_t txFIFO_level(void); 43 | uint16_t rxFIFO_level(void); 44 | uint8_t txFIFO_put(uint8_t next); 45 | 46 | volatile uint8_t txFIFO[I2C_TX_FIFO_SIZE]; 47 | volatile uint8_t rxFIFO[I2C_RX_FIFO_SIZE]; 48 | volatile uint16_t txFIFO_head, txFIFO_tail; 49 | volatile uint16_t rxFIFO_head, rxFIFO_tail; 50 | 51 | }; 52 | 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /M17Defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016,2017,2018,2020,2021 by Jonathan Naylor G4KLX 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(M17DEFINES_H) 20 | #define M17DEFINES_H 21 | 22 | const unsigned int M17_RADIO_SYMBOL_LENGTH = 5U; // At 24 kHz sample rate 23 | 24 | const unsigned int M17_FRAME_LENGTH_BITS = 384U; 25 | const unsigned int M17_FRAME_LENGTH_BYTES = M17_FRAME_LENGTH_BITS / 8U; 26 | 27 | const unsigned int M17_SYNC_LENGTH_BITS = 16U; 28 | const unsigned int M17_SYNC_LENGTH_BYTES = M17_SYNC_LENGTH_BITS / 8U; 29 | 30 | const uint8_t M17_LINK_SETUP_SYNC_BYTES[] = {0x55U, 0xF7U}; 31 | const uint8_t M17_STREAM_SYNC_BYTES[] = {0xFFU, 0x5DU}; 32 | const uint8_t M17_EOT_SYNC_BYTES[] = {0x55U, 0x5DU}; 33 | 34 | const uint8_t M17_SYNC_BYTES_LENGTH = 2U; 35 | 36 | const uint16_t M17_LINK_SETUP_SYNC_BITS = 0x55F7U; 37 | const uint16_t M17_STREAM_SYNC_BITS = 0xFF5DU; 38 | const uint16_t M17_EOT_SYNC_BITS = 0x555DU; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /M17RX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2018,2020,2021 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016-2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(M17RX_H) 21 | #define M17RX_H 22 | 23 | #include "M17Defines.h" 24 | 25 | enum M17RX_STATE { 26 | M17RXS_NONE, 27 | M17RXS_LINK_SETUP, 28 | M17RXS_STREAM 29 | }; 30 | 31 | class CM17RX { 32 | public: 33 | CM17RX(); 34 | 35 | void databit(bool bit); 36 | 37 | void reset(); 38 | 39 | private: 40 | M17RX_STATE m_state; 41 | uint16_t m_bitBuffer; 42 | uint8_t m_outBuffer[M17_FRAME_LENGTH_BYTES + 3U]; 43 | uint8_t* m_buffer; 44 | uint16_t m_bufferPtr; 45 | uint16_t m_lostCount; 46 | 47 | void processNone(bool bit); 48 | void processData(bool bit); 49 | void writeRSSILinkSetup(uint8_t* data); 50 | void writeRSSIStream(uint8_t* data); 51 | }; 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /M17TX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2018,2020,2021 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "Config.h" 21 | #include "Globals.h" 22 | #include "M17TX.h" 23 | 24 | #include "M17Defines.h" 25 | 26 | const uint8_t M17_SYNC = 0x77U; 27 | const uint8_t M17_PREAMBLE = 0x77U; 28 | 29 | CM17TX::CM17TX() : 30 | m_buffer(1500U), 31 | m_poBuffer(), 32 | m_poLen(0U), 33 | m_poPtr(0U), 34 | m_txDelay(240U), // 200ms 35 | m_delay(false) 36 | { 37 | } 38 | 39 | void CM17TX::process() 40 | { 41 | if (m_buffer.getData() == 0U && m_poLen == 0U) 42 | return; 43 | 44 | if (m_poLen == 0U) { 45 | if (!m_tx) { 46 | m_delay = true; 47 | m_poLen = m_txDelay; 48 | } else { 49 | m_delay = false; 50 | for (uint8_t i = 0U; i < M17_FRAME_LENGTH_BYTES; i++) 51 | m_poBuffer[m_poLen++] = m_buffer.get(); 52 | } 53 | 54 | m_poPtr = 0U; 55 | } 56 | 57 | if (m_poLen > 0U) { 58 | uint16_t space = io.getSpace(); 59 | 60 | while (space > 8U) { 61 | if (m_delay) { 62 | writeByte(M17_SYNC); 63 | m_poPtr++; 64 | } else 65 | writeByte(m_poBuffer[m_poPtr++]); 66 | 67 | space -= 8U; 68 | 69 | if (m_poPtr >= m_poLen) { 70 | if (m_delay) { 71 | m_delay = false; 72 | m_poPtr = 0U; 73 | m_poLen = 3U; 74 | } else { 75 | m_poPtr = 0U; 76 | m_poLen = 0U; 77 | m_delay = false; 78 | return; 79 | } 80 | } 81 | } 82 | } 83 | } 84 | 85 | uint8_t CM17TX::writeData(const uint8_t* data, uint8_t length) 86 | { 87 | if (length != (M17_FRAME_LENGTH_BYTES + 1U)) 88 | return 4U; 89 | 90 | uint16_t space = m_buffer.getSpace(); 91 | if (space < M17_FRAME_LENGTH_BYTES) 92 | return 5U; 93 | 94 | for (uint8_t i = 0U; i < M17_FRAME_LENGTH_BYTES; i++) 95 | m_buffer.put(data[i + 1U]); 96 | 97 | return 0U; 98 | } 99 | 100 | void CM17TX::writeByte(uint8_t c) 101 | { 102 | uint8_t bit; 103 | uint8_t mask = 0x80U; 104 | 105 | for (uint8_t i = 0U; i < 8U; i++, c <<= 1) { 106 | if ((c & mask) == mask) 107 | bit = 1U; 108 | else 109 | bit = 0U; 110 | 111 | io.write(&bit, 1); 112 | } 113 | } 114 | 115 | void CM17TX::setTXDelay(uint8_t delay) 116 | { 117 | m_txDelay = 600U + uint16_t(delay) * 12U; // 500ms + tx delay 118 | } 119 | 120 | uint8_t CM17TX::getSpace() const 121 | { 122 | return m_buffer.getSpace() / M17_FRAME_LENGTH_BYTES; 123 | } 124 | 125 | -------------------------------------------------------------------------------- /M17TX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017,2020,2021 by Jonathan Naylor G4KLX 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(M17TX_H) 20 | #define M17TX_H 21 | 22 | #include "Config.h" 23 | 24 | #include "SerialRB.h" 25 | 26 | class CM17TX { 27 | public: 28 | CM17TX(); 29 | 30 | uint8_t writeData(const uint8_t* data, uint8_t length); 31 | 32 | void process(); 33 | 34 | void setTXDelay(uint8_t delay); 35 | 36 | uint8_t getSpace() const; 37 | 38 | private: 39 | CSerialRB m_buffer; 40 | uint8_t m_poBuffer[1200U]; 41 | uint16_t m_poLen; 42 | uint16_t m_poPtr; 43 | uint16_t m_txDelay; 44 | bool m_delay; 45 | 46 | void writeByte(uint8_t c); 47 | }; 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /MMDVM_HS.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016 by Colin Durbridge G4EML 4 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "Config.h" 22 | #include "Globals.h" 23 | 24 | // Global variables 25 | MMDVM_STATE m_modemState = STATE_IDLE; 26 | MMDVM_STATE m_calState = STATE_IDLE; 27 | MMDVM_STATE m_modemState_prev = STATE_IDLE; 28 | 29 | bool m_cwid_state = false; 30 | bool m_pocsag_state = false; 31 | 32 | uint8_t m_cwIdTXLevel = 30; 33 | 34 | uint32_t m_modeTimerCnt; 35 | 36 | bool m_dstarEnable = true; 37 | bool m_dmrEnable = true; 38 | bool m_ysfEnable = true; 39 | bool m_p25Enable = true; 40 | bool m_nxdnEnable = true; 41 | bool m_m17Enable = true; 42 | bool m_pocsagEnable = true; 43 | 44 | bool m_duplex = false; 45 | 46 | bool m_tx = false; 47 | bool m_dcd = false; 48 | 49 | CDStarRX dstarRX; 50 | CDStarTX dstarTX; 51 | 52 | uint8_t m_control; 53 | 54 | #if defined(DUPLEX) 55 | CDMRIdleRX dmrIdleRX; 56 | CDMRRX dmrRX; 57 | CDMRTX dmrTX; 58 | #endif 59 | 60 | CDMRDMORX dmrDMORX; 61 | CDMRDMOTX dmrDMOTX; 62 | 63 | CYSFRX ysfRX; 64 | CYSFTX ysfTX; 65 | 66 | CP25RX p25RX; 67 | CP25TX p25TX; 68 | 69 | CM17RX m17RX; 70 | CM17TX m17TX; 71 | 72 | CNXDNRX nxdnRX; 73 | CNXDNTX nxdnTX; 74 | 75 | CPOCSAGTX pocsagTX; 76 | 77 | CCalDMR calDMR; 78 | 79 | #if defined(SEND_RSSI_DATA) 80 | CCalRSSI calRSSI; 81 | #endif 82 | 83 | CCWIdTX cwIdTX; 84 | 85 | CSerialPort serial; 86 | CIO io; 87 | 88 | void setup() 89 | { 90 | serial.start(); 91 | } 92 | 93 | void loop() 94 | { 95 | serial.process(); 96 | io.process(); 97 | 98 | // The following is for transmitting 99 | if (m_dstarEnable && m_modemState == STATE_DSTAR) 100 | dstarTX.process(); 101 | 102 | if (m_dmrEnable && m_modemState == STATE_DMR && m_calState == STATE_IDLE) { 103 | #if defined(DUPLEX) 104 | if (m_duplex) 105 | dmrTX.process(); 106 | else 107 | dmrDMOTX.process(); 108 | #else 109 | dmrDMOTX.process(); 110 | #endif 111 | } 112 | 113 | if (m_ysfEnable && m_modemState == STATE_YSF) 114 | ysfTX.process(); 115 | 116 | if (m_p25Enable && m_modemState == STATE_P25) 117 | p25TX.process(); 118 | 119 | if (m_nxdnEnable && m_modemState == STATE_NXDN) 120 | nxdnTX.process(); 121 | 122 | if (m_m17Enable && m_modemState == STATE_M17) 123 | m17TX.process(); 124 | 125 | if (m_pocsagEnable && (m_modemState == STATE_POCSAG || pocsagTX.busy())) 126 | pocsagTX.process(); 127 | 128 | if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K || m_calState == STATE_INTCAL) 129 | calDMR.process(); 130 | 131 | #if defined(SEND_RSSI_DATA) 132 | if (m_calState == STATE_RSSICAL) 133 | calRSSI.process(); 134 | #endif 135 | 136 | if (m_modemState == STATE_IDLE) 137 | cwIdTX.process(); 138 | } 139 | -------------------------------------------------------------------------------- /NXDNDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(NXDNDEFINES_H) 21 | #define NXDNDEFINES_H 22 | 23 | const unsigned int NXDN_FRAME_LENGTH_BITS = 384U; 24 | const unsigned int NXDN_FRAME_LENGTH_BYTES = NXDN_FRAME_LENGTH_BITS / 8U; 25 | 26 | const unsigned int NXDN_FSW_LENGTH_BITS = 20U; 27 | 28 | const uint8_t NXDN_FSW_BYTES[] = {0xCDU, 0xF5U, 0x90U}; 29 | const uint8_t NXDN_FSW_BYTES_MASK[] = {0xFFU, 0xFFU, 0xF0U}; 30 | const uint8_t NXDN_FSW_BYTES_LENGTH = 3U; 31 | 32 | const uint32_t NXDN_FSW_BITS = 0x000CDF59U; 33 | const uint32_t NXDN_FSW_BITS_MASK = 0x000FFFFFU; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /NXDNRX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(NXDNRX_H) 21 | #define NXDNRX_H 22 | 23 | #include "NXDNDefines.h" 24 | 25 | enum NXDNRX_STATE { 26 | NXDNRXS_NONE, 27 | NXDNRXS_DATA 28 | }; 29 | 30 | class CNXDNRX { 31 | public: 32 | CNXDNRX(); 33 | 34 | void databit(bool bit); 35 | 36 | void reset(); 37 | 38 | private: 39 | NXDNRX_STATE m_state; 40 | uint64_t m_bitBuffer; 41 | uint8_t m_outBuffer[NXDN_FRAME_LENGTH_BYTES + 3U]; 42 | uint8_t* m_buffer; 43 | uint16_t m_bufferPtr; 44 | uint16_t m_lostCount; 45 | 46 | void processNone(bool bit); 47 | void processData(bool bit); 48 | void writeRSSIData(uint8_t* data); 49 | 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /NXDNTX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2016,2018 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "Config.h" 21 | #include "Globals.h" 22 | #include "NXDNTX.h" 23 | 24 | #include "NXDNDefines.h" 25 | 26 | const uint8_t NXDN_PREAMBLE[] = {0x57U, 0x75U, 0xFDU}; 27 | const uint8_t NXDN_SYNC = 0x5FU; 28 | 29 | CNXDNTX::CNXDNTX() : 30 | m_buffer(1500U), 31 | m_poBuffer(), 32 | m_poLen(0U), 33 | m_poPtr(0U), 34 | m_txDelay(240U), // 200ms 35 | m_delay(false), 36 | m_preamble(false) 37 | { 38 | } 39 | 40 | void CNXDNTX::process() 41 | { 42 | if (m_buffer.getData() == 0U && m_poLen == 0U) 43 | return; 44 | 45 | if (m_poLen == 0U) { 46 | if (!m_tx) { 47 | m_delay = true; 48 | m_preamble = false; 49 | m_poLen = m_txDelay; 50 | } else { 51 | m_delay = false; 52 | m_preamble = false; 53 | for (uint8_t i = 0U; i < NXDN_FRAME_LENGTH_BYTES; i++) 54 | m_poBuffer[m_poLen++] = m_buffer.get(); 55 | } 56 | 57 | m_poPtr = 0U; 58 | } 59 | 60 | if (m_poLen > 0U) { 61 | uint16_t space = io.getSpace(); 62 | 63 | while (space > 8U) { 64 | if (m_delay) { 65 | writeByte(NXDN_SYNC); 66 | m_poPtr++; 67 | } else if (m_preamble) { 68 | writeByte(NXDN_PREAMBLE[m_poPtr++]); 69 | } 70 | else 71 | writeByte(m_poBuffer[m_poPtr++]); 72 | 73 | space -= 8U; 74 | 75 | if (m_poPtr >= m_poLen) { 76 | if (m_delay) { 77 | m_preamble = true; 78 | m_delay = false; 79 | m_poPtr = 0U; 80 | m_poLen = 3U; 81 | } else { 82 | m_poPtr = 0U; 83 | m_poLen = 0U; 84 | m_preamble = false; 85 | m_delay = false; 86 | return; 87 | } 88 | } 89 | } 90 | } 91 | } 92 | 93 | uint8_t CNXDNTX::writeData(const uint8_t* data, uint8_t length) 94 | { 95 | if (length != (NXDN_FRAME_LENGTH_BYTES + 1U)) 96 | return 4U; 97 | 98 | uint16_t space = m_buffer.getSpace(); 99 | if (space < NXDN_FRAME_LENGTH_BYTES) 100 | return 5U; 101 | 102 | for (uint8_t i = 0U; i < NXDN_FRAME_LENGTH_BYTES; i++) 103 | m_buffer.put(data[i + 1U]); 104 | 105 | return 0U; 106 | } 107 | 108 | void CNXDNTX::writeByte(uint8_t c) 109 | { 110 | uint8_t bit; 111 | uint8_t mask = 0x80U; 112 | 113 | for (uint8_t i = 0U; i < 8U; i++, c <<= 1) { 114 | if ((c & mask) == mask) 115 | bit = 1U; 116 | else 117 | bit = 0U; 118 | 119 | io.write(&bit, 1); 120 | } 121 | } 122 | 123 | void CNXDNTX::setTXDelay(uint8_t delay) 124 | { 125 | m_txDelay = 300U + uint16_t(delay) * 6U; // 500ms + tx delay 126 | } 127 | 128 | uint16_t CNXDNTX::getSpace() const 129 | { 130 | return m_buffer.getSpace() / NXDN_FRAME_LENGTH_BYTES; 131 | } 132 | 133 | -------------------------------------------------------------------------------- /NXDNTX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(NXDNTX_H) 21 | #define NXDNTX_H 22 | 23 | #include "SerialRB.h" 24 | 25 | class CNXDNTX { 26 | public: 27 | CNXDNTX(); 28 | 29 | uint8_t writeData(const uint8_t* data, uint8_t length); 30 | 31 | void process(); 32 | 33 | void setTXDelay(uint8_t delay); 34 | 35 | uint16_t getSpace() const; 36 | 37 | private: 38 | CSerialRB m_buffer; 39 | uint8_t m_poBuffer[60U]; 40 | uint16_t m_poLen; 41 | uint16_t m_poPtr; 42 | uint16_t m_txDelay; 43 | bool m_delay; 44 | bool m_preamble; 45 | 46 | void writeByte(uint8_t c); 47 | }; 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /P25Defines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(P25DEFINES_H) 21 | #define P25DEFINES_H 22 | 23 | const unsigned int P25_HDR_FRAME_LENGTH_BYTES = 99U; 24 | const unsigned int P25_HDR_FRAME_LENGTH_BITS = P25_HDR_FRAME_LENGTH_BYTES * 8U; 25 | 26 | const unsigned int P25_LDU_FRAME_LENGTH_BYTES = 216U; 27 | const unsigned int P25_LDU_FRAME_LENGTH_BITS = P25_LDU_FRAME_LENGTH_BYTES * 8U; 28 | 29 | const unsigned int P25_TERMLC_FRAME_LENGTH_BYTES = 54U; 30 | const unsigned int P25_TERMLC_FRAME_LENGTH_BITS = P25_TERMLC_FRAME_LENGTH_BYTES * 8U; 31 | 32 | const unsigned int P25_TERM_FRAME_LENGTH_BYTES = 18U; 33 | const unsigned int P25_TERM_FRAME_LENGTH_BITS = P25_TERM_FRAME_LENGTH_BYTES * 8U; 34 | 35 | const unsigned int P25_TSDU_FRAME_LENGTH_BYTES = 45U; 36 | const unsigned int P25_TSDU_FRAME_LENGTH_BITS = P25_TSDU_FRAME_LENGTH_BYTES * 8U; 37 | 38 | const unsigned int P25_PDU_HDR_FRAME_LENGTH_BYTES = 45U; 39 | const unsigned int P25_PDU_HDR_FRAME_LENGTH_BITS = P25_PDU_HDR_FRAME_LENGTH_BYTES * 8U; 40 | 41 | const unsigned int P25_SYNC_LENGTH_BYTES = 6U; 42 | const unsigned int P25_SYNC_LENGTH_BITS = P25_SYNC_LENGTH_BYTES * 8U; 43 | 44 | const unsigned int P25_NID_LENGTH_BYTES = 8U; 45 | const unsigned int P25_NID_LENGTH_BITS = P25_NID_LENGTH_BYTES * 8U; 46 | 47 | const uint8_t P25_SYNC_BYTES[] = {0x55U, 0x75U, 0xF5U, 0xFFU, 0x77U, 0xFFU}; 48 | const uint8_t P25_SYNC_BYTES_LENGTH = 6U; 49 | 50 | const uint64_t P25_SYNC_BITS = 0x00005575F5FF77FFU; 51 | const uint64_t P25_SYNC_BITS_MASK = 0x0000FFFFFFFFFFFFU; 52 | 53 | const uint8_t P25_DUID_HDU = 0x00U; // Header Data Unit 54 | const uint8_t P25_DUID_TDU = 0x03U; // Simple Terminator Data Unit 55 | const uint8_t P25_DUID_LDU1 = 0x05U; // Logical Link Data Unit 1 56 | const uint8_t P25_DUID_TSDU = 0x07U; // Trunking System Data Unit 57 | const uint8_t P25_DUID_LDU2 = 0x0AU; // Logical Link Data Unit 2 58 | const uint8_t P25_DUID_PDU = 0x0CU; // Packet Data Unit 59 | const uint8_t P25_DUID_TDULC = 0x0FU; // Terminator Data Unit with Link Control 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /P25RX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(P25RX_H) 21 | #define P25RX_H 22 | 23 | #include "P25Defines.h" 24 | 25 | enum P25RX_STATE { 26 | P25RXS_NONE, 27 | P25RXS_HDR, 28 | P25RXS_LDU 29 | }; 30 | 31 | class CP25RX { 32 | public: 33 | CP25RX(); 34 | 35 | void databit(bool bit); 36 | 37 | void reset(); 38 | 39 | private: 40 | P25RX_STATE m_state; 41 | uint64_t m_bitBuffer; 42 | uint8_t m_outBuffer[P25_LDU_FRAME_LENGTH_BYTES + 3U]; 43 | uint8_t* m_buffer; 44 | uint16_t m_bufferPtr; 45 | uint16_t m_endPtr; 46 | uint16_t m_lostCount; 47 | uint8_t m_duid; 48 | 49 | void processNone(bool bit); 50 | void processHdr(bool bit); 51 | void processLdu(bool bit); 52 | void writeRSSILdu(uint8_t* data); 53 | void setEndPtr(); 54 | }; 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /P25TX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "Config.h" 21 | #include "Globals.h" 22 | #include "P25TX.h" 23 | 24 | #include "P25Defines.h" 25 | 26 | const uint8_t P25_START_SYNC = 0x77U; 27 | 28 | CP25TX::CP25TX() : 29 | m_buffer(1500U), 30 | m_poBuffer(), 31 | m_poLen(0U), 32 | m_poPtr(0U), 33 | m_txDelay(240U), // 200ms 34 | m_delay(false) 35 | { 36 | } 37 | 38 | void CP25TX::process() 39 | { 40 | if (m_buffer.getData() == 0U && m_poLen == 0U) 41 | return; 42 | 43 | if (m_poLen == 0U) { 44 | if (!m_tx) { 45 | m_delay = true; 46 | m_poLen = m_txDelay; 47 | } else { 48 | uint8_t length = m_buffer.get(); 49 | m_delay = false; 50 | for (uint8_t i = 0U; i < length; i++) { 51 | m_poBuffer[m_poLen++] = m_buffer.get(); 52 | } 53 | } 54 | 55 | m_poPtr = 0U; 56 | } 57 | 58 | if (m_poLen > 0U) { 59 | uint16_t space = io.getSpace(); 60 | 61 | while (space > 8U) { 62 | if (m_delay) { 63 | m_poPtr++; 64 | writeByte(P25_START_SYNC); 65 | } else 66 | writeByte(m_poBuffer[m_poPtr++]); 67 | 68 | space -= 8U; 69 | 70 | if (m_poPtr >= m_poLen) { 71 | m_poPtr = 0U; 72 | m_poLen = 0U; 73 | m_delay = false; 74 | return; 75 | } 76 | } 77 | } 78 | } 79 | 80 | uint8_t CP25TX::writeData(const uint8_t* data, uint8_t length) 81 | { 82 | if (length < (P25_TERM_FRAME_LENGTH_BYTES + 1U)) 83 | return 4U; 84 | 85 | uint16_t space = m_buffer.getSpace(); 86 | if (space < length) 87 | return 5U; 88 | 89 | m_buffer.put(length - 1U); 90 | 91 | for (uint8_t i = 0U; i < (length - 1U); i++) 92 | m_buffer.put(data[i + 1U]); 93 | 94 | return 0U; 95 | } 96 | 97 | void CP25TX::writeByte(uint8_t c) 98 | { 99 | uint8_t bit; 100 | uint8_t mask = 0x80U; 101 | 102 | for (uint8_t i = 0U; i < 8U; i++, c <<= 1) { 103 | if ((c & mask) == mask) 104 | bit = 1U; 105 | else 106 | bit = 0U; 107 | 108 | io.write(&bit, 1); 109 | } 110 | } 111 | 112 | void CP25TX::setTXDelay(uint8_t delay) 113 | { 114 | m_txDelay = 600U + uint16_t(delay) * 12U; // 500ms + tx delay 115 | } 116 | 117 | uint16_t CP25TX::getSpace() const 118 | { 119 | return m_buffer.getSpace() / P25_LDU_FRAME_LENGTH_BYTES; 120 | } 121 | -------------------------------------------------------------------------------- /P25TX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016,2017 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(P25TX_H) 21 | #define P25TX_H 22 | 23 | #include "SerialRB.h" 24 | 25 | class CP25TX { 26 | public: 27 | CP25TX(); 28 | 29 | uint8_t writeData(const uint8_t* data, uint8_t length); 30 | 31 | void process(); 32 | 33 | void setTXDelay(uint8_t delay); 34 | 35 | uint16_t getSpace() const; 36 | 37 | private: 38 | CSerialRB m_buffer; 39 | uint8_t m_poBuffer[250U]; 40 | uint16_t m_poLen; 41 | uint16_t m_poPtr; 42 | uint16_t m_txDelay; 43 | bool m_delay; 44 | 45 | void writeByte(uint8_t c); 46 | }; 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /POCSAGDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2018 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(POCSAGDEFINES_H) 21 | #define POCSAGDEFINES_H 22 | 23 | const uint16_t POCSAG_PREAMBLE_LENGTH_BYTES = 18U * sizeof(uint32_t); 24 | const uint16_t POCSAG_FRAME_LENGTH_BYTES = 17U * sizeof(uint32_t); 25 | const uint8_t POCSAG_SYNC = 0xAAU; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /POCSAGTX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018,2019 by Andy Uribe CA6JAU 4 | * Copyright (C) 2019 by Florian Wolters DF2ET 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #include "Config.h" 22 | #include "Globals.h" 23 | #include "POCSAGTX.h" 24 | #include "POCSAGDefines.h" 25 | 26 | CPOCSAGTX::CPOCSAGTX() : 27 | m_buffer(1000U), 28 | m_poBuffer(), 29 | m_poLen(0U), 30 | m_poPtr(0U), 31 | m_txDelay(POCSAG_PREAMBLE_LENGTH_BYTES), 32 | m_delay(false), 33 | m_cal(false) 34 | { 35 | } 36 | 37 | void CPOCSAGTX::process() 38 | { 39 | if (m_cal) { 40 | m_delay = false; 41 | createCal(); 42 | } 43 | 44 | if (m_poLen == 0U && m_buffer.getData() > 0U) { 45 | if (!m_tx) { 46 | m_delay = true; 47 | m_poLen = m_txDelay; 48 | } else { 49 | m_delay = false; 50 | for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) 51 | m_poBuffer[i] = m_buffer.get(); 52 | 53 | m_poLen = POCSAG_FRAME_LENGTH_BYTES; 54 | } 55 | m_poPtr = 0U; 56 | } 57 | 58 | if (m_poLen > 0U) { 59 | uint16_t space = io.getSpace(); 60 | 61 | while (space > 8U) { 62 | if (m_delay) { 63 | m_poPtr++; 64 | writeByte(POCSAG_SYNC); 65 | } else 66 | writeByte(m_poBuffer[m_poPtr++]); 67 | 68 | space -= 8U; 69 | 70 | if (m_poPtr >= m_poLen) { 71 | m_poPtr = 0U; 72 | m_poLen = 0U; 73 | m_delay = false; 74 | return; 75 | } 76 | } 77 | } 78 | } 79 | 80 | bool CPOCSAGTX::busy() 81 | { 82 | if (m_poLen > 0U || m_buffer.getData() > 0U) 83 | return true; 84 | else 85 | return false; 86 | } 87 | 88 | uint8_t CPOCSAGTX::writeData(const uint8_t* data, uint8_t length) 89 | { 90 | if (length != POCSAG_FRAME_LENGTH_BYTES) 91 | return 4U; 92 | 93 | uint16_t space = m_buffer.getSpace(); 94 | if (space < POCSAG_FRAME_LENGTH_BYTES) 95 | return 5U; 96 | 97 | for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) 98 | m_buffer.put(data[i]); 99 | 100 | return 0U; 101 | } 102 | 103 | void CPOCSAGTX::writeByte(uint8_t c) 104 | { 105 | uint8_t bit; 106 | uint8_t mask = 0x80U; 107 | 108 | for (uint8_t i = 0U; i < 8U; i++, c <<= 1) { 109 | if ((c & mask) == mask) 110 | bit = 1U; 111 | else 112 | bit = 0U; 113 | 114 | io.write(&bit, 1); 115 | } 116 | } 117 | 118 | void CPOCSAGTX::setTXDelay(uint8_t delay) 119 | { 120 | m_txDelay = POCSAG_PREAMBLE_LENGTH_BYTES + (delay * 3U) / 2U; 121 | 122 | if (m_txDelay > 150U) 123 | m_txDelay = 150U; 124 | } 125 | 126 | uint8_t CPOCSAGTX::getSpace() const 127 | { 128 | return m_buffer.getSpace() / POCSAG_FRAME_LENGTH_BYTES; 129 | } 130 | 131 | uint8_t CPOCSAGTX::setCal(const uint8_t* data, uint8_t length) 132 | { 133 | if (length != 1U) 134 | return 4U; 135 | 136 | m_cal = data[0U] == 1U; 137 | 138 | if (m_cal) 139 | io.ifConf(STATE_POCSAG, true); 140 | 141 | return 0U; 142 | } 143 | 144 | void CPOCSAGTX::createCal() 145 | { 146 | // 600 Hz square wave generation 147 | for (unsigned int i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) { 148 | m_poBuffer[i] = 0xAAU; 149 | } 150 | 151 | m_poLen = POCSAG_FRAME_LENGTH_BYTES; 152 | 153 | m_poPtr = 0U; 154 | } 155 | -------------------------------------------------------------------------------- /POCSAGTX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018,2019 by Andy Uribe CA6JAU 4 | * Copyright (C) 2019 by Florian Wolters DF2ET 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | */ 20 | 21 | #if !defined(POCSAGTX_H) 22 | #define POCSAGTX_H 23 | 24 | class CPOCSAGTX { 25 | public: 26 | CPOCSAGTX(); 27 | 28 | uint8_t writeData(const uint8_t* data, uint8_t length); 29 | 30 | void setTXDelay(uint8_t delay); 31 | 32 | uint8_t setCal(const uint8_t* data, uint8_t length); 33 | 34 | void createCal(); 35 | 36 | uint8_t getSpace() const; 37 | 38 | void process(); 39 | 40 | bool busy(); 41 | 42 | private: 43 | CSerialRB m_buffer; 44 | uint8_t m_poBuffer[200U]; 45 | uint16_t m_poLen; 46 | uint16_t m_poPtr; 47 | uint16_t m_txDelay; 48 | bool m_delay; 49 | bool m_cal; 50 | 51 | void writeByte(uint8_t c); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /SerialPort.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2018,2020,2021 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(SERIALPORT_H) 21 | #define SERIALPORT_H 22 | 23 | #include "Globals.h" 24 | 25 | class CSerialPort { 26 | public: 27 | CSerialPort(); 28 | 29 | void start(); 30 | 31 | void process(); 32 | 33 | #if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1) 34 | void writeSerialRpt(const uint8_t* data, uint8_t length); 35 | #endif 36 | 37 | void writeDStarHeader(const uint8_t* header, uint8_t length); 38 | void writeDStarData(const uint8_t* data, uint8_t length); 39 | void writeDStarLost(); 40 | void writeDStarEOT(); 41 | 42 | void writeDMRData(bool slot, const uint8_t* data, uint8_t length); 43 | void writeDMRLost(bool slot); 44 | 45 | void writeYSFData(const uint8_t* data, uint8_t length); 46 | void writeYSFLost(); 47 | 48 | void writeP25Hdr(const uint8_t* data, uint8_t length); 49 | void writeP25Ldu(const uint8_t* data, uint8_t length); 50 | void writeP25Lost(); 51 | 52 | void writeNXDNData(const uint8_t* data, uint8_t length); 53 | void writeNXDNLost(); 54 | 55 | void writeM17LinkSetup(const uint8_t* data, uint8_t length); 56 | void writeM17Stream(const uint8_t* data, uint8_t length); 57 | void writeM17EOT(); 58 | void writeM17Lost(); 59 | 60 | #if defined(SEND_RSSI_DATA) 61 | void writeRSSIData(const uint8_t* data, uint8_t length); 62 | #endif 63 | 64 | #if defined(ENABLE_DEBUG) 65 | void writeDebug(const char* text); 66 | void writeDebug(const char* text, int16_t n1); 67 | void writeDebugI(const char* text, int32_t n1); 68 | void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3); 69 | void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3, int16_t n4); 70 | #endif 71 | void writeDebug(const char* text, int16_t n1, int16_t n2); 72 | 73 | private: 74 | uint8_t m_buffer[256U]; 75 | uint8_t m_ptr; 76 | uint8_t m_len; 77 | uint8_t m_serial_buffer[128U]; 78 | uint8_t m_serial_len; 79 | 80 | bool m_debug; 81 | bool m_firstCal; 82 | 83 | void sendACK(); 84 | void sendNAK(uint8_t err); 85 | void getStatus(); 86 | void getVersion(); 87 | uint8_t setConfig(const uint8_t* data, uint8_t length); 88 | uint8_t setMode(const uint8_t* data, uint8_t length); 89 | void setMode(MMDVM_STATE modemState); 90 | uint8_t setFreq(const uint8_t* data, uint8_t length); 91 | 92 | // Hardware versions 93 | void beginInt(uint8_t n, int speed); 94 | int availableInt(uint8_t n); 95 | uint8_t readInt(uint8_t n); 96 | void writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool flush = false); 97 | }; 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /SerialRB.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Serial RB control - Copyright (C) KI6ZUM 2015 3 | Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the 17 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #include "SerialRB.h" 22 | 23 | CSerialRB::CSerialRB(uint16_t length) : 24 | m_length(length), 25 | m_buffer(NULL), 26 | m_head(0U), 27 | m_tail(0U), 28 | m_full(false) 29 | { 30 | m_buffer = new uint8_t[length]; 31 | } 32 | 33 | void CSerialRB::reset() 34 | { 35 | m_head = 0U; 36 | m_tail = 0U; 37 | m_full = false; 38 | } 39 | 40 | uint16_t CSerialRB::getSpace() const 41 | { 42 | uint16_t n = 0U; 43 | 44 | if (m_tail == m_head) 45 | n = m_full ? 0U : m_length; 46 | else if (m_tail < m_head) 47 | n = m_length - m_head + m_tail; 48 | else 49 | n = m_tail - m_head; 50 | 51 | if (n > m_length) 52 | n = 0U; 53 | 54 | return n; 55 | } 56 | 57 | uint16_t CSerialRB::getData() const 58 | { 59 | if (m_tail == m_head) 60 | return m_full ? m_length : 0U; 61 | else if (m_tail < m_head) 62 | return m_head - m_tail; 63 | else 64 | return m_length - m_tail + m_head; 65 | } 66 | 67 | bool CSerialRB::put(uint8_t c) 68 | { 69 | if (m_full) 70 | return false; 71 | 72 | m_buffer[m_head] = c; 73 | 74 | m_head++; 75 | if (m_head >= m_length) 76 | m_head = 0U; 77 | 78 | if (m_head == m_tail) 79 | m_full = true; 80 | 81 | return true; 82 | } 83 | 84 | uint8_t CSerialRB::peek() const 85 | { 86 | return m_buffer[m_tail]; 87 | } 88 | 89 | uint8_t CSerialRB::get() 90 | { 91 | uint8_t value = m_buffer[m_tail]; 92 | 93 | m_full = false; 94 | 95 | m_tail++; 96 | if (m_tail >= m_length) 97 | m_tail = 0U; 98 | 99 | return value; 100 | } 101 | 102 | -------------------------------------------------------------------------------- /SerialRB.h: -------------------------------------------------------------------------------- 1 | /* 2 | Serial fifo control - Copyright (C) KI6ZUM 2015 3 | Copyright (C) 2015,2016 by Jonathan Naylor G4KLX 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the 17 | Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 18 | Boston, MA 02110-1301, USA. 19 | */ 20 | 21 | #if !defined(SERIALRB_H) 22 | #define SERIALRB_H 23 | 24 | #if defined(STM32F10X_MD) 25 | #include "stm32f10x.h" 26 | #elif defined(STM32F4XX) 27 | #include "stm32f4xx.h" 28 | #elif defined(STM32F7XX) 29 | #include "stm32f7xx.h" 30 | #else 31 | #include 32 | #endif 33 | 34 | const uint16_t SERIAL_RINGBUFFER_SIZE = 1000U; 35 | 36 | class CSerialRB { 37 | public: 38 | CSerialRB(uint16_t length = SERIAL_RINGBUFFER_SIZE); 39 | 40 | uint16_t getSpace() const; 41 | 42 | uint16_t getData() const; 43 | 44 | void reset(); 45 | 46 | bool put(uint8_t c); 47 | 48 | uint8_t peek() const; 49 | 50 | uint8_t get(); 51 | 52 | private: 53 | uint16_t m_length; 54 | volatile uint8_t* m_buffer; 55 | volatile uint16_t m_head; 56 | volatile uint16_t m_tail; 57 | volatile bool m_full; 58 | }; 59 | 60 | #endif 61 | 62 | -------------------------------------------------------------------------------- /Utils.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2020 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "Utils.h" 21 | 22 | const uint8_t BITS_TABLE[] = { 23 | # define B2(n) n, n+1, n+1, n+2 24 | # define B4(n) B2(n), B2(n+1), B2(n+1), B2(n+2) 25 | # define B6(n) B4(n), B4(n+1), B4(n+1), B4(n+2) 26 | B6(0), B6(1), B6(1), B6(2) 27 | }; 28 | 29 | uint8_t countBits8(uint8_t bits) 30 | { 31 | return BITS_TABLE[bits]; 32 | } 33 | 34 | uint8_t countBits16(uint16_t bits) 35 | { 36 | uint8_t* p = (uint8_t*)&bits; 37 | uint8_t n = 0U; 38 | n += BITS_TABLE[p[0U]]; 39 | n += BITS_TABLE[p[1U]]; 40 | return n; 41 | } 42 | 43 | uint8_t countBits32(uint32_t bits) 44 | { 45 | uint8_t* p = (uint8_t*)&bits; 46 | uint8_t n = 0U; 47 | n += BITS_TABLE[p[0U]]; 48 | n += BITS_TABLE[p[1U]]; 49 | n += BITS_TABLE[p[2U]]; 50 | n += BITS_TABLE[p[3U]]; 51 | return n; 52 | } 53 | 54 | uint8_t countBits64(uint64_t bits) 55 | { 56 | uint8_t* p = (uint8_t*)&bits; 57 | uint8_t n = 0U; 58 | n += BITS_TABLE[p[0U]]; 59 | n += BITS_TABLE[p[1U]]; 60 | n += BITS_TABLE[p[2U]]; 61 | n += BITS_TABLE[p[3U]]; 62 | n += BITS_TABLE[p[4U]]; 63 | n += BITS_TABLE[p[5U]]; 64 | n += BITS_TABLE[p[6U]]; 65 | n += BITS_TABLE[p[7U]]; 66 | return n; 67 | } 68 | 69 | #if defined(ENABLE_DEBUG) 70 | // Simple functions to convert from int to string 71 | // Example from: https://stackoverflow.com/questions/8257714/how-to-convert-an-int-to-string-in-c 72 | static uint8_t *i2str_helper(uint8_t *dest, uint32_t n, int32_t x) { 73 | if (n == 0) { 74 | return NULL; 75 | } 76 | if (x <= -10) { 77 | dest = i2str_helper(dest, n - 1, x / 10); 78 | if (dest == NULL) return NULL; 79 | } 80 | *dest = (uint8_t) ('0' - x % 10); 81 | return dest + 1; 82 | } 83 | 84 | uint8_t *i2str(uint8_t *dest, uint32_t n, int32_t x) { 85 | uint8_t *p = dest; 86 | if (n == 0) { 87 | return NULL; 88 | } 89 | n--; 90 | x = -x; 91 | p = i2str_helper(p, n, x); 92 | if (p == NULL) return NULL; 93 | *p = 0; 94 | return dest; 95 | } 96 | #endif 97 | -------------------------------------------------------------------------------- /Utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(UTILS_H) 21 | #define UTILS_H 22 | 23 | #include "Config.h" 24 | 25 | #if defined(STM32F10X_MD) 26 | #include "stm32f10x.h" 27 | #elif defined(STM32F4XX) 28 | #include "stm32f4xx.h" 29 | #elif defined(STM32F7XX) 30 | #include "stm32f7xx.h" 31 | #else 32 | #include 33 | #endif 34 | 35 | uint8_t countBits8(uint8_t bits); 36 | 37 | uint8_t countBits16(uint16_t bits); 38 | 39 | uint8_t countBits32(uint32_t bits); 40 | 41 | uint8_t countBits64(uint64_t bits); 42 | 43 | #if defined(ENABLE_DEBUG) 44 | uint8_t *i2str(uint8_t *dest, uint32_t n, int32_t x); 45 | #endif 46 | 47 | #endif 48 | 49 | -------------------------------------------------------------------------------- /YSFDefines.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2015 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2018 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(YSFDEFINES_H) 21 | #define YSFDEFINES_H 22 | 23 | const unsigned int YSF_FRAME_LENGTH_BYTES = 120U; 24 | const unsigned int YSF_FRAME_LENGTH_BITS = YSF_FRAME_LENGTH_BYTES * 8U; 25 | 26 | const unsigned int YSF_SYNC_LENGTH_BYTES = 5U; 27 | const unsigned int YSF_SYNC_LENGTH_BITS = YSF_SYNC_LENGTH_BYTES * 8U; 28 | 29 | const unsigned int YSF_FICH_LENGTH_BITS = 200U; 30 | 31 | const uint8_t YSF_SYNC_BYTES[] = {0xD4U, 0x71U, 0xC9U, 0x63U, 0x4DU}; 32 | const uint8_t YSF_SYNC_BYTES_LENGTH = 5U; 33 | 34 | const uint64_t YSF_SYNC_BITS = 0x000000D471C9634DU; 35 | const uint64_t YSF_SYNC_BITS_MASK = 0x000000FFFFFFFFFFU; 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /YSFRX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(YSFRX_H) 21 | #define YSFRX_H 22 | 23 | #include "YSFDefines.h" 24 | 25 | enum YSFRX_STATE { 26 | YSFRXS_NONE, 27 | YSFRXS_DATA 28 | }; 29 | 30 | class CYSFRX { 31 | public: 32 | CYSFRX(); 33 | 34 | void databit(bool bit); 35 | 36 | void reset(); 37 | 38 | private: 39 | YSFRX_STATE m_state; 40 | uint64_t m_bitBuffer; 41 | uint8_t m_outBuffer[YSF_FRAME_LENGTH_BYTES + 3U]; 42 | uint8_t* m_buffer; 43 | uint16_t m_bufferPtr; 44 | uint16_t m_lostCount; 45 | 46 | void processNone(bool bit); 47 | void processData(bool bit); 48 | void writeRSSIData(uint8_t* data); 49 | 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /YSFTX.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2016 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #include "Config.h" 21 | #include "Globals.h" 22 | #include "YSFTX.h" 23 | 24 | #include "YSFDefines.h" 25 | 26 | const uint8_t YSF_START_SYNC = 0x77U; 27 | const uint8_t YSF_END_SYNC = 0xFFU; 28 | 29 | CYSFTX::CYSFTX() : 30 | m_buffer(1500U), 31 | m_poBuffer(), 32 | m_poLen(0U), 33 | m_poPtr(0U), 34 | m_txDelay(240U), // 200ms 35 | m_delay(false) 36 | { 37 | } 38 | 39 | void CYSFTX::process() 40 | { 41 | if (m_buffer.getData() == 0U && m_poLen == 0U) 42 | return; 43 | 44 | if (m_poLen == 0U) { 45 | if (!m_tx) { 46 | m_delay = true; 47 | m_poLen = m_txDelay; 48 | } else { 49 | m_delay = false; 50 | for (uint8_t i = 0U; i < YSF_FRAME_LENGTH_BYTES; i++) 51 | m_poBuffer[m_poLen++] = m_buffer.get(); 52 | } 53 | 54 | m_poPtr = 0U; 55 | } 56 | 57 | if (m_poLen > 0U) { 58 | uint16_t space = io.getSpace(); 59 | 60 | while (space > 8U) { 61 | if (m_delay) { 62 | m_poPtr++; 63 | writeByte(YSF_START_SYNC); 64 | } 65 | else 66 | writeByte(m_poBuffer[m_poPtr++]); 67 | 68 | space -= 8U; 69 | 70 | if (m_poPtr >= m_poLen) { 71 | m_poPtr = 0U; 72 | m_poLen = 0U; 73 | m_delay = false; 74 | return; 75 | } 76 | } 77 | } 78 | } 79 | 80 | uint8_t CYSFTX::writeData(const uint8_t* data, uint8_t length) 81 | { 82 | if (length != (YSF_FRAME_LENGTH_BYTES + 1U)) 83 | return 4U; 84 | 85 | uint16_t space = m_buffer.getSpace(); 86 | if (space < YSF_FRAME_LENGTH_BYTES) 87 | return 5U; 88 | 89 | for (uint8_t i = 0U; i < YSF_FRAME_LENGTH_BYTES; i++) 90 | m_buffer.put(data[i + 1U]); 91 | 92 | return 0U; 93 | } 94 | 95 | void CYSFTX::writeByte(uint8_t c) 96 | { 97 | uint8_t bit; 98 | uint8_t mask = 0x80U; 99 | 100 | for (uint8_t i = 0U; i < 8U; i++, c <<= 1) { 101 | if ((c & mask) == mask) 102 | bit = 1U; 103 | else 104 | bit = 0U; 105 | 106 | io.write(&bit, 1); 107 | } 108 | } 109 | 110 | void CYSFTX::setTXDelay(uint8_t delay) 111 | { 112 | m_txDelay = 600U + uint16_t(delay) * 12U; // 500ms + tx delay 113 | } 114 | 115 | uint16_t CYSFTX::getSpace() const 116 | { 117 | return m_buffer.getSpace() / YSF_FRAME_LENGTH_BYTES; 118 | } 119 | 120 | -------------------------------------------------------------------------------- /YSFTX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX 3 | * Copyright (C) 2016,2017 by Andy Uribe CA6JAU 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(YSFTX_H) 21 | #define YSFTX_H 22 | 23 | #include "SerialRB.h" 24 | 25 | class CYSFTX { 26 | public: 27 | CYSFTX(); 28 | 29 | uint8_t writeData(const uint8_t* data, uint8_t length); 30 | 31 | void process(); 32 | 33 | void setTXDelay(uint8_t delay); 34 | 35 | uint16_t getSpace() const; 36 | 37 | private: 38 | CSerialRB m_buffer; 39 | uint8_t m_poBuffer[130U]; 40 | uint16_t m_poLen; 41 | uint16_t m_poPtr; 42 | uint16_t m_txDelay; 43 | bool m_delay; 44 | 45 | void writeByte(uint8_t c); 46 | }; 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /bootloader.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016-2018 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | /* Memory areas */ 20 | MEMORY 21 | { 22 | ROM (rx) : ORIGIN = 0x08002000, LENGTH = 120K /* FLASH */ 23 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K /* Main RAM */ 24 | } 25 | 26 | INCLUDE stm32f10x_link.ld 27 | -------------------------------------------------------------------------------- /configs/D2RG_MMDVM_HS.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | // #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/MMDVM_HS_Hat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/NanoDV_NPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.1 (BG4TGO & BG5HHP) 34 | #define NANO_DV_REV11 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | // #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/NanoDV_USB.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.1 (BG4TGO & BG5HHP) 34 | #define NANO_DV_REV11 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | // #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | // #define STM32_USART1_HOST 64 | #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | // #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/Nano_hotSPOT.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/SkyBridge_RPi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and DMR LEDs for POCSAG 99 | // #define USE_ALTERNATE_POCSAG_LEDS 100 | 101 | // Enable for RPi 3B+, USB mode 102 | // #define LONG_USB_RESET 103 | 104 | // Enable modem debug messages 105 | #define ENABLE_DEBUG 106 | 107 | // Disable frequency bands check 108 | // #define DISABLE_FREQ_CHECK 109 | 110 | // Disable frequency restrictions (satellite, ISS, etc) 111 | // #define DISABLE_FREQ_BAN 112 | 113 | // Enable UDID feature 114 | #define ENABLE_UDID 115 | 116 | #endif 117 | -------------------------------------------------------------------------------- /configs/ZUMspot_Libre.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | // #define STM32_USART1_HOST 64 | #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | // #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | // #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/ZUMspot_RPi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/ZUMspot_USB.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | // #define STM32_USART1_HOST 64 | #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | // #define SERIAL_REPEATER 78 | 79 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 80 | // #define SERIAL_REPEATER_USART1 81 | 82 | // Enable P25 Wide modulation: 83 | // #define ENABLE_P25_WIDE 84 | 85 | // Disable mode LEDs blink during scan mode: 86 | // #define QUIET_MODE_LEDS 87 | 88 | // Engage a constant or descreet Service LED mode once repeater is running 89 | // #define CONSTANT_SRV_LED 90 | // #define CONSTANT_SRV_LED_INVERTED 91 | // #define DISCREET_SRV_LED 92 | // #define DISCREET_SRV_LED_INVERTED 93 | 94 | // Use the YSF and P25 LEDs for NXDN 95 | // #define USE_ALTERNATE_NXDN_LEDS 96 | 97 | // Use the D-Star and P25 LEDs for M17 98 | // #define USE_ALTERNATE_M17_LEDS 99 | 100 | // Use the D-Star and DMR LEDs for POCSAG 101 | // #define USE_ALTERNATE_POCSAG_LEDS 102 | 103 | // Enable for RPi 3B+, USB mode 104 | #define LONG_USB_RESET 105 | 106 | // Enable modem debug messages 107 | #define ENABLE_DEBUG 108 | 109 | // Disable frequency bands check 110 | // #define DISABLE_FREQ_CHECK 111 | 112 | // Disable frequency restrictions (satellite, ISS, etc) 113 | // #define DISABLE_FREQ_BAN 114 | 115 | // Enable UDID feature 116 | // #define ENABLE_UDID 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /configs/ZUMspot_dualband.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/ZUMspot_duplex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | // #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | // #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/generic_duplex_gpio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | // #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | // #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/generic_duplex_usb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | // #define STM32_USART1_HOST 64 | #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | // #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | // #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | // #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /configs/generic_gpio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #if !defined(CONFIG_H) 20 | #define CONFIG_H 21 | 22 | // Select one board (STM32F103 based boards) 23 | // 1) ZUMspot RPi or ZUMspot USB: 24 | // #define ZUMSPOT_ADF7021 25 | // 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103: 26 | #define LIBRE_KIT_ADF7021 27 | // 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET) 28 | // #define MMDVM_HS_HAT_REV12 29 | // 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN) 30 | // #define MMDVM_HS_DUAL_HAT_REV10 31 | // 5) Nano hotSPOT (BI7JTA) 32 | // #define NANO_HOTSPOT 33 | // 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP) 34 | // #define NANO_DV_REV10 35 | // 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU) 36 | // #define D2RG_MMDVM_HS 37 | // 8) BridgeCom SkyBridge HotSpot 38 | // #define SKYBRIDGE_HS 39 | 40 | // Enable ADF7021 support: 41 | #define ENABLE_ADF7021 42 | 43 | // Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only): 44 | // #define DUPLEX 45 | 46 | // TCXO of the ADF7021 47 | // For 14.7456 MHz: 48 | #define ADF7021_14_7456 49 | // For 12.2880 MHz: 50 | // #define ADF7021_12_2880 51 | 52 | // Configure receiver gain for ADF7021 53 | // AGC automatic, default settings: 54 | #define AD7021_GAIN_AUTO 55 | // AGC automatic with high LNA linearity: 56 | // #define AD7021_GAIN_AUTO_LIN 57 | // AGC OFF, lowest gain: 58 | // #define AD7021_GAIN_LOW 59 | // AGC OFF, highest gain: 60 | // #define AD7021_GAIN_HIGH 61 | 62 | // Host communication selection: 63 | #define STM32_USART1_HOST 64 | // #define STM32_USB_HOST 65 | // #define STM32_I2C_HOST 66 | 67 | // I2C host address: 68 | #define I2C_ADDR 0x22 69 | 70 | // Enable mode detection: 71 | #define ENABLE_SCAN_MODE 72 | 73 | // Send RSSI value: 74 | // #define SEND_RSSI_DATA 75 | 76 | // Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi): 77 | #define SERIAL_REPEATER 78 | #define SERIAL_REPEATER_BAUD 9600 79 | 80 | // Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled): 81 | // #define SERIAL_REPEATER_USART1 82 | 83 | // Enable P25 Wide modulation: 84 | // #define ENABLE_P25_WIDE 85 | 86 | // Disable mode LEDs blink during scan mode: 87 | // #define QUIET_MODE_LEDS 88 | 89 | // Engage a constant or descreet Service LED mode once repeater is running 90 | // #define CONSTANT_SRV_LED 91 | // #define CONSTANT_SRV_LED_INVERTED 92 | // #define DISCREET_SRV_LED 93 | // #define DISCREET_SRV_LED_INVERTED 94 | 95 | // Use the YSF and P25 LEDs for NXDN 96 | // #define USE_ALTERNATE_NXDN_LEDS 97 | 98 | // Use the D-Star and P25 LEDs for M17 99 | // #define USE_ALTERNATE_M17_LEDS 100 | 101 | // Use the D-Star and DMR LEDs for POCSAG 102 | // #define USE_ALTERNATE_POCSAG_LEDS 103 | 104 | // Enable for RPi 3B+, USB mode 105 | // #define LONG_USB_RESET 106 | 107 | // Enable modem debug messages 108 | #define ENABLE_DEBUG 109 | 110 | // Disable frequency bands check 111 | // #define DISABLE_FREQ_CHECK 112 | 113 | // Disable frequency restrictions (satellite, ISS, etc) 114 | // #define DISABLE_FREQ_BAN 115 | 116 | // Enable UDID feature 117 | #define ENABLE_UDID 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /normal.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016-2018 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | /* Memory areas */ 20 | MEMORY 21 | { 22 | ROM (rx) : ORIGIN = 0x08000000, LENGTH = 128K /* FLASH */ 23 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K /* Main RAM */ 24 | } 25 | 26 | INCLUDE stm32f10x_link.ld -------------------------------------------------------------------------------- /scripts/install_buildtools.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | cd ~ 20 | 21 | # Install the necessary software tools 22 | sudo apt-get update 23 | sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi 24 | 25 | # Install stm32flash 26 | cd ~ 27 | git clone https://git.code.sf.net/p/stm32flash/code stm32flash 28 | cd stm32flash 29 | make 30 | sudo make install 31 | 32 | # Download the firmware sources 33 | cd ~ 34 | git clone https://github.com/juribeparada/MMDVM_HS 35 | cd MMDVM_HS/ 36 | git clone https://github.com/juribeparada/STM32F10X_Lib 37 | 38 | -------------------------------------------------------------------------------- /scripts/install_fw_custom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Change USB-serial port name ONLY in macOS 20 | MAC_DEV_USB_SER="/dev/cu.usbmodem1441" 21 | 22 | # Check if arguement is supplied for bin path. If not, use default. 23 | if [ -z "$1" ]; then 24 | BIN_PATH="../bin/mmdvm_f1bl.bin" 25 | echo "No path to bin file supplied, trying the default location." 26 | else 27 | BIN_PATH="$1" 28 | fi 29 | 30 | # Check if bin file exists 31 | if [ -e $BIN_PATH ]; then 32 | echo "Attempting to flash $BIN_PATH" 33 | else 34 | echo "$BIN_PATH doesn't exist!" 35 | exit 1 36 | fi 37 | 38 | # Download STM32F10X_Lib (only for binary tools) 39 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 40 | git clone https://github.com/juribeparada/STM32F10X_Lib 41 | fi 42 | 43 | # Configure vars depending on OS 44 | if [ $(uname -s) == "Linux" ]; then 45 | DEV_USB_SER="/dev/ttyACM0" 46 | if [ $(uname -m) == "x86_64" ]; then 47 | echo "Linux 64-bit detected" 48 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 49 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 50 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 51 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 52 | elif [ $(uname -m) == "aarch64" ] ; then 53 | echo "Raspberry Pi 4 detected" 54 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 55 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 56 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 57 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 58 | elif [ $(uname -m) == "armv7l" ]; then 59 | echo "Raspberry Pi 3 detected" 60 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 61 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 62 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 63 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 64 | elif [ $(uname -m) == "armv6l" ]; then 65 | echo "Raspberry Pi 2 or Pi Zero W detected" 66 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 67 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 68 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 69 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 70 | else 71 | echo "Linux 32-bit detected" 72 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 73 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 74 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 75 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 76 | fi 77 | fi 78 | 79 | if [ $(uname -s) == "Darwin" ]; then 80 | echo "macOS detected" 81 | DEV_USB_SER=$MAC_DEV_USB_SER 82 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 83 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 84 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 85 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 86 | fi 87 | 88 | # Stop MMDVMHost process to free serial port 89 | sudo killall MMDVMHost >/dev/null 2>&1 90 | 91 | # Reset ZUMspot to enter bootloader mode 92 | eval sudo $DFU_RST $DEV_USB_SER 750 93 | 94 | # Upload the firmware 95 | eval sudo $DFU_UTIL -D $BIN_PATH -d 1eaf:0003 -a 2 -R -R 96 | 97 | echo 98 | echo "Please RESET your ZUMspot !" 99 | echo 100 | -------------------------------------------------------------------------------- /scripts/install_fw_d2rg_mmdvmhs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="d2rg_mmdvm_hs.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | # Note: /dev/ttySC0 should be enabled, see: https://github.com/bg3mdo/D2RG_MMDVM_HS_ambe_uart_service 90 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 23,-22,22:-23,22 /dev/ttySC0 91 | 92 | -------------------------------------------------------------------------------- /scripts/install_fw_dualband.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="zumspot_dualband_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_duplex.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="zumspot_duplex_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_duplex_gpio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="generic_duplex_gpio_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download latest firmware for Generic Duplex GPIO 38 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/ 39 | 40 | # Download STM32F10X_Lib (only for binary tools) 41 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 42 | git clone https://github.com/juribeparada/STM32F10X_Lib 43 | fi 44 | 45 | # Configure vars depending on OS 46 | if [ $(uname -s) == "Linux" ]; then 47 | if [ $(uname -m) == "x86_64" ]; then 48 | echo "Linux 64-bit detected" 49 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 50 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 51 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 52 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 53 | elif [ $(uname -m) == "aarch64" ] ; then 54 | echo "Raspberry Pi 4 detected" 55 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 56 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 57 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 58 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 59 | elif [ $(uname -m) == "armv7l" ]; then 60 | echo "Raspberry Pi 3 detected" 61 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 62 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 63 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 64 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 65 | elif [ $(uname -m) == "armv6l" ]; then 66 | echo "Raspberry Pi 2 or Pi Zero W detected" 67 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 68 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 69 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 70 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 71 | else 72 | echo "Linux 32-bit detected" 73 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 74 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 75 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 76 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 77 | fi 78 | fi 79 | 80 | if [ $(uname -s) == "Darwin" ]; then 81 | echo "macOS detected" 82 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 83 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 84 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 85 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 86 | fi 87 | 88 | # Stop MMDVMHost process to free serial port 89 | sudo killall MMDVMHost >/dev/null 2>&1 90 | 91 | # Upload the firmware 92 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 93 | 94 | -------------------------------------------------------------------------------- /scripts/install_fw_duplex_gpio_opi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="generic_duplex_gpio_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download latest firmware for Generic Duplex GPIO 38 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/ 39 | 40 | # Download STM32F10X_Lib (only for binary tools) 41 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 42 | git clone https://github.com/juribeparada/STM32F10X_Lib 43 | fi 44 | 45 | # Configure vars depending on OS 46 | if [ $(uname -s) == "Linux" ]; then 47 | if [ $(uname -m) == "x86_64" ]; then 48 | echo "Linux 64-bit detected" 49 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 50 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 51 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 52 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 53 | elif [ $(uname -m) == "aarch64" ] ; then 54 | echo "Raspberry Pi 4 detected" 55 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 56 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 57 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 58 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 59 | elif [ $(uname -m) == "armv7l" ]; then 60 | echo "Raspberry Pi 3 detected" 61 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 62 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 63 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 64 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 65 | elif [ $(uname -m) == "armv6l" ]; then 66 | echo "Raspberry Pi 2 or Pi Zero W detected" 67 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 68 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 69 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 70 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 71 | else 72 | echo "Linux 32-bit detected" 73 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 74 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 75 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 76 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 77 | fi 78 | fi 79 | 80 | if [ $(uname -s) == "Darwin" ]; then 81 | echo "macOS detected" 82 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 83 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 84 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 85 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 86 | fi 87 | 88 | # Stop MMDVMHost process to free serial port 89 | sudo killall MMDVMHost >/dev/null 2>&1 90 | 91 | # Upload the firmware 92 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3 93 | -------------------------------------------------------------------------------- /scripts/install_fw_gen_gpio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="generic_gpio_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_hsdualhat-12mhz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="mmdvm_hs_dual_hat_fw-12mhz.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_hsdualhat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="mmdvm_hs_dual_hat_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_hshat-12mhz.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="mmdvm_hs_hat_fw-12mhz.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_hshat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="mmdvm_hs_hat_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_nanodv_npi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="nanodv_npi_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 66,-67,67:-66,67 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_nanodv_usb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Change USB-serial port name ONLY in macOS 23 | MAC_DEV_USB_SER="/dev/cu.usbmodem14401" 24 | 25 | # Configure beta version 26 | FW_VERSION_BETA="v1.5.1b" 27 | 28 | # Firmware filename 29 | FW_FILENAME="nanodv_usb_fw.bin" 30 | 31 | # Download latest firmware 32 | if [ $1 = "beta" ]; then 33 | echo "Downloading beta firmware..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 35 | else 36 | echo "Downloading latest firmware (stable)..." 37 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 38 | fi 39 | 40 | # Download STM32F10X_Lib (only for binary tools) 41 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 42 | git clone https://github.com/juribeparada/STM32F10X_Lib 43 | fi 44 | 45 | # Configure vars depending on OS 46 | if [ $(uname -s) == "Linux" ]; then 47 | DEV_USB_SER="/dev/ttyACM0" 48 | if [ $(uname -m) == "x86_64" ]; then 49 | echo "Linux 64-bit detected" 50 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 51 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 52 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 53 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 54 | elif [ $(uname -m) == "aarch64" ] ; then 55 | echo "Raspberry Pi 4 detected" 56 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 57 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 58 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 59 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 60 | elif [ $(uname -m) == "armv7l" ]; then 61 | echo "Raspberry Pi 3 detected" 62 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 63 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 64 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 65 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 66 | elif [ $(uname -m) == "armv6l" ]; then 67 | echo "Raspberry Pi 2 or Pi Zero W detected" 68 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 69 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 70 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 71 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 72 | else 73 | echo "Linux 32-bit detected" 74 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 75 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 76 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 77 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 78 | fi 79 | fi 80 | 81 | if [ $(uname -s) == "Darwin" ]; then 82 | echo "macOS detected" 83 | DEV_USB_SER=$MAC_DEV_USB_SER 84 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 85 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 86 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 87 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 88 | fi 89 | 90 | # Stop MMDVMHost process to free serial port 91 | sudo killall MMDVMHost >/dev/null 2>&1 92 | 93 | # Reset ZUMspot to enter bootloader mode 94 | eval sudo $DFU_RST $DEV_USB_SER 750 95 | 96 | # Upload the firmware 97 | eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R 98 | 99 | echo 100 | echo "Please RESET your Nano DV !" 101 | echo 102 | -------------------------------------------------------------------------------- /scripts/install_fw_rpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="zumspot_rpi_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_skybridge_rpi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Configure beta version 23 | FW_VERSION_BETA="v1.5.1b" 24 | 25 | # Firmware filename 26 | FW_FILENAME="skybridge_rpi_fw.bin" 27 | 28 | # Download latest firmware 29 | if [ $1 = "beta" ]; then 30 | echo "Downloading beta firmware..." 31 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 32 | else 33 | echo "Downloading latest firmware (stable)..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 35 | fi 36 | 37 | # Download STM32F10X_Lib (only for binary tools) 38 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 39 | git clone https://github.com/juribeparada/STM32F10X_Lib 40 | fi 41 | 42 | # Configure vars depending on OS 43 | if [ $(uname -s) == "Linux" ]; then 44 | if [ $(uname -m) == "x86_64" ]; then 45 | echo "Linux 64-bit detected" 46 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 47 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 48 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 49 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 50 | elif [ $(uname -m) == "aarch64" ] ; then 51 | echo "Raspberry Pi 4 detected" 52 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 53 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 54 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 55 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 56 | elif [ $(uname -m) == "armv7l" ]; then 57 | echo "Raspberry Pi 3 detected" 58 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 59 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 60 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 61 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 62 | elif [ $(uname -m) == "armv6l" ]; then 63 | echo "Raspberry Pi 2 or Pi Zero W detected" 64 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 65 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 66 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 67 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 68 | else 69 | echo "Linux 32-bit detected" 70 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 71 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 72 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 73 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 74 | fi 75 | fi 76 | 77 | if [ $(uname -s) == "Darwin" ]; then 78 | echo "macOS detected" 79 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 80 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 81 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 82 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 83 | fi 84 | 85 | # Stop MMDVMHost process to free serial port 86 | sudo killall MMDVMHost >/dev/null 2>&1 87 | 88 | # Upload the firmware 89 | eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0 90 | 91 | -------------------------------------------------------------------------------- /scripts/install_fw_usb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2017,2018 by Andy Uribe CA6JAU 4 | 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | # Configure latest version 20 | FW_VERSION="v1.5.2" 21 | 22 | # Change USB-serial port name ONLY in macOS 23 | MAC_DEV_USB_SER="/dev/cu.usbmodem14401" 24 | 25 | # Configure beta version 26 | FW_VERSION_BETA="v1.5.1b" 27 | 28 | # Firmware filename 29 | FW_FILENAME="zumspot_usb_fw.bin" 30 | 31 | # Download latest firmware 32 | if [ $1 = "beta" ]; then 33 | echo "Downloading beta firmware..." 34 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME 35 | else 36 | echo "Downloading latest firmware (stable)..." 37 | curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME 38 | fi 39 | 40 | # Download STM32F10X_Lib (only for binary tools) 41 | if [ ! -d "./STM32F10X_Lib/utils" ]; then 42 | git clone https://github.com/juribeparada/STM32F10X_Lib 43 | fi 44 | 45 | # Configure vars depending on OS 46 | if [ $(uname -s) == "Linux" ]; then 47 | DEV_USB_SER="/dev/ttyACM0" 48 | if [ $(uname -m) == "x86_64" ]; then 49 | echo "Linux 64-bit detected" 50 | DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset" 51 | DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util" 52 | ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash" 53 | STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash" 54 | elif [ $(uname -m) == "aarch64" ] ; then 55 | echo "Raspberry Pi 4 detected" 56 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 57 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 58 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 59 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 60 | elif [ $(uname -m) == "armv7l" ]; then 61 | echo "Raspberry Pi 3 detected" 62 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 63 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 64 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 65 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 66 | elif [ $(uname -m) == "armv6l" ]; then 67 | echo "Raspberry Pi 2 or Pi Zero W detected" 68 | DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset" 69 | DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util" 70 | ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash" 71 | STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash" 72 | else 73 | echo "Linux 32-bit detected" 74 | DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset" 75 | DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util" 76 | ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash" 77 | STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash" 78 | fi 79 | fi 80 | 81 | if [ $(uname -s) == "Darwin" ]; then 82 | echo "macOS detected" 83 | DEV_USB_SER=$MAC_DEV_USB_SER 84 | DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset" 85 | DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util" 86 | ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash" 87 | STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash" 88 | fi 89 | 90 | # Stop MMDVMHost process to free serial port 91 | sudo killall MMDVMHost >/dev/null 2>&1 92 | 93 | # Reset ZUMspot to enter bootloader mode 94 | eval sudo $DFU_RST $DEV_USB_SER 750 95 | 96 | # Upload the firmware 97 | eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R 98 | 99 | echo 100 | echo "Please RESET your ZUMspot !" 101 | echo 102 | -------------------------------------------------------------------------------- /stm32f10x_link.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | /* Required amount of heap and stack */ 20 | _min_heap_size = 0x1000; 21 | _min_stack_size = 0x0800; 22 | 23 | /* The entry point in the interrupt vector table */ 24 | ENTRY(Reset_Handler) 25 | 26 | /* Stack start address (end of 20K RAM) */ 27 | _estack = ORIGIN(RAM) + LENGTH(RAM); 28 | 29 | SECTIONS 30 | { 31 | .text : 32 | { 33 | /* The interrupt vector table */ 34 | . = ALIGN(4); 35 | KEEP(*(.isr_vector .isr_vector.*)) 36 | 37 | /* The program code */ 38 | . = ALIGN(4); 39 | *(.text .text*) 40 | *(.rodata .rodata*) 41 | 42 | /* ARM-Thumb code */ 43 | *(.glue_7) *(.glue_7t) 44 | 45 | . = ALIGN(4); 46 | KEEP(*(.init)) 47 | KEEP(*(.fini)) 48 | 49 | /* EABI C++ global constructors support */ 50 | . = ALIGN(4); 51 | __preinit_array_start = .; 52 | KEEP (*(.preinit_array)) 53 | __preinit_array_end = .; 54 | 55 | /* EABI C++ global constructors support */ 56 | . = ALIGN(4); 57 | __init_array_start = .; 58 | KEEP (*(SORT(.init_array.*))) 59 | KEEP (*(.init_array)) 60 | __init_array_end = .; 61 | 62 | /* EABI C++ global constructors support */ 63 | . = ALIGN(4); 64 | __fini_array_start = .; 65 | KEEP (*(.fini_array)) 66 | KEEP (*(SORT(.fini_array.*))) 67 | __fini_array_end = .; 68 | 69 | } > ROM 70 | 71 | /* ARM sections containing exception unwinding information */ 72 | .ARM.extab : { 73 | __extab_start = .; 74 | *(.ARM.extab* .gnu.linkonce.armextab.*) 75 | __extab_end = .; 76 | } > ROM 77 | 78 | /* ARM index entries for section unwinding */ 79 | .ARM.exidx : { 80 | __exidx_start = .; 81 | *(.ARM.exidx*) 82 | __exidx_end = .; 83 | } > ROM 84 | 85 | /* Start address for the initialization values of the .data section */ 86 | _sidata = .; 87 | 88 | /* The .data section (initialized data) */ 89 | .data : AT ( _sidata ) 90 | { 91 | . = ALIGN(4); 92 | _sdata = . ; /* Start address for the .data section */ 93 | *(.data .data*) 94 | 95 | . = ALIGN(4); 96 | _edata = . ; /* End address for the .data section */ 97 | } > RAM 98 | 99 | /* The .bss section (uninitialized data) */ 100 | .bss : 101 | { 102 | . = ALIGN(4); 103 | _sbss = .; /* Start address for the .bss section */ 104 | __bss_start__ = _sbss; 105 | *(.bss) 106 | *(.bss*) 107 | *(COMMON) 108 | 109 | . = ALIGN(4); 110 | _ebss = . ; /* End address for the .bss section */ 111 | __bss_end__ = _ebss; 112 | } > RAM 113 | 114 | /* Space for heap and stack */ 115 | .heap_stack : 116 | { 117 | end = . ; /* 'end' symbol defines heap location */ 118 | _end = end ; 119 | . = . + _min_heap_size; /* Additional space for heap and stack */ 120 | . = . + _min_stack_size; 121 | } > RAM 122 | 123 | /* Remove information from the standard libraries */ 124 | /DISCARD/ : 125 | { 126 | libc.a ( * ) 127 | libm.a ( * ) 128 | libgcc.a ( * ) 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /stm32f7xx_link.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 by Andy Uribe CA6JAU 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | /* Required amount of heap and stack */ 20 | _min_heap_size = 0x1000; 21 | _min_stack_size = 0x0800; 22 | 23 | /* The entry point in the interrupt vector table */ 24 | ENTRY(Reset_Handler) 25 | 26 | /* Memory areas */ 27 | MEMORY 28 | { 29 | ROM (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* FLASH */ 30 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 512K /* Main RAM */ 31 | } 32 | 33 | /* Stack start address (end of 512K RAM) */ 34 | _estack = ORIGIN(RAM) + LENGTH(RAM); 35 | 36 | SECTIONS 37 | { 38 | .text : 39 | { 40 | /* The interrupt vector table */ 41 | . = ALIGN(4); 42 | KEEP(*(.isr_vector .isr_vector.*)) 43 | 44 | /* The program code */ 45 | . = ALIGN(4); 46 | *(.text .text*) 47 | *(.rodata .rodata*) 48 | 49 | /* ARM-Thumb code */ 50 | *(.glue_7) *(.glue_7t) 51 | 52 | . = ALIGN(4); 53 | KEEP(*(.init)) 54 | KEEP(*(.fini)) 55 | 56 | /* EABI C++ global constructors support */ 57 | . = ALIGN(4); 58 | __preinit_array_start = .; 59 | KEEP (*(.preinit_array)) 60 | __preinit_array_end = .; 61 | 62 | /* EABI C++ global constructors support */ 63 | . = ALIGN(4); 64 | __init_array_start = .; 65 | KEEP (*(SORT(.init_array.*))) 66 | KEEP (*(.init_array)) 67 | __init_array_end = .; 68 | 69 | /* EABI C++ global constructors support */ 70 | . = ALIGN(4); 71 | __fini_array_start = .; 72 | KEEP (*(.fini_array)) 73 | KEEP (*(SORT(.fini_array.*))) 74 | __fini_array_end = .; 75 | 76 | } > ROM 77 | 78 | /* ARM sections containing exception unwinding information */ 79 | .ARM.extab : { 80 | __extab_start = .; 81 | *(.ARM.extab* .gnu.linkonce.armextab.*) 82 | __extab_end = .; 83 | } > ROM 84 | 85 | /* ARM index entries for section unwinding */ 86 | .ARM.exidx : { 87 | __exidx_start = .; 88 | *(.ARM.exidx*) 89 | __exidx_end = .; 90 | } > ROM 91 | 92 | /* Start address for the initialization values of the .data section */ 93 | _sidata = .; 94 | 95 | /* The .data section (initialized data) */ 96 | .data : AT ( _sidata ) 97 | { 98 | . = ALIGN(4); 99 | _sdata = . ; /* Start address for the .data section */ 100 | *(.data .data*) 101 | 102 | . = ALIGN(4); 103 | _edata = . ; /* End address for the .data section */ 104 | } > RAM 105 | 106 | /* The .bss section (uninitialized data) */ 107 | .bss : 108 | { 109 | . = ALIGN(4); 110 | _sbss = .; /* Start address for the .bss section */ 111 | __bss_start__ = _sbss; 112 | *(.bss) 113 | *(.bss*) 114 | *(COMMON) 115 | 116 | . = ALIGN(4); 117 | _ebss = . ; /* End address for the .bss section */ 118 | __bss_end__ = _ebss; 119 | } > RAM 120 | 121 | /* Space for heap and stack */ 122 | .heap_stack : 123 | { 124 | end = . ; /* 'end' symbol defines heap location */ 125 | _end = end ; 126 | . = . + _min_heap_size; /* Additional space for heap and stack */ 127 | . = . + _min_stack_size; 128 | } > RAM 129 | 130 | /* Remove information from the standard libraries */ 131 | /DISCARD/ : 132 | { 133 | libc.a ( * ) 134 | libm.a ( * ) 135 | libgcc.a ( * ) 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU 3 | * Copyright (C) 2020,2021 by Jonathan Naylor G4KLX 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | */ 19 | 20 | #if !defined(VERSION_H) 21 | #define VERSION_H 22 | 23 | #include "Config.h" 24 | #include "ADF7021.h" 25 | 26 | #define VER_MAJOR "1" 27 | #define VER_MINOR "6" 28 | #define VER_REV "0" 29 | #define VERSION_DATE "20210919" 30 | 31 | #if defined(ZUMSPOT_ADF7021) 32 | #define BOARD_INFO "ZUMspot" 33 | #elif defined(MMDVM_HS_HAT_REV12) 34 | #define BOARD_INFO "MMDVM_HS_Hat" 35 | #elif defined(MMDVM_HS_DUAL_HAT_REV10) 36 | #define BOARD_INFO "MMDVM_HS_Dual_Hat" 37 | #elif defined(NANO_HOTSPOT) 38 | #define BOARD_INFO "Nano_hotSPOT" 39 | #elif defined(NANO_DV_REV11) 40 | #define BOARD_INFO "Nano_DV" 41 | #elif defined(D2RG_MMDVM_HS) 42 | #define BOARD_INFO "D2RG_MMDVM_HS" 43 | #elif defined(SKYBRIDGE_HS) 44 | #define BOARD_INFO "SkyBridge" 45 | #elif defined(LONESTAR_USB) 46 | #define BOARD_INFO "LS_USB_STICK" 47 | #else 48 | #define BOARD_INFO "MMDVM_HS" 49 | #endif 50 | 51 | #if defined(ADF7021_14_7456) 52 | #define TCXO_FREQ "14.7456" 53 | #endif 54 | #if defined(ADF7021_12_2880) 55 | #define TCXO_FREQ "12.2880" 56 | #endif 57 | 58 | #if defined(ENABLE_ADF7021) && defined(ADF7021_N_VER) 59 | #define RF_CHIP "ADF7021N" 60 | #elif defined(ENABLE_ADF7021) 61 | #define RF_CHIP "ADF7021" 62 | #endif 63 | 64 | #if defined(DUPLEX) 65 | #define RF_DUAL "dual " 66 | #else 67 | #define RF_DUAL "" 68 | #endif 69 | 70 | #define FW_VERSION "v" VER_MAJOR "." VER_MINOR "." VER_REV " " VERSION_DATE 71 | 72 | #define DESCRIPTION BOARD_INFO "-" FW_VERSION " " TCXO_FREQ "MHz " RF_DUAL RF_CHIP " FW by CA6JAU" 73 | 74 | #if defined(MADEBYMAKEFILE) 75 | #include "GitVersion.h" 76 | #endif 77 | 78 | #if defined(GITVERSION) 79 | #define concat(a, b) a " GitID #" b "" 80 | const char HARDWARE[] = concat(DESCRIPTION, GITVERSION); 81 | #else 82 | #define concat(a, b, c) a " (Build: " b " " c ")" 83 | const char HARDWARE[] = concat(DESCRIPTION, __TIME__, __DATE__); 84 | #endif 85 | 86 | #endif 87 | 88 | --------------------------------------------------------------------------------