diff --git a/platformio.ini b/platformio.ini index 8d426a2..f0c5741 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ [env:MMDVM] platform = ststm32 board = genericSTM32F446RE -framework = arduino, cmsis +framework = arduino build_unflags = -O0 monitor_speed = 460800 build_flags = @@ -22,10 +22,6 @@ build_flags = -D ARM_MATH_CM4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard - ; enable USB serial - -D PIO_FRAMEWORK_ARDUINO_USB_HIGHSPEED_FULLMODE - -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC - -D USBCON ; increase the buffer sizes - -D SERIAL_RX_BUFFER_SIZE=1024 - -D SERIAL_TX_BUFFER_SIZE=1024 + -D SERIAL_RX_BUFFER_SIZE=2048 + -D SERIAL_TX_BUFFER_SIZE=2048 diff --git a/src/Config.h b/src/Config.h index 828e231..a1b667d 100644 --- a/src/Config.h +++ b/src/Config.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015,2016,2017,2018,2020 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2017,2018,2020,2024 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -50,50 +50,15 @@ // Enable AX.25 support, this is only enabled if FM is also enabled. #define MODE_AX25 -// Allow for the use of high quality external clock oscillators -// The number is the frequency of the oscillator in Hertz. -// -// The frequency of the TCXO must be an integer multiple of 48000. -// Frequencies such as 12.0 Mhz (48000 * 250) and 14.4 Mhz (48000 * 300) are suitable. -// Frequencies such as 10.0 Mhz (48000 * 208.333) or 20 Mhz (48000 * 416.666) are not suitable. -// -// For 12 MHz -#define EXTERNAL_OSC 12000000 -// For 12.288 MHz -// #define EXTERNAL_OSC 12288000 -// For 14.4 MHz -// #define EXTERNAL_OSC 14400000 -// For 19.2 MHz -// #define EXTERNAL_OSC 19200000 - // Select a baud rate for host communication. The faster speeds are needed for external FM to work. -// #define SERIAL_SPEED 115200 // Suitable for most older boards (Arduino Due, etc). External FM will NOT work with this! -// #define SERIAL_SPEED 230400 // Only works on newer boards like fast M4, M7, Teensy 3.x. External FM might work with this -#define SERIAL_SPEED 460800 // Only works on newer boards like fast M4, M7, Teensy 3.x. External FM should work with this +// #define SERIAL_SPEED 115200 // Suitable for most older boards. External FM will NOT work with this! +// #define SERIAL_SPEED 230400 // Only works on newer boards like fast M4, M7. External FM might work with this +#define SERIAL_SPEED 460800 // Only works on newer boards like fast M4, M7. External FM will work with this //#define SERIAL_SPEED 500000 // Used with newer boards and Armbian on AllWinner SOCs (H2, H3) that do not support 460800 // Use pins to output the current mode via LEDs #define MODE_LEDS -// For the original Arduino Due pin layout -// #define ARDUINO_DUE_PAPA - -// For the ZUM V1.0 and V1.0.1 boards pin layout -// #define ARDUINO_DUE_ZUM_V10 - -// For the SP8NTH board -// #define ARDUINO_DUE_NTH - -// For ST Nucleo-64 STM32F446RE board -// #define STM32F4_NUCLEO_MORPHO_HEADER -// #define STM32F4_NUCLEO_ARDUINO_HEADER - -// Use separate mode pins to switch external channel/filters/bandwidth for example -// #define MODE_PINS - -// For the VK6MST Pi3 Shield communicating over i2c. i2c address & speed defined in i2cTeensy.cpp -// #define VK6MST_TEENSY_PI3_SHIELD_I2C - // Pass RSSI information to the host #define SEND_RSSI_DATA @@ -109,6 +74,16 @@ // To reduce CPU load, you can remove the DC blocker by commenting out the next line #define USE_DCBLOCKER +// Choose the type of modem board in use, only one. +// The KI6ZUM v0.9 Pi hat, STM32F446 CPU +#define ZUM_V09_PI +// The KI6ZUM v1.0 Pi hat, STM32F722 CPU +// #define ZUM_V10_PI +// The Repeater Builder V3 board, STM32F446 CPU +// #define RB_V3_PI +// The Repeater Builder V5 board, STM32F722 CPU +// #define RB_V5_PI + // Constant Service LED once repeater is running // Do not use if employing an external hardware watchdog // #define CONSTANT_SRV_LED diff --git a/src/IO.cpp b/src/IO.cpp index 5e29d81..b282691 100644 --- a/src/IO.cpp +++ b/src/IO.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015,2016,2017,2018,2020,2021 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2017,2018,2020,2021,2024 by Jonathan Naylor G4KLX * Copyright (C) 2015 by Jim Mclaughlin KI6ZUM * Copyright (C) 2016 by Colin Durbridge G4EML * @@ -20,6 +20,7 @@ #include "Config.h" #include "Globals.h" +#include "IOPins.h" #include "IO.h" #if defined(USE_DCBLOCKER) @@ -204,7 +205,7 @@ m_lockout(false) m_rrc05Filter.pCoeffs = RRC_0_5_FILTER; #endif - initInt(); + initHardware(); selfTest(); } @@ -217,106 +218,106 @@ void CIO::selfTest() ledValue = !ledValue; // We exclude PTT to avoid trigger the transmitter - setLEDInt(ledValue); - setCOSInt(ledValue); + setLED(ledValue); + setCOS(ledValue); #if defined(MODE_LEDS) - setDStarInt(ledValue); - setDMRInt(ledValue); - setYSFInt(ledValue); - setP25Int(ledValue); + setDStar(ledValue); + setDMR(ledValue); + setYSF(ledValue); + setP25(ledValue); #if !defined(USE_ALTERNATE_NXDN_LEDS) - setNXDNInt(ledValue); + setNXDN(ledValue); #endif #if !defined(USE_ALTERNATE_M17_LEDS) - setM17Int(ledValue); + setM17(ledValue); #endif #if !defined(USE_ALTERNATE_POCSAG_LEDS) - setPOCSAGInt(ledValue); + setPOCSAG(ledValue); #endif #if !defined(USE_ALTERNATE_FM_LEDS) - setFMInt(ledValue); + setFM(ledValue); #endif #endif ::delay(250); } #if defined(MODE_LEDS) - setDStarInt(false); - setDMRInt(false); - setYSFInt(false); - setP25Int(false); + setDStar(false); + setDMR(false); + setYSF(false); + setP25(false); #if !defined(USE_ALTERNATE_NXDN_LEDS) - setNXDNInt(false); + setNXDN(false); #endif #if !defined(USE_ALTERNATE_M17_LEDS) - setM17Int(false); + setM17(false); #endif #if !defined(USE_ALTERNATE_POCSAG_LEDS) - setPOCSAGInt(false); + setPOCSAG(false); #endif #if !defined(USE_ALTERNATE_FM_LEDS) - setFMInt(false); + setFM(false); #endif - setDStarInt(true); + setDStar(true); ::delay(250); - setDMRInt(true); + setDMR(true); ::delay(250); - setYSFInt(true); + setYSF(true); ::delay(250); - setP25Int(true); + setP25(true); #if !defined(USE_ALTERNATE_NXDN_LEDS) ::delay(250); - setNXDNInt(true); + setNXDN(true); #endif #if !defined(USE_ALTERNATE_M17_LEDS) ::delay(250); - setM17Int(true); + setM17(true); #endif #if !defined(USE_ALTERNATE_POCSAG_LEDS) ::delay(250); - setPOCSAGInt(true); + setPOCSAG(true); #endif #if !defined(USE_ALTERNATE_FM_LEDS) ::delay(250); - setFMInt(true); + setFM(true); ::delay(250); - setFMInt(false); + setFM(false); #endif #if !defined(USE_ALTERNATE_POCSAG_LEDS) ::delay(250); - setPOCSAGInt(false); + setPOCSAG(false); #endif #if !defined(USE_ALTERNATE_M17_LEDS) ::delay(250); - setM17Int(false); + setM17(false); #endif #if !defined(USE_ALTERNATE_NXDN_LEDS) ::delay(250); - setNXDNInt(false); + setNXDN(false); #endif ::delay(250); - setP25Int(false); + setP25(false); ::delay(250); - setYSFInt(false); + setYSF(false); ::delay(250); - setDMRInt(false); + setDMR(false); ::delay(250); - setDStarInt(false); + setDStar(false); #endif } @@ -325,7 +326,7 @@ void CIO::start() if (m_started) return; - startInt(); + startHardware(); m_started = true; @@ -350,30 +351,30 @@ void CIO::process() } #if defined(CONSTANT_SRV_LED) - setLEDInt(true); + setLED(true); #else if (m_ledCount >= 24000U) { m_ledCount = 0U; m_ledValue = !m_ledValue; - setLEDInt(m_ledValue); + setLED(m_ledValue); } #endif } else { if (m_ledCount >= 240000U) { m_ledCount = 0U; m_ledValue = !m_ledValue; - setLEDInt(m_ledValue); + setLED(m_ledValue); } return; } if (m_useCOSAsLockout) - m_lockout = getCOSInt(); + m_lockout = getCOS(); // Switch off the transmitter if needed if (m_txBuffer.getData() == 0U && m_tx) { m_tx = false; - setPTTInt(m_pttInvert ? true : false); + setPTT(m_pttInvert ? true : false); DEBUG1("TX OFF"); } @@ -504,7 +505,7 @@ void CIO::process() #if defined(MODE_FM) if (m_fmEnable) { - bool cos = getCOSInt(); + bool cos = getCOS(); #if defined(USE_DCBLOCKER) fm.samples(cos, dcSamples, RX_BLOCK_SIZE); #else @@ -625,7 +626,7 @@ void CIO::process() #if defined(MODE_FM) else if (m_modemState == STATE_FM) { - bool cos = getCOSInt(); + bool cos = getCOS(); #if defined(USE_DCBLOCKER) fm.samples(cos, dcSamples, RX_BLOCK_SIZE); @@ -670,7 +671,7 @@ void CIO::write(MMDVM_STATE mode, q15_t* samples, uint16_t length, const uint8_t // Switch the transmitter on if needed if (!m_tx) { m_tx = true; - setPTTInt(m_pttInvert ? false : true); + setPTT(m_pttInvert ? false : true); DEBUG1("TX ON"); } @@ -732,7 +733,7 @@ uint16_t CIO::getSpace() const void CIO::setDecode(bool dcd) { if (dcd != m_dcd) - setCOSInt(dcd ? true : false); + setCOS(dcd ? true : false); m_dcd = dcd; } @@ -749,26 +750,26 @@ void CIO::setMode(MMDVM_STATE state) #if defined(MODE_LEDS) switch (m_modemState) { - case STATE_DSTAR: setDStarInt(false); break; - case STATE_DMR: setDMRInt(false); break; - case STATE_YSF: setYSFInt(false); break; - case STATE_P25: setP25Int(false); break; - case STATE_NXDN: setNXDNInt(false); break; - case STATE_M17: setM17Int(false); break; - case STATE_POCSAG: setPOCSAGInt(false); break; - case STATE_FM: setFMInt(false); break; + case STATE_DSTAR: setDStar(false); break; + case STATE_DMR: setDMR(false); break; + case STATE_YSF: setYSF(false); break; + case STATE_P25: setP25(false); break; + case STATE_NXDN: setNXDN(false); break; + case STATE_M17: setM17(false); break; + case STATE_POCSAG: setPOCSAG(false); break; + case STATE_FM: setFM(false); break; default: break; } switch (state) { - case STATE_DSTAR: setDStarInt(true); break; - case STATE_DMR: setDMRInt(true); break; - case STATE_YSF: setYSFInt(true); break; - case STATE_P25: setP25Int(true); break; - case STATE_NXDN: setNXDNInt(true); break; - case STATE_M17: setM17Int(true); break; - case STATE_POCSAG: setPOCSAGInt(true); break; - case STATE_FM: setFMInt(true); break; + case STATE_DSTAR: setDStar(true); break; + case STATE_DMR: setDMR(true); break; + case STATE_YSF: setYSF(true); break; + case STATE_P25: setP25(true); break; + case STATE_NXDN: setNXDN(true); break; + case STATE_M17: setM17(true); break; + case STATE_POCSAG: setPOCSAG(true); break; + case STATE_FM: setFM(true); break; default: break; } #endif @@ -844,3 +845,156 @@ bool CIO::hasLockout() const { return m_lockout; } + +void CIO::initHardware() +{ +#if defined(PIN_COS) + ::pinMode(PIN_COS, INPUT); +#endif + +#if defined(PIN_LED) + ::pinMode(PIN_LED, OUTPUT); +#endif +#if defined(PIN_PTT) + ::pinMode(PIN_PTT, OUTPUT); +#endif +#if defined(PIN_COSLED) + ::pinMode(PIN_COSLED, OUTPUT); +#endif + +#if defined(MODE_LEDS) +#if defined(PIN_DSTAR) + ::pinMode(PIN_DSTAR, OUTPUT); +#endif +#if defined(PIN_DMR) + ::pinMode(PIN_DMR, OUTPUT); +#endif +#if defined(PIN_YSF) + ::pinMode(PIN_YSF, OUTPUT); +#endif +#if defined(PIN_P25) + ::pinMode(PIN_P25, OUTPUT); +#endif +#if defined(PIN_NXDN) && !defined(USE_ALTERNATE_NXDN_LEDS) + ::pinMode(PIN_NXDN, OUTPUT); +#endif +#if defined(PIN_POCSAG) && !defined(USE_ALTERNATE_POCSAG_LEDS) + ::pinMode(PIN_POCSAG, OUTPUT); +#endif +#if defined(PIN_FM) && !defined(USE_ALTERNATE_FM_LEDS) + ::pinMode(PIN_FM, OUTPUT); +#endif +#if defined(PIN_M17) && !defined(USE_ALTERNATE_M17_LEDS) + ::pinMode(PIN_M17, OUTPUT); +#endif +#endif +} + +void CIO::startHardware() +{ + +} + +bool CIO::getCOS() +{ + return ::digitalRead(PIN_COS) == HIGH; +} + +void CIO::setLED(bool on) +{ + ::digitalWrite(PIN_LED, on ? HIGH : LOW); +} + +void CIO::setPTT(bool on) +{ + ::digitalWrite(PIN_PTT, on ? HIGH : LOW); +} + +void CIO::setCOS(bool on) +{ + ::digitalWrite(PIN_COSLED, on ? HIGH : LOW); +} + +void CIO::setDStar(bool on) +{ +#if defined(MODE_LEDS) && defined(PIN_DSTAR) + ::digitalWrite(PIN_DSTAR, on ? HIGH : LOW); +#endif +} + +void CIO::setDMR(bool on) +{ +#if defined(MODE_LEDS) && defined(PIN_DMR) + ::digitalWrite(PIN_DMR, on ? HIGH : LOW); +#endif +} + +void CIO::setYSF(bool on) +{ +#if defined(MODE_LEDS) && defined(PIN_YSF) + ::digitalWrite(PIN_YSF, on ? HIGH : LOW); +#endif +} + +void CIO::setP25(bool on) +{ +#if defined(MODE_LEDS) && defined(PIN_P25) + ::digitalWrite(PIN_P25, on ? HIGH : LOW); +#endif +} + +void CIO::setNXDN(bool on) +{ +#if defined(MODE_LEDS) +#if defined(USE_ALTERNATE_NXDN_LEDS) + ::digitalWrite(PIN_YSF, on ? HIGH : LOW); + ::digitalWrite(PIN_P25, on ? HIGH : LOW); +#else +#if defined(PIN_NXDN) + ::digitalWrite(PIN_NXDN, on ? HIGH : LOW); +#endif +#endif +#endif +} + +void CIO::setM17(bool on) +{ +#if defined(MODE_LEDS) +#if defined(USE_ALTERNATE_M17_LEDS) + ::digitalWrite(PIN_DSTAR, on ? HIGH : LOW); + ::digitalWrite(PIN_P25, on ? HIGH : LOW); +#else +#if defined(PIN_M17) + ::digitalWrite(PIN_M17, on ? HIGH : LOW); +#endif +#endif +#endif +} + +void CIO::setPOCSAG(bool on) +{ +#if defined(MODE_LEDS) +#if defined(USE_ALTERNATE_POCSAG_LEDS) + ::digitalWrite(PIN_DSTAR, on ? HIGH : LOW); + ::digitalWrite(PIN_DMR, on ? HIGH : LOW); +#else +#if defined(PIN_POCSAG) + ::digitalWrite(PIN_POCSAG, on ? HIGH : LOW); +#endif +#endif +#endif +} + +void CIO::setFM(bool on) +{ +#if defined(MODE_LEDS) +#if defined(USE_ALTERNATE_FM_LEDS) + ::digitalWrite(PIN_DSTAR, on ? HIGH : LOW); + ::digitalWrite(PIN_YSF, on ? HIGH : LOW); +#else +#if defined(PIN_FM) + ::digitalWrite(PIN_FM, on ? HIGH : LOW); +#endif +#endif +#endif +} diff --git a/src/IO.h b/src/IO.h index f1eef3e..7ead8ce 100644 --- a/src/IO.h +++ b/src/IO.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015,2016,2017,2018,2020,2021 by Jonathan Naylor G4KLX + * Copyright (C) 2015,2016,2017,2018,2020,2021,2024 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -143,24 +143,24 @@ private: bool m_lockout; - // Hardware specific routines - void initInt(); - void startInt(); + // Hardware access routines + void initHardware(); + void startHardware(); - bool getCOSInt(); + bool getCOS(); - void setLEDInt(bool on); - void setPTTInt(bool on); - void setCOSInt(bool on); + void setLED(bool on); + void setPTT(bool on); + void setCOS(bool on); - void setDStarInt(bool on); - void setDMRInt(bool on); - void setYSFInt(bool on); - void setP25Int(bool on); - void setNXDNInt(bool on); - void setPOCSAGInt(bool on); - void setM17Int(bool on); - void setFMInt(bool on); + void setDStar(bool on); + void setDMR(bool on); + void setYSF(bool on); + void setP25(bool on); + void setNXDN(bool on); + void setPOCSAG(bool on); + void setM17(bool on); + void setFM(bool on); }; #endif diff --git a/src/IOPins.h b/src/IOPins.h index 0adaea6..e883b2a 100644 --- a/src/IOPins.h +++ b/src/IOPins.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2019,2020 by BG5HHP + * Copyright (C) 2024 by Jonathan Naylor, G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,60 +17,20 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef _IO_PINS_H +#if !defined(_IO_PINS_H) #define _IO_PINS_H -#if !defined(CONFIG_H) -#error "Requires Config.h to be included first!" -#endif +#if defined(ZUM_V09_PI) + #include "pins/pins_zum_v09_pi.h" -#if defined(STM32F4_RPT_HAT_TGO) - #include "pins/pins_f4_rpt_tgo.h" +#elif defined(ZUM_V10_PI) + #include "pins/pins_zum_v10_pi.h" -#elif defined(STM32F4_DISCOVERY) - #include "pins/pins_f4_discovery.h" +#elif defined(RB_V3_PI) + #include "pins/pins_rb_v3_pi.h" -#elif defined(STM32F4_PI) - #include "pins/pins_f4_pi.h" - -#elif defined(STM32F722_PI) - #include "pins/pins_f7_pi.h" - -#elif defined(STM32F4_F4M) - #include "pins/pins_f4_f4m.h" - -#elif defined(STM32F722_F7M) - #include "pins/pins_f7_f7m.h" - -#elif defined(STM32F722_RPT_HAT) - #include "pins/pins_f7_rpt_hat.h" - -#elif defined(STM32F4_NUCLEO) - #if defined(STM32F4_NUCLEO_MORPHO_HEADER) - #include "pins/pins_f4_nucleo_morpho.h" - #elif defined(STM32F4_NUCLEO_ARDUINO_HEADER) - #include "pins/pins_f4_nucleo_arduino.h" - #else - #error "Either STM32F4_NUCLEO_MORPHO_HEADER or STM32F4_NUCLEO_ARDUINO_HEADER need to be defined" - #endif - -#elif defined(STM32F7_NUCLEO) - #include "pins/pins_f7_nucleo.h" - -#elif defined(STM32F4_DVM) - #include "pins/pins_f4_stm32dvm_v3.h" - -#elif defined(STM32F7_DVM) - #include "pins/pins_f7_stm32dvm_v5.h" - -#elif defined(DRCC_DVM_NQF) - #include "pins/pins_f4_drcc_nqf.h" - -#elif defined(DRCC_DVM_HHP446) - #include "pins/pins_f4_drcc_hhp446.h" - -#elif defined(STM32F4_EDA_405) || defined(STM32F4_EDA_446) - #include "pins/pins_f4_stm32eda.h" +#elif defined(RB_V5_PI) + #include "pins/pins_rb_v5_pi.h" #else #error "A valid board type macro need to be defined." diff --git a/src/SerialPort.cpp b/src/SerialPort.cpp index 755bc67..b72d54f 100644 --- a/src/SerialPort.cpp +++ b/src/SerialPort.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013,2015-2021 by Jonathan Naylor G4KLX + * Copyright (C) 2013,2015-2021,2024 by Jonathan Naylor G4KLX * Copyright (C) 2016 by Colin Durbridge G4EML * * This program is free software; you can redistribute it and/or modify @@ -26,6 +26,7 @@ #include "SerialPort.h" #include "Version.h" +#include "IOPins.h" const uint8_t MMDVM_FRAME_START = 0xE0U; @@ -97,18 +98,6 @@ const uint8_t MMDVM_DEBUG4 = 0xF4U; const uint8_t MMDVM_DEBUG5 = 0xF5U; const uint8_t MMDVM_DEBUG_DUMP = 0xFAU; -#if EXTERNAL_OSC == 12000000 -#define TCXO "12.0000 MHz" -#elif EXTERNAL_OSC == 12288000 -#define TCXO "12.2880 MHz" -#elif EXTERNAL_OSC == 14400000 -#define TCXO "14.4000 MHz" -#elif EXTERNAL_OSC == 19200000 -#define TCXO "19.2000 Mhz" -#else -#define TCXO "NO TCXO" -#endif - #if defined(DRCC_DVM_NQF) #define HW_TYPE "MMDVM DRCC_DVM_NQF" #elif defined(DRCC_DVM_HHP446) @@ -122,11 +111,11 @@ const uint8_t MMDVM_DEBUG_DUMP = 0xFAU; #endif #if defined(GITVERSION) -#define concat(h, a, b, c) h " " a " " b " GitID #" c "" -const char HARDWARE[] = concat(HW_TYPE, VERSION, TCXO, GITVERSION); +#define concat(h, a, b) h " " a " GitID #" b "" +const char HARDWARE[] = concat(HW_TYPE, VERSION, GITVERSION); #else -#define concat(h, a, b, c, d) h " " a " " b " (Build: " c " " d ")" -const char HARDWARE[] = concat(HW_TYPE, VERSION, TCXO, __TIME__, __DATE__); +#define concat(h, a, b, c) h " " a " (Build: " b " " c ")" +const char HARDWARE[] = concat(HW_TYPE, VERSION, __TIME__, __DATE__); #endif const uint8_t PROTOCOL_VERSION = 2U; @@ -136,14 +125,20 @@ const int MAX_SERIAL_DATA = 250; const uint16_t MAX_SERIAL_COUNT = 100U; CSerialPort::CSerialPort() : +m_host(PIN_HOST_RXD, PIN_HOST_TXD), +#if defined(SERIAL_REPEATER) +m_rpt(PIN_RPT_RXD, PIN_RPT_TXD), +#endif m_buffer(), m_ptr(0U), m_len(0U), m_debug(false), m_serialData(), m_lastSerialAvail(0), -m_lastSerialAvailCount(0U), -m_i2CData() +m_lastSerialAvailCount(0U) +#if defined(I2C_REPEATER) +,m_i2CData() +#endif { } @@ -156,7 +151,7 @@ void CSerialPort::sendACK(uint8_t type) reply[2U] = MMDVM_ACK; reply[3U] = type; - writeInt(1U, reply, 4); + m_host.write(reply, 4); } void CSerialPort::sendNAK(uint8_t type, uint8_t err) @@ -169,7 +164,7 @@ void CSerialPort::sendNAK(uint8_t type, uint8_t err) reply[3U] = type; reply[4U] = err; - writeInt(1U, reply, 5); + m_host.write(reply, 5); } void CSerialPort::getStatus() @@ -305,7 +300,7 @@ void CSerialPort::getStatus() reply[18U] = 0x00U; reply[19U] = 0x00U; - writeInt(1U, reply, 20); + m_host.write(reply, 20); } void CSerialPort::getVersion() @@ -363,7 +358,7 @@ void CSerialPort::getVersion() reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } uint8_t CSerialPort::setConfig(const uint8_t* data, uint16_t length) @@ -893,24 +888,24 @@ void CSerialPort::setMode(MMDVM_STATE modemState) void CSerialPort::start() { - beginInt(1U, SERIAL_SPEED); + m_host.begin(SERIAL_SPEED); #if defined(SERIAL_REPEATER) #if defined(SERIAL_REPEATER_BAUD_RATE) - beginInt(3U, SERIAL_REPEATER_BAUD_RATE); + m_rpt.begin(SERIAL_REPEATER_BAUD_RATE); #else - beginInt(3U, 9600); + m_rpt.begin(9600); #endif #endif #if defined(I2C_REPEATER) - beginInt(10U, 9600); + m_rpt.begin(9600); #endif } void CSerialPort::process() { - while (availableForReadInt(1U)) { - uint8_t c = readInt(1U); + while (m_host.available()) { + uint8_t c = m_host.read(); if (m_ptr == 0U) { if (c == MMDVM_FRAME_START) { @@ -961,23 +956,23 @@ void CSerialPort::process() // Write any outgoing serial data uint16_t serialSpace = m_serialData.getData(); if (serialSpace > 0U) { - int avail = availableForWriteInt(3U); + int avail = m_rpt.availableForWrite(); if (avail < serialSpace) serialSpace = avail; for (uint16_t i = 0U; i < serialSpace; i++) { uint8_t c = 0U; m_serialData.get(c); - writeInt(3U, &c, 1U); + m_rpt.write(&c, 1U); } } // Read any incoming serial data, and send out in batches - int serialAvail = availableForReadInt(3U); + int serialAvail = m_rpt.available(); if ((serialAvail > 0 && serialAvail == m_lastSerialAvail && m_lastSerialAvailCount >= MAX_SERIAL_COUNT) || (serialAvail >= MAX_SERIAL_DATA)) { uint8_t buffer[MAX_SERIAL_DATA]; for (int i = 0; i < serialAvail && i < MAX_SERIAL_DATA; i++) { - buffer[i] = readInt(3U); + buffer[i] = m_rpt.read(); m_lastSerialAvail--; } writeSerialData(buffer, serialAvail - m_lastSerialAvail); @@ -994,14 +989,14 @@ void CSerialPort::process() // Write any outgoing serial data uint16_t i2CSpace = m_i2CData.getData(); if (i2CSpace > 0U) { - int avail = availableForWriteInt(10U); + int avail = m_rpt.available(); if (avail < i2CSpace) i2CSpace = avail; for (uint16_t i = 0U; i < i2CSpace; i++) { uint8_t c = 0U; m_i2CData.get(c); - writeInt(10U, &c, 1U); + m_rpt.write(&c, 1U); } } #endif @@ -1457,7 +1452,7 @@ void CSerialPort::writeDStarHeader(const uint8_t* header, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeDStarData(const uint8_t* data, uint8_t length) @@ -1480,7 +1475,7 @@ void CSerialPort::writeDStarData(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeDStarLost() @@ -1497,7 +1492,7 @@ void CSerialPort::writeDStarLost() reply[1U] = 3U; reply[2U] = MMDVM_DSTAR_LOST; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } void CSerialPort::writeDStarEOT() @@ -1514,7 +1509,7 @@ void CSerialPort::writeDStarEOT() reply[1U] = 3U; reply[2U] = MMDVM_DSTAR_EOT; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } #endif @@ -1539,7 +1534,7 @@ void CSerialPort::writeDMRData(bool slot, const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeDMRLost(bool slot) @@ -1556,7 +1551,7 @@ void CSerialPort::writeDMRLost(bool slot) reply[1U] = 3U; reply[2U] = slot ? MMDVM_DMR_LOST2 : MMDVM_DMR_LOST1; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } #endif @@ -1581,7 +1576,7 @@ void CSerialPort::writeYSFData(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeYSFLost() @@ -1598,7 +1593,7 @@ void CSerialPort::writeYSFLost() reply[1U] = 3U; reply[2U] = MMDVM_YSF_LOST; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } #endif @@ -1623,7 +1618,7 @@ void CSerialPort::writeP25Hdr(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeP25Ldu(const uint8_t* data, uint8_t length) @@ -1646,7 +1641,7 @@ void CSerialPort::writeP25Ldu(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeP25Lost() @@ -1663,7 +1658,7 @@ void CSerialPort::writeP25Lost() reply[1U] = 3U; reply[2U] = MMDVM_P25_LOST; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } #endif @@ -1688,7 +1683,7 @@ void CSerialPort::writeNXDNData(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeNXDNLost() @@ -1705,7 +1700,7 @@ void CSerialPort::writeNXDNLost() reply[1U] = 3U; reply[2U] = MMDVM_NXDN_LOST; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } #endif @@ -1730,7 +1725,7 @@ void CSerialPort::writeM17LinkSetup(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeM17Stream(const uint8_t* data, uint8_t length) @@ -1753,7 +1748,7 @@ void CSerialPort::writeM17Stream(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeM17EOT() @@ -1770,7 +1765,7 @@ void CSerialPort::writeM17EOT() reply[1U] = 3U; reply[2U] = MMDVM_M17_EOT; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } void CSerialPort::writeM17Lost() @@ -1787,7 +1782,7 @@ void CSerialPort::writeM17Lost() reply[1U] = 3U; reply[2U] = MMDVM_M17_LOST; - writeInt(1U, reply, 3); + m_host.write(reply, 3); } #endif @@ -1812,7 +1807,7 @@ void CSerialPort::writeFMData(const uint8_t* data, uint16_t length) for (uint16_t i = 0U; i < length; i++) reply[i + 4U] = data[i]; - writeInt(1U, reply, length + 4U); + m_host.write(reply, length + 4U); } else { reply[1U] = length + 3U; reply[2U] = MMDVM_FM_DATA; @@ -1820,7 +1815,7 @@ void CSerialPort::writeFMData(const uint8_t* data, uint16_t length) for (uint16_t i = 0U; i < length; i++) reply[i + 3U] = data[i]; - writeInt(1U, reply, length + 3U); + m_host.write(reply, length + 3U); } } @@ -1839,7 +1834,7 @@ void CSerialPort::writeFMStatus(uint8_t status) reply[2U] = MMDVM_FM_STATUS; reply[3U] = status; - writeInt(1U, reply, 4U); + m_host.write(reply, 4U); } void CSerialPort::writeFMEOT() @@ -1856,7 +1851,7 @@ void CSerialPort::writeFMEOT() reply[1U] = 3U; reply[2U] = MMDVM_FM_EOT; - writeInt(1U, reply, 3U); + m_host.write(reply, 3U); } #endif @@ -1881,7 +1876,7 @@ void CSerialPort::writeAX25Data(const uint8_t* data, uint16_t length) for (uint16_t i = 0U; i < length; i++) reply[i + 4U] = data[i]; - writeInt(1U, reply, length + 4U); + m_host.write(reply, length + 4U); } else { reply[1U] = length + 3U; reply[2U] = MMDVM_AX25_DATA; @@ -1889,7 +1884,7 @@ void CSerialPort::writeAX25Data(const uint8_t* data, uint16_t length) for (uint16_t i = 0U; i < length; i++) reply[i + 3U] = data[i]; - writeInt(1U, reply, length + 3U); + m_host.write(reply, length + 3U); } } #endif @@ -1909,7 +1904,7 @@ void CSerialPort::writeSerialData(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } #endif @@ -1928,7 +1923,7 @@ void CSerialPort::writeI2CData(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } #endif @@ -1949,7 +1944,7 @@ void CSerialPort::writeCalData(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length) @@ -1969,7 +1964,7 @@ void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length) reply[1U] = count; - writeInt(1U, reply, count); + m_host.write(reply, count); } void CSerialPort::writeDebug(const char* text) @@ -1989,7 +1984,7 @@ void CSerialPort::writeDebug(const char* text) reply[1U] = count; - writeInt(1U, reply, count, true); + m_host.write(reply, count); } void CSerialPort::writeDebug(const char* text, int16_t n1) @@ -2012,7 +2007,7 @@ void CSerialPort::writeDebug(const char* text, int16_t n1) reply[1U] = count; - writeInt(1U, reply, count, true); + m_host.write(reply, count); } void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2) @@ -2038,7 +2033,7 @@ void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2) reply[1U] = count; - writeInt(1U, reply, count, true); + m_host.write(reply, count); } void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3) @@ -2067,7 +2062,7 @@ void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n reply[1U] = count; - writeInt(1U, reply, count, true); + m_host.write(reply, count); } void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3, int16_t n4) @@ -2099,7 +2094,7 @@ void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n reply[1U] = count; - writeInt(1U, reply, count, true); + m_host.write(reply, count); } void CSerialPort::writeDebugDump(const uint8_t* data, uint16_t length) @@ -2116,7 +2111,7 @@ void CSerialPort::writeDebugDump(const uint8_t* data, uint16_t length) for (uint16_t i = 0U; i < length; i++) reply[i + 4U] = data[i]; - writeInt(1U, reply, length + 4U); + m_host.write(reply, length + 4U); } else { reply[1U] = length + 3U; reply[2U] = MMDVM_DEBUG_DUMP; @@ -2124,6 +2119,6 @@ void CSerialPort::writeDebugDump(const uint8_t* data, uint16_t length) for (uint16_t i = 0U; i < length; i++) reply[i + 3U] = data[i]; - writeInt(1U, reply, length + 3U); + m_host.write(reply, length + 3U); } } diff --git a/src/SerialPort.h b/src/SerialPort.h index c013a7f..9b5b312 100644 --- a/src/SerialPort.h +++ b/src/SerialPort.h @@ -100,14 +100,20 @@ public: void writeDebugDump(const uint8_t* data, uint16_t length); private: - uint8_t m_buffer[512U]; - uint16_t m_ptr; - uint16_t m_len; - bool m_debug; + HardwareSerial m_host; +#if defined(SERIAL_REPEATER) + HardwareSerial m_rpt; +#endif + uint8_t m_buffer[512U]; + uint16_t m_ptr; + uint16_t m_len; + bool m_debug; CRingBuffer m_serialData; - int m_lastSerialAvail; - uint16_t m_lastSerialAvailCount; + int m_lastSerialAvail; + uint16_t m_lastSerialAvailCount; +#if defined(I2C_REPEATER) CRingBuffer m_i2CData; +#endif void sendACK(uint8_t type); void sendNAK(uint8_t type, uint8_t err); diff --git a/src/pins/pins_f4_discovery.h b/src/pins/pins_f4_discovery.h deleted file mode 100644 index 6e21cda..0000000 --- a/src/pins/pins_f4_discovery.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_DISCOVERY_H -#define _PINS_F4_DISCOVERY_H - -/* -Pin definitions for STM32F4 Discovery Board: - -PTT PB13 output P1 Pin37 -COSLED PA7 output P1 Pin17 -LED PD15 output P1 Pin47 -COS PA5 input P1 Pin15 - -DSTAR PD12 output P1 Pin44 -DMR PD13 output P1 Pin45 -YSF PD14 output P1 Pin46 -P25 PD11 output P1 Pin43 -NXDN PD10 output P1 Pin42 - -RX PA0 analog input P1 Pin12 -RSSI PA1 analog input P1 Pin11 -TX PA4 analog output P1 Pin16 - -EXT_CLK PA15 input P2 Pin40 -*/ - -#define PIN_COS GPIO_Pin_5 -#define PORT_COS GPIOA -#define RCC_Per_COS RCC_AHB1Periph_GPIOA - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_7 -#define PORT_COSLED GPIOA -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOA - -#define PIN_LED GPIO_Pin_15 -#define PORT_LED GPIOD -#define RCC_Per_LED RCC_AHB1Periph_GPIOD - -#define PIN_P25 GPIO_Pin_11 -#define PORT_P25 GPIOD -#define RCC_Per_P25 RCC_AHB1Periph_GPIOD - -#define PIN_NXDN GPIO_Pin_10 -#define PORT_NXDN GPIOD -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOD - -#define PIN_DSTAR GPIO_Pin_12 -#define PORT_DSTAR GPIOD -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOD - -#define PIN_DMR GPIO_Pin_13 -#define PORT_DMR GPIOD -#define RCC_Per_DMR RCC_AHB1Periph_GPIOD - -#define PIN_YSF GPIO_Pin_14 -#define PORT_YSF GPIOD -#define RCC_Per_YSF RCC_AHB1Periph_GPIOD - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_1 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_drcc_hhp446.h b/src/pins/pins_f4_drcc_hhp446.h deleted file mode 100644 index feb99e6..0000000 --- a/src/pins/pins_f4_drcc_hhp446.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_DRCC_HHP446_H -#define _PINS_F4_DRCC_HHP446_H - -/* -Pin definitions for DRCC_DVM BG5HHP F446 board rev1 - -TX/PTT_LED PB12 output -RX/COS_LED PB5 output -STATUS_LED PB10 output - -COS_IN PB13 input - -DSTAR N/A -DMR N/A -YSF N/A -P25 N/A -NXDN N/A -POCSAG N/A - -MDMR/BIT0 PB8 output -MYSF/BIT1 PB9 output -MDSTAR/BIT2 PB14 output -MP25/BIT3 PB15 output Generic Mode Pins -MNXDN N/A -MPOCSAG N/A - -RX PA0 analog input -RSSI PA1 analog input -TX PA4 analog output - -EXT_CLK N/A - -UART1_TX PA9 output -UART1_RX PA10 output Host Data Communication - -UART2_TX PA2 output -UART2_RX PA3 output Nextion Data Communication - -I2C1_SCL PB6 output -I2C1_SDA PB7 output OLED Data Communication as master - -*/ - -#define PIN_COS GPIO_Pin_13 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_12 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_5 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_10 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_TXLED GPIO_Pin_4 -#define PORT_TXLED GPIOB -#define RCC_Per_TXLED RCC_AHB1Periph_GPIOB - -// #define PIN_P25 GPIO_Pin_3 -// #define PORT_P25 GPIOB -// #define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -// #define PIN_NXDN GPIO_Pin_10 -// #define PORT_NXDN GPIOA -// #define RCC_Per_NXDN RCC_AHB1Periph_GPIOA - -// #define PIN_POCSAG GPIO_Pin_12 -// #define PORT_POCSAG GPIOB -// #define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -// #define PIN_DSTAR GPIO_Pin_10 -// #define PORT_DSTAR GPIOB -// #define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -// #define PIN_DMR GPIO_Pin_4 -// #define PORT_DMR GPIOB -// #define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -// #define PIN_YSF GPIO_Pin_5 -// #define PORT_YSF GPIOB -// #define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -#if defined(MODE_PINS) -#define PIN_MP25 GPIO_Pin_15 -#define PORT_MP25 GPIOB -#define RCC_Per_MP25 RCC_AHB1Periph_GPIOB - -#define PIN_MDSTAR GPIO_Pin_9 -#define PORT_MDSTAR GPIOB -#define RCC_Per_MDSTAR RCC_AHB1Periph_GPIOB - -#define PIN_MDMR GPIO_Pin_8 -#define PORT_MDMR GPIOB -#define RCC_Per_MDMR RCC_AHB1Periph_GPIOB - -#define PIN_MYSF GPIO_Pin_14 -#define PORT_MYSF GPIOB -#define RCC_Per_MYSF RCC_AHB1Periph_GPIOB -#endif - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_1 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 -#define PORT_TX GPIOA -#define RCC_Per_TX RCC_AHB1Periph_GPIOA - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_drcc_nqf.h b/src/pins/pins_f4_drcc_nqf.h deleted file mode 100644 index 8002053..0000000 --- a/src/pins/pins_f4_drcc_nqf.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_DRCC_NQF_H -#define _PINS_F4_DRCC_NQF_H - -/* -Pin definitions for DRCC_DVM BG7NQF board rev1 - -TX/PTT_LED PB12 output -RX/COS_LED PB5 output -STATUS_LED PB10 output - -COS_IN PB13 input - -DSTAR N/A -DMR N/A -YSF N/A -P25 N/A -NXDN N/A -POCSAG N/A - -MDMR/BIT0 PB8 output -MYSF/BIT1 PB9 output -MDSTAR/BIT2 PB14 output -MP25/BIT3 PB15 output Generic Mode Pins -MNXDN N/A -MPOCSAG N/A - -RX PA0 analog input -RSSI PA1 analog input -TX PA4 analog output - -EXT_CLK PA15 input - -UART1_TX PA9 output -UART1_RX PA10 output Host Data Communication - -UART2_TX PA2 output -UART2_RX PA3 output Nextion Data Communication - -I2C1_SCL PB6 output -I2C1_SDA PB7 output OLED Data Communication as master - -*/ - -#define PIN_COS GPIO_Pin_13 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_12 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_5 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_10 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_TXLED GPIO_Pin_4 -#define PORT_TXLED GPIOB -#define RCC_Per_TXLED RCC_AHB1Periph_GPIOB - -// #define PIN_P25 GPIO_Pin_3 -// #define PORT_P25 GPIOB -// #define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -// #define PIN_NXDN GPIO_Pin_10 -// #define PORT_NXDN GPIOA -// #define RCC_Per_NXDN RCC_AHB1Periph_GPIOA - -// #define PIN_POCSAG GPIO_Pin_12 -// #define PORT_POCSAG GPIOB -// #define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -// #define PIN_DSTAR GPIO_Pin_10 -// #define PORT_DSTAR GPIOB -// #define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -// #define PIN_DMR GPIO_Pin_4 -// #define PORT_DMR GPIOB -// #define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -// #define PIN_YSF GPIO_Pin_5 -// #define PORT_YSF GPIOB -// #define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -#if defined(MODE_PINS) -#define PIN_MP25 GPIO_Pin_15 -#define PORT_MP25 GPIOB -#define RCC_Per_MP25 RCC_AHB1Periph_GPIOB - -#define PIN_MDSTAR GPIO_Pin_9 -#define PORT_MDSTAR GPIOB -#define RCC_Per_MDSTAR RCC_AHB1Periph_GPIOB - -#define PIN_MDMR GPIO_Pin_8 -#define PORT_MDMR GPIOB -#define RCC_Per_MDMR RCC_AHB1Periph_GPIOB - -#define PIN_MYSF GPIO_Pin_14 -#define PORT_MYSF GPIOB -#define RCC_Per_MYSF RCC_AHB1Periph_GPIOB - -#endif - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_1 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 -#define PORT_TX GPIOA -#define RCC_Per_TX RCC_AHB1Periph_GPIOA - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_f4m.h b/src/pins/pins_f4_f4m.h deleted file mode 100644 index 1dadd4f..0000000 --- a/src/pins/pins_f4_f4m.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_F4M_H -#define _PINS_F4_F4M_H - -/* -Pin definitions for MMDVM-F4M Pi-Hat F0DEI board: - -PTT PB13 output -COSLED PB14 output -LED PB15 output -COS PC0 input - -DSTAR PC7 output -DMR PC8 output -YSF PA8 output -P25 PC9 output -NXDN PB1 output -POCSAG PB12 output - -RX PA0 analog input -RSSI PA7 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_0 -#define PORT_COS GPIOC -#define RCC_Per_COS RCC_AHB1Periph_GPIOC - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_14 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_15 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_9 -#define PORT_P25 GPIOC -#define RCC_Per_P25 RCC_AHB1Periph_GPIOC - -#define PIN_NXDN GPIO_Pin_1 -#define PORT_NXDN GPIOB -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_7 -#define PORT_DSTAR GPIOC -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOC - -#define PIN_DMR GPIO_Pin_8 -#define PORT_DMR GPIOC -#define RCC_Per_DMR RCC_AHB1Periph_GPIOC - -#define PIN_YSF GPIO_Pin_8 -#define PORT_YSF GPIOA -#define RCC_Per_YSF RCC_AHB1Periph_GPIOA - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_7 -#define PIN_RSSI_CH ADC_Channel_7 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_nucleo_arduino.h b/src/pins/pins_f4_nucleo_arduino.h deleted file mode 100644 index 5db9b1b..0000000 --- a/src/pins/pins_f4_nucleo_arduino.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_NUCLEO_ARDUINO_H -#define _PINS_F4_NUCLEO_ARDUINO_H - -/* -Pin definitions for STM32F4 Nucleo boards (Arduino header): - -PTT PB10 output CN9 Pin7 -COSLED PB3 output CN9 Pin4 -LED PB5 output CN9 Pin5 -COS PB4 input CN9 Pin6 - -DSTAR PA1 output CN8 Pin2 -DMR PA4 output CN8 Pin3 -YSF PB0 output CN8 Pin4 -P25 PC1 output CN8 Pin5 -NXDN PA3 output CN9 Pin1 -POCSAG PB12 output - -RX PA0 analog input CN8 Pin1 -RSSI PC0 analog input CN8 Pin6 -TX PA5 analog output CN5 Pin6 - -EXT_CLK PB8 input CN5 Pin10 -*/ - -#define PIN_COS GPIO_Pin_4 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_10 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_3 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_5 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_1 -#define PORT_P25 GPIOC -#define RCC_Per_P25 RCC_AHB1Periph_GPIOC - -#define PIN_NXDN GPIO_Pin_3 -#define PORT_NXDN GPIOA -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOA - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_1 -#define PORT_DSTAR GPIOA -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOA - -#define PIN_DMR GPIO_Pin_4 -#define PORT_DMR GPIOA -#define RCC_Per_DMR RCC_AHB1Periph_GPIOA - -#define PIN_YSF GPIO_Pin_0 -#define PORT_YSF GPIOB -#define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -#define PIN_EXT_CLK GPIO_Pin_8 -#define SRC_EXT_CLK GPIO_PinSource8 -#define PORT_EXT_CLK GPIOB - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_0 -#define PIN_RSSI_CH ADC_Channel_10 -#define PORT_RSSI GPIOC -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOC - -#define PIN_TX GPIO_Pin_5 -#define PIN_TX_CH DAC_Channel_2 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_nucleo_morpho.h b/src/pins/pins_f4_nucleo_morpho.h deleted file mode 100644 index 4200317..0000000 --- a/src/pins/pins_f4_nucleo_morpho.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_NUCLEO_MORPHO_H -#define _PINS_F4_NUCLEO_MORPHO_H - -/* -Pin definitions for STM32F4 Nucleo boards (ST Morpho header): - -PTT PB13 output CN10 Pin30 -COSLED PB14 output CN10 Pin28 -LED PA5 output CN10 Pin11 -COS PB15 input CN10 Pin26 - -DSTAR PB10 output CN10 Pin25 -DMR PB4 output CN10 Pin27 -YSF PB5 output CN10 Pin29 -P25 PB3 output CN10 Pin31 -NXDN PA10 output CN10 Pin33 -POCSAG PB12 output CN10 Pin16 - -MDSTAR PC4 output CN10 Pin34 -MDMR PC5 output CN10 Pin6 -MYSF PC2 output CN7 Pin35 -MP25 PC3 output CN7 Pin37 -MNXDN PC6 output CN10 Pin4 -MPOCSAG PC8 output CN10 Pin2 - -RX PA0 analog input CN7 Pin28 -RSSI PA1 analog input CN7 Pin30 -TX PA4 analog output CN7 Pin32 - -EXT_CLK PA15 input CN7 Pin17 -*/ - -#define PIN_COS GPIO_Pin_15 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_14 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_5 -#define PORT_LED GPIOA -#define RCC_Per_LED RCC_AHB1Periph_GPIOA - -#define PIN_P25 GPIO_Pin_3 -#define PORT_P25 GPIOB -#define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -#define PIN_NXDN GPIO_Pin_10 -#define PORT_NXDN GPIOA -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOA - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_10 -#define PORT_DSTAR GPIOB -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -#define PIN_DMR GPIO_Pin_4 -#define PORT_DMR GPIOB -#define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -#define PIN_YSF GPIO_Pin_5 -#define PORT_YSF GPIOB -#define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -#if defined(MODE_PINS) -#define PIN_MP25 GPIO_Pin_3 -#define PORT_MP25 GPIOC -#define RCC_Per_MP25 RCC_AHB1Periph_GPIOC - -#define PIN_MNXDN GPIO_Pin_6 -#define PORT_MNXDN GPIOC -#define RCC_Per_MNXDN RCC_AHB1Periph_GPIOC - -#define PIN_MDSTAR GPIO_Pin_4 -#define PORT_MDSTAR GPIOC -#define RCC_Per_MDSTAR RCC_AHB1Periph_GPIOC - -#define PIN_MDMR GPIO_Pin_5 -#define PORT_MDMR GPIOC -#define RCC_Per_MDMR RCC_AHB1Periph_GPIOC - -#define PIN_MYSF GPIO_Pin_2 -#define PORT_MYSF GPIOC -#define RCC_Per_MYSF RCC_AHB1Periph_GPIOC - -#define PIN_MPOCSAG GPIO_Pin_8 -#define PORT_MPOCSAG GPIOC -#define RCC_Per_MPOCSAG RCC_AHB1Periph_GPIOC -#endif - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_1 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_pi.h b/src/pins/pins_f4_pi.h deleted file mode 100644 index cf2a660..0000000 --- a/src/pins/pins_f4_pi.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_PI_H -#define _PINS_F4_PI_H - -/* -Pin definitions for STM32F4 Pi Board: - -PTT PB13 output -COSLED PB14 output -LED PB15 output -COS PC0 input - -DSTAR PC7 output -DMR PC8 output -YSF PA8 output -P25 PC9 output -NXDN PB1 output -POCSAG PB12 output - -RX PA0 analog input -RSSI PA7 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_0 -#define PORT_COS GPIOC -#define RCC_Per_COS RCC_AHB1Periph_GPIOC - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_14 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_15 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_9 -#define PORT_P25 GPIOC -#define RCC_Per_P25 RCC_AHB1Periph_GPIOC - -#define PIN_NXDN GPIO_Pin_1 -#define PORT_NXDN GPIOB -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_7 -#define PORT_DSTAR GPIOC -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOC - -#define PIN_DMR GPIO_Pin_8 -#define PORT_DMR GPIOC -#define RCC_Per_DMR RCC_AHB1Periph_GPIOC - -#define PIN_YSF GPIO_Pin_8 -#define PORT_YSF GPIOA -#define RCC_Per_YSF RCC_AHB1Periph_GPIOA - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_7 -#define PIN_RSSI_CH ADC_Channel_7 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_rpt_tgo.h b/src/pins/pins_f4_rpt_tgo.h deleted file mode 100644 index 37a6260..0000000 --- a/src/pins/pins_f4_rpt_tgo.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_RPT_TGO_H -#define _PINS_F4_RPT_TGO_H - -/* -Pin definitions for MMDVM_RPT_Hat Pi-Hat BG4TGO board:: - -PTT PB13 output CN10 Pin30 -COSLED PB14 output CN10 Pin28 -LED PA5 output CN10 Pin11 -COS PB15 input CN10 Pin26 - -DSTAR PB10 output CN10 Pin25 -DMR PB4 output CN10 Pin27 -YSF PB5 output CN10 Pin29 -P25 PB3 output CN10 Pin31 -NXDN PA10 output CN10 Pin33 -POCSAG PB12 output CN10 Pin16 - -MDSTAR PC4 output CN10 Pin34 -MDMR PC5 output CN10 Pin6 -MYSF PC2 output CN7 Pin35 -MP25 PC3 output CN7 Pin37 -MNXDN PC6 output CN10 Pin4 -MPOCSAG PC8 output CN10 Pin2 - -RX PA0 analog input CN7 Pin28 -RSSI PA1 analog input CN7 Pin30 -TX PA4 analog output CN7 Pin32 - -EXT_CLK PA15 input CN7 Pin17 -*/ - -#define PIN_COS GPIO_Pin_15 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_14 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_5 -#define PORT_LED GPIOA -#define RCC_Per_LED RCC_AHB1Periph_GPIOA - -#define PIN_P25 GPIO_Pin_3 -#define PORT_P25 GPIOB -#define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -#define PIN_NXDN GPIO_Pin_10 -#define PORT_NXDN GPIOA -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOA - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_10 -#define PORT_DSTAR GPIOB -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -#define PIN_DMR GPIO_Pin_4 -#define PORT_DMR GPIOB -#define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -#define PIN_YSF GPIO_Pin_5 -#define PORT_YSF GPIOB -#define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -#if defined(MODE_PINS) -#define PIN_MP25 GPIO_Pin_3 -#define PORT_MP25 GPIOC -#define RCC_Per_MP25 RCC_AHB1Periph_GPIOC - -#define PIN_MNXDN GPIO_Pin_6 -#define PORT_MNXDN GPIOC -#define RCC_Per_MNXDN RCC_AHB1Periph_GPIOC - -#define PIN_MDSTAR GPIO_Pin_4 -#define PORT_MDSTAR GPIOC -#define RCC_Per_MDSTAR RCC_AHB1Periph_GPIOC - -#define PIN_MDMR GPIO_Pin_5 -#define PORT_MDMR GPIOC -#define RCC_Per_MDMR RCC_AHB1Periph_GPIOC - -#define PIN_MYSF GPIO_Pin_2 -#define PORT_MYSF GPIOC -#define RCC_Per_MYSF RCC_AHB1Periph_GPIOC - -#define PIN_MPOCSAG GPIO_Pin_8 -#define PORT_MPOCSAG GPIOC -#define RCC_Per_MPOCSAG RCC_AHB1Periph_GPIOC -#endif - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_1 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f4_stm32dvm_v3.h b/src/pins/pins_f4_stm32dvm_v3.h deleted file mode 100644 index c085598..0000000 --- a/src/pins/pins_f4_stm32dvm_v3.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_STM32DVM_V3_H -#define _PINS_F4_STM32DVM_V3_H - -/* -Pin definitions for STM32F4 STM32-DVM rev 3 Board: - -COS PB13 input -PTT PB12 output -COSLED PB4 output -LED PB3 output - -P25 PB8 output -NXDN PB9 output -DSTAR PB6 output -DMR PB5 output -YSF PB7 output -POCSAG PC10 output (Not Valid) -FM PB14 output - -RX PB0 analog input -RSSI PB1 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_13 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_12 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_4 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_3 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_8 -#define PORT_P25 GPIOB -#define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -#define PIN_NXDN GPIO_Pin_9 -#define PORT_NXDN GPIOB -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_6 -#define PORT_DSTAR GPIOB -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -#define PIN_DMR GPIO_Pin_5 -#define PORT_DMR GPIOB -#define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -#define PIN_YSF GPIO_Pin_7 -#define PORT_YSF GPIOB -#define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -/* -#define PIN_POCSAG GPIO_Pin_10 -#define PORT_POCSAG GPIOC -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOC -*/ - -#define PIN_FM GPIO_Pin_14 -#define PORT_FM GPIOB -#define RCC_Per_FM RCC_AHB1Periph_GPIOB - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_8 -#define PORT_RX GPIOB -#define RCC_Per_RX RCC_AHB1Periph_GPIOB - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_9 -#define PORT_RSSI GPIOB -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOB - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif diff --git a/src/pins/pins_f4_stm32eda.h b/src/pins/pins_f4_stm32eda.h deleted file mode 100644 index d380ef6..0000000 --- a/src/pins/pins_f4_stm32eda.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F4_STM32EDA -#define _PINS_F4_STM32EDA - -/* -Pin definitions for STM32F4 STM32-DVM-MTR2K & STM32-DVM-MASTR3: - -COS PB13 input -PTT PB12 output -COSLED PB4 output -LED PB3 output - -P25 PB8 output -NXDN PB9 output -DSTAR PB6 output -DMR PB5 output -YSF PB7 output -POCSAG PC10 output -FM PB14 output - -RX PB0 analog input -RSSI PB1 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_13 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - - -#define PIN_PTT GPIO_Pin_12 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_4 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_3 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_8 -#define PORT_P25 GPIOB -#define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -#define PIN_NXDN GPIO_Pin_9 -#define PORT_NXDN GPIOB -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_6 -#define PORT_DSTAR GPIOB -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -#define PIN_DMR GPIO_Pin_5 -#define PORT_DMR GPIOB -#define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -#define PIN_YSF GPIO_Pin_7 -#define PORT_YSF GPIOB -#define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -#define PIN_POCSAG GPIO_Pin_10 -#define PORT_POCSAG GPIOC -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOC - -#define PIN_FM GPIO_Pin_14 -#define PORT_FM GPIOB -#define RCC_Per_FM RCC_AHB1Periph_GPIOB - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_8 -#define PORT_RX GPIOB -#define RCC_Per_RX RCC_AHB1Periph_GPIOB - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_9 -#define PORT_RSSI GPIOB -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOB - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif - diff --git a/src/pins/pins_f7_f7m.h b/src/pins/pins_f7_f7m.h deleted file mode 100644 index 8e0e09b..0000000 --- a/src/pins/pins_f7_f7m.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F7_F7M_H -#define _PINS_F7_F7M_H - -/* -Pin definitions for MMDVM-F7M Pi-Hat F0DEI board: - -PTT PB13 output -COSLED PB14 output -LED PB15 output -COS PC0 input - -DSTAR PC7 output -DMR PC8 output -YSF PA8 output -P25 PC9 output -NXDN PB1 output -POCSAG PB12 output - -RX PA0 analog input -RSSI PA7 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_0 -#define PORT_COS GPIOC -#define RCC_Per_COS RCC_AHB1Periph_GPIOC - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_14 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_15 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_9 -#define PORT_P25 GPIOC -#define RCC_Per_P25 RCC_AHB1Periph_GPIOC - -#define PIN_NXDN GPIO_Pin_1 -#define PORT_NXDN GPIOB -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_7 -#define PORT_DSTAR GPIOC -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOC - -#define PIN_DMR GPIO_Pin_8 -#define PORT_DMR GPIOC -#define RCC_Per_DMR RCC_AHB1Periph_GPIOC - -#define PIN_YSF GPIO_Pin_8 -#define PORT_YSF GPIOA -#define RCC_Per_YSF RCC_AHB1Periph_GPIOA - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_7 -#define PIN_RSSI_CH ADC_Channel_7 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f7_nucleo.h b/src/pins/pins_f7_nucleo.h deleted file mode 100644 index 51068cc..0000000 --- a/src/pins/pins_f7_nucleo.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F7_NUCLEO_H -#define _PINS_F7_NUCLEO_H - -/* -Pin definitions for STM32F7 Nucleo boards (ST Morpho header): - -PTT PB13 output CN12 Pin30 -COSLED PB14 output CN12 Pin28 -LED PA5 output CN12 Pin11 -COS PB15 input CN12 Pin26 - -DSTAR PB10 output CN12 Pin25 -DMR PB4 output CN12 Pin27 -YSF PB5 output CN12 Pin29 -P25 PB3 output CN12 Pin31 -NXDN PA10 output CN12 Pin33 -POCSAG PB12 output CN12 Pin16 - -MDSTAR PC4 output CN12 Pin34 -MDMR PC5 output CN12 Pin6 -MYSF PC2 output CN11 Pin35 -MP25 PC3 output CN11 Pin37 -MNXDN PC6 output CN12 Pin4 - -RX PA0 analog input CN11 Pin28 -RSSI PA1 analog input CN11 Pin30 -TX PA4 analog output CN11 Pin32 - -EXT_CLK PA15 input CN11 Pin17 -*/ - -#define PIN_COS GPIO_Pin_15 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_14 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_5 -#define PORT_LED GPIOA -#define RCC_Per_LED RCC_AHB1Periph_GPIOA - -#define PIN_P25 GPIO_Pin_3 -#define PORT_P25 GPIOB -#define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -#define PIN_NXDN GPIO_Pin_10 -#define PORT_NXDN GPIOA -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOA - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_10 -#define PORT_DSTAR GPIOB -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -#define PIN_DMR GPIO_Pin_4 -#define PORT_DMR GPIOB -#define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -#define PIN_YSF GPIO_Pin_5 -#define PORT_YSF GPIOB -#define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -#if defined(MODE_PINS) -#define PIN_MP25 GPIO_Pin_3 -#define PORT_MP25 GPIOC -#define RCC_Per_MP25 RCC_AHB1Periph_GPIOC - -#define PIN_MNXDN GPIO_Pin_6 -#define PORT_MNXDN GPIOC -#define RCC_Per_MNXDN RCC_AHB1Periph_GPIOC - -#define PIN_MDSTAR GPIO_Pin_4 -#define PORT_MDSTAR GPIOC -#define RCC_Per_MDSTAR RCC_AHB1Periph_GPIOC - -#define PIN_MDMR GPIO_Pin_5 -#define PORT_MDMR GPIOC -#define RCC_Per_MDMR RCC_AHB1Periph_GPIOC - -#define PIN_MYSF GPIO_Pin_2 -#define PORT_MYSF GPIOC -#define RCC_Per_MYSF RCC_AHB1Periph_GPIOC -#endif - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_1 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f7_pi.h b/src/pins/pins_f7_pi.h deleted file mode 100644 index f1617d7..0000000 --- a/src/pins/pins_f7_pi.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F7_PI_H -#define _PINS_F7_PI_H - -/* -Pin definitions for STM32F722 Pi Board: - -PTT PB13 output -COSLED PB14 output -LED PB15 output -COS PC0 input - -DSTAR PC7 output -DMR PC8 output -YSF PA8 output -P25 PC9 output -NXDN PB1 output -POCSAG PB12 output - -RX PA0 analog input -RSSI PA7 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_0 -#define PORT_COS GPIOC -#define RCC_Per_COS RCC_AHB1Periph_GPIOC - -#define PIN_PTT GPIO_Pin_13 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_14 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_15 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_9 -#define PORT_P25 GPIOC -#define RCC_Per_P25 RCC_AHB1Periph_GPIOC - -#define PIN_NXDN GPIO_Pin_1 -#define PORT_NXDN GPIOB -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB - -#define PIN_POCSAG GPIO_Pin_12 -#define PORT_POCSAG GPIOB -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_7 -#define PORT_DSTAR GPIOC -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOC - -#define PIN_DMR GPIO_Pin_8 -#define PORT_DMR GPIOC -#define RCC_Per_DMR RCC_AHB1Periph_GPIOC - -#define PIN_YSF GPIO_Pin_8 -#define PORT_YSF GPIOA -#define RCC_Per_YSF RCC_AHB1Periph_GPIOA - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_7 -#define PIN_RSSI_CH ADC_Channel_7 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f7_rpt_hat.h b/src/pins/pins_f7_rpt_hat.h deleted file mode 100644 index 21512aa..0000000 --- a/src/pins/pins_f7_rpt_hat.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F7_RPT_HAT_H -#define _PINS_F7_RPT_HAT_H - -/* -Pin definitions for MMDVM_RPT_Hat Pi-Hat F0DEI DB9MAT DF2ET board: - -PTT PB14 output -COSLED PB13 output -LED PB12 output -COS PC0 input - -DSTAR PB15 output -DMR PC6 output -YSF PC7 output -P25 PC8 output -NXDN PC9 output -POCSAG PA8 output -FM PA11 output - -MDSTAR PC1 output -MDMR PC2 output -MYSF PC3 output -MP25 PC4 output -MNXDN PC10 output -MPOCSAG PC11 output -MFM PC13 output - -RX PA0 analog input -RSSI PA7 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_0 -#define PORT_COS GPIOC -#define RCC_Per_COS RCC_AHB1Periph_GPIOC - -#define PIN_PTT GPIO_Pin_14 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_13 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_12 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_8 -#define PORT_P25 GPIOC -#define RCC_Per_P25 RCC_AHB1Periph_GPIOC - -#define PIN_NXDN GPIO_Pin_9 -#define PORT_NXDN GPIOC -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOC - -#define PIN_POCSAG GPIO_Pin_8 -#define PORT_POCSAG GPIOA -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOA - -#define PIN_FM GPIO_Pin_11 -#define PORT_FM GPIOA -#define RCC_Per_FM RCC_AHB1Periph_GPIOA - -#define PIN_DSTAR GPIO_Pin_15 -#define PORT_DSTAR GPIOB -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -#define PIN_DMR GPIO_Pin_6 -#define PORT_DMR GPIOC -#define RCC_Per_DMR RCC_AHB1Periph_GPIOC - -#define PIN_YSF GPIO_Pin_7 -#define PORT_YSF GPIOC -#define RCC_Per_YSF RCC_AHB1Periph_GPIOC - -#if defined(MODE_PINS) -#define PIN_MP25 GPIO_Pin_4 -#define PORT_MP25 GPIOC -#define RCC_Per_MP25 RCC_AHB1Periph_GPIOC - -#define PIN_MNXDN GPIO_Pin_10 -#define PORT_MNXDN GPIOC -#define RCC_Per_MNXDN RCC_AHB1Periph_GPIOC - -#define PIN_MDSTAR GPIO_Pin_1 -#define PORT_MDSTAR GPIOC -#define RCC_Per_MDSTAR RCC_AHB1Periph_GPIOC - -#define PIN_MDMR GPIO_Pin_2 -#define PORT_MDMR GPIOC -#define RCC_Per_MDMR RCC_AHB1Periph_GPIOC - -#define PIN_MYSF GPIO_Pin_3 -#define PORT_MYSF GPIOC -#define RCC_Per_MYSF RCC_AHB1Periph_GPIOC - -#define PIN_MPOCSAG GPIO_Pin_11 -#define PORT_MPOCSAG GPIOC -#define RCC_Per_MPOCSAG RCC_AHB1Periph_GPIOC - -#define PIN_MFM GPIO_Pin_13 -#define PORT_MFM GPIOC -#define RCC_Per_MFM RCC_AHB1Periph_GPIOC -#endif - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_0 -#define PORT_RX GPIOA -#define RCC_Per_RX RCC_AHB1Periph_GPIOA - -#define PIN_RSSI GPIO_Pin_7 -#define PIN_RSSI_CH ADC_Channel_7 -#define PORT_RSSI GPIOA -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOA - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif \ No newline at end of file diff --git a/src/pins/pins_f7_stm32dvm_v5.h b/src/pins/pins_f7_stm32dvm_v5.h deleted file mode 100644 index 4bab9e6..0000000 --- a/src/pins/pins_f7_stm32dvm_v5.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (C) 2019,2020 by BG5HHP - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PINS_F7_STM32DVM_V5_H -#define _PINS_F7_STM32DVM_V5_H - -/* -Pin definitions for STM32F7 STM32-DVM rev 5 Board: - -COS PB13 input -PTT PB12 output -COSLED PB4 output -LED PB3 output - -P25 PB8 output -NXDN PB9 output -DSTAR PB6 output -DMR PB5 output -YSF PB7 output -POCSAG PC10 output (Not Valid) -FM PB14 output - -RX PB0 analog input -RSSI PB1 analog input -TX PA4 analog output - -EXT_CLK PA15 input -*/ - -#define PIN_COS GPIO_Pin_13 -#define PORT_COS GPIOB -#define RCC_Per_COS RCC_AHB1Periph_GPIOB - -#define PIN_PTT GPIO_Pin_12 -#define PORT_PTT GPIOB -#define RCC_Per_PTT RCC_AHB1Periph_GPIOB - -#define PIN_COSLED GPIO_Pin_4 -#define PORT_COSLED GPIOB -#define RCC_Per_COSLED RCC_AHB1Periph_GPIOB - -#define PIN_LED GPIO_Pin_3 -#define PORT_LED GPIOB -#define RCC_Per_LED RCC_AHB1Periph_GPIOB - -#define PIN_P25 GPIO_Pin_8 -#define PORT_P25 GPIOB -#define RCC_Per_P25 RCC_AHB1Periph_GPIOB - -#define PIN_NXDN GPIO_Pin_9 -#define PORT_NXDN GPIOB -#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB - -#define PIN_DSTAR GPIO_Pin_6 -#define PORT_DSTAR GPIOB -#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOB - -#define PIN_DMR GPIO_Pin_5 -#define PORT_DMR GPIOB -#define RCC_Per_DMR RCC_AHB1Periph_GPIOB - -#define PIN_YSF GPIO_Pin_7 -#define PORT_YSF GPIOB -#define RCC_Per_YSF RCC_AHB1Periph_GPIOB - -/* -#define PIN_POCSAG GPIO_Pin_10 -#define PORT_POCSAG GPIOC -#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOC -*/ - -#define PIN_FM GPIO_Pin_14 -#define PORT_FM GPIOB -#define RCC_Per_FM RCC_AHB1Periph_GPIOB - -#define PIN_EXT_CLK GPIO_Pin_15 -#define SRC_EXT_CLK GPIO_PinSource15 -#define PORT_EXT_CLK GPIOA - -#define PIN_RX GPIO_Pin_0 -#define PIN_RX_CH ADC_Channel_8 -#define PORT_RX GPIOB -#define RCC_Per_RX RCC_AHB1Periph_GPIOB - -#define PIN_RSSI GPIO_Pin_1 -#define PIN_RSSI_CH ADC_Channel_9 -#define PORT_RSSI GPIOB -#define RCC_Per_RSSI RCC_AHB1Periph_GPIOB - -#define PIN_TX GPIO_Pin_4 -#define PIN_TX_CH DAC_Channel_1 - -#endif diff --git a/src/pins/pins_rb_v3_pi.h b/src/pins/pins_rb_v3_pi.h new file mode 100644 index 0000000..415fb31 --- /dev/null +++ b/src/pins/pins_rb_v3_pi.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2019,2020 by BG5HHP + * Copyright (C) 2024 by Jonathan Naylor, G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if !defined(_PINS_RB_V3_H) +#define _PINS_RB_V3_H + +/* +Pin definitions for Repeater Builder rev 3 Board: + +COS PB13 input +PTT PB12 output +COSLED PB4 output +LED PB3 output + +Mode LEDs +P25 PB8 output +NXDN PB9 output +DSTAR PB6 output +DMR PB5 output +YSF PB7 output +FM PB14 output + +Analogue input/output +RX PB0 analogue input +RSSI PB1 analogue input +TX PA4 analogue output + +Host communication +TXD PA9 +RXD PA10 + +Serial repeater +TXD PC12 +RXD PD2 +*/ + +#define PIN_COS PB13 + +#define PIN_PTT PB12 + +#define PIN_COSLED PB4 + +#define PIN_LED PB3 + +#define PIN_P25 PB8 + +#define PIN_NXDN PB9 + +#define PIN_DSTAR PB6 + +#define PIN_DMR PB5 + +#define PIN_YSF PB7 + +#define PIN_FM PB14 + +#define PIN_RX PB0 + +#define PIN_RSSI PB1 + +#define PIN_TX PA4 + +#define PIN_HOST_TXD PA9 + +#define PIN_HOST_RXD PA10 + +#define PIN_RPT_TXD PC12 + +#define PIN_RPT_RXD PD2 + +#endif diff --git a/src/pins/pins_rb_v5_pi.h b/src/pins/pins_rb_v5_pi.h new file mode 100644 index 0000000..cbd94e1 --- /dev/null +++ b/src/pins/pins_rb_v5_pi.h @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2019,2020 by BG5HHP + * Copyright (C) 2024 by Jonathan Naylor, G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if !defined(_PINS_RB_V5_H) +#define _PINS_RB_V5_H + +/* +Pin definitions for Repeater Builder rev 5 Board: + +COS PB13 input +PTT PB12 output +COSLED PB4 output +LED PB3 output + +Mode LEDs +P25 PB8 output +NXDN PB9 output +DSTAR PB6 output +DMR PB5 output +YSF PB7 output +FM PB14 output + +Analogue input/output +RX PB0 analogue input +RSSI PB1 analogue input +TX PA4 analogue output + +Host communication +TXD PA9 +RXD PA10 + +Serial repeater +TXD PC12 +RXD PD2 +*/ + + +#define PIN_COS PB13 + +#define PIN_PTT PB12 + +#define PIN_COSLED PB4 + +#define PIN_LED PB3 + +#define PIN_P25 PB8 + +#define PIN_NXDN PB9 + +#define PIN_DSTAR PB6 + +#define PIN_DMR PB5 + +#define PIN_YSF PB7 + +#define PIN_FM PB14 + +#define PIN_RX PB0 + +#define PIN_RSSI PB1 + +#define PIN_TX PA4 + +#define PIN_HOST_TXD PA9 + +#define PIN_HOST_RXD PA10 + +#define PIN_RPT_TXD PC12 + +#define PIN_RPT_RXD PD2 + +#endif diff --git a/src/pins/pins_zum_v09_pi.h b/src/pins/pins_zum_v09_pi.h new file mode 100644 index 0000000..dead2fc --- /dev/null +++ b/src/pins/pins_zum_v09_pi.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2019,2020 by BG5HHP + * Copyright (C) 2024 by Jonathan Naylor, G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if !defined(_PINS_ZUM_V09_PI_H) +#define _PINS_ZUM_V09_PI_H + +/* +Pin definitions for KI6ZUM v0.9 Pi Board: + +PTT PB13 output +COSLED PB14 output +LED PB15 output +COS PC0 input + +Mode LEDs +DSTAR PC7 output +DMR PC8 output +YSF PA8 output +P25 PC9 output +NXDN PB1 output +POCSAG PB12 output + +Analogue input/output +RX PA0 analogue input +RSSI PA7 analogue input +TX PA4 analogue output + +Host communication +TXD PA9 +RXD PA10 + +Serial repeater +TXD PC12 +RXD PD2 +*/ + +#define PIN_PTT PB13 + +#define PIN_COSLED PB14 + +#define PIN_LED PB15 + +#define PIN_COS PC0 + +#define PIN_DSTAR PC7 + +#define PIN_DMR PC8 + +#define PIN_YSF PA8 + +#define PIN_P25 PC9 + +#define PIN_NXDN PB1 + +#define PIN_POCSAG PB12 + +#define PIN_RX PA0 + +#define PIN_RSSI PA7 + +#define PIN_TX PA4 + +#define PIN_HOST_TXD PA9 + +#define PIN_HOST_RXD PA10 + +#define PIN_RPT_TXD PC12 + +#define PIN_RPT_RXD PD2 + +#endif diff --git a/src/pins/pins_zum_v10_pi.h b/src/pins/pins_zum_v10_pi.h new file mode 100644 index 0000000..a393422 --- /dev/null +++ b/src/pins/pins_zum_v10_pi.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2019,2020 by BG5HHP + * Copyright (C) 2024 by Jonathan Naylor, G4KLX + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#if !defined(_PINS_ZUM_V10_PI_H) +#define _PINS_ZUM_V10_PI_H + +/* +Pin definitions for KI6ZUM v1.0 Pi Board: + +PTT PB13 output +COSLED PB14 output +LED PB15 output +COS PC0 input + +Mode LEDs +DSTAR PC7 output +DMR PC8 output +YSF PA8 output +P25 PC9 output +NXDN PB1 output +POCSAG PB12 output + +Analogue input/output +RX PA0 analogue input +RSSI PA7 analogue input +TX PA4 analogue output + +Host communication +TXD PA9 +RXD PA10 + +Serial repeater +TXD PC12 +RXD PD2 +*/ + +#define PIN_PTT PB13 + +#define PIN_COSLED PB14 + +#define PIN_LED PB15 + +#define PIN_COS PC0 + +#define PIN_DSTAR PC7 + +#define PIN_DMR PC8 + +#define PIN_YSF PA8 + +#define PIN_P25 PC9 + +#define PIN_NXDN PB1 + +#define PIN_POCSAG PB12 + +#define PIN_RX PA0 + +#define PIN_RSSI PA7 + +#define PIN_TX PA4 + +#define PIN_HOST_TXD PA9 + +#define PIN_HOST_RXD PA10 + +#define PIN_RPT_TXD PC12 + +#define PIN_RPT_RXD PD2 + +#endif