mirror of
https://github.com/juribeparada/MMDVM_HS.git
synced 2025-12-06 07:12:08 +01:00
Compare commits
156 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
192cba3ecc | ||
|
|
f0586fdf74 | ||
|
|
5e6ac20a8a | ||
|
|
ba19e26630 | ||
|
|
3dfd2264ad | ||
|
|
a4948312e3 | ||
|
|
4d51976f6a | ||
|
|
d4cb546a7c | ||
|
|
931cfde894 | ||
|
|
0f3a4fa249 | ||
|
|
ab3c9a39a3 | ||
|
|
92597e0d00 | ||
|
|
023462a86d | ||
|
|
d408845f82 | ||
|
|
6fc189793d | ||
|
|
d9621c5c8b | ||
|
|
6781dec322 | ||
|
|
1908a0ee9a | ||
|
|
2ea38a3bfe | ||
|
|
36f607250a | ||
|
|
a80dc06ed6 | ||
|
|
800ec4fe14 | ||
|
|
e3cadb7f32 | ||
|
|
9498ef4e82 | ||
|
|
436cebb7a4 | ||
|
|
3fee6b47cd | ||
|
|
df3a140173 | ||
|
|
9a3e3704e2 | ||
|
|
5cbaf98d2d | ||
|
|
cf00e2f347 | ||
|
|
2f52282c47 | ||
|
|
4f1ed20d77 | ||
|
|
eb6b2cc2b2 | ||
|
|
138260fef7 | ||
|
|
08a6c21c17 | ||
|
|
6c4f2041cb | ||
|
|
0f7a64115d | ||
|
|
c9bd700100 | ||
|
|
d732807ee3 | ||
|
|
93d08d7703 | ||
|
|
1bfec1717e | ||
|
|
fb4c543211 | ||
|
|
cde5b19080 | ||
|
|
818a27d114 | ||
|
|
43732fbf3c | ||
|
|
743d0ca12f | ||
|
|
69d08790bd | ||
|
|
956ee1a81c | ||
|
|
dc2171bef7 | ||
|
|
3f83f671a3 | ||
|
|
fc9cb227f3 | ||
|
|
bb9fe7f561 | ||
|
|
89daa20476 | ||
|
|
506740ba49 | ||
|
|
5013e19a21 | ||
|
|
414ea06098 | ||
|
|
af1537dcdc | ||
|
|
f212b8974c | ||
|
|
9658d83dab | ||
|
|
4ce0878ca6 | ||
|
|
33510b6832 | ||
|
|
dcc23cf6fa | ||
|
|
6dbb436002 | ||
|
|
f74043a040 | ||
|
|
98895e5939 | ||
|
|
3c0c3abcc3 | ||
|
|
1210748cdb | ||
|
|
146e6fb3e6 | ||
|
|
bdb610e973 | ||
|
|
5fdf64d7d0 | ||
|
|
623d4bb351 | ||
|
|
ce0ad59bcc | ||
|
|
fb931db47f | ||
|
|
c1e279af7d | ||
|
|
754a9c6657 | ||
|
|
506a514d8b | ||
|
|
c4623c2890 | ||
|
|
3c63f30a08 | ||
|
|
8967348bcc | ||
|
|
c34f5d511d | ||
|
|
f96cd2af84 | ||
|
|
4669198c77 | ||
|
|
c909c2dbc5 | ||
|
|
c305359ce5 | ||
|
|
06e02d54f9 | ||
|
|
8e5e06de30 | ||
|
|
f26469737e | ||
|
|
279251d484 | ||
|
|
e1ef453979 | ||
|
|
97d270a1fe | ||
|
|
cc451c4036 | ||
|
|
7e924a21b6 | ||
|
|
3cdeb26aa0 | ||
|
|
fbeb5a39b7 | ||
|
|
e9b89208cc | ||
|
|
269f6b4358 | ||
|
|
6b751d595e | ||
|
|
6781fa5c8b | ||
|
|
3fd75cd177 | ||
|
|
88455a50dd | ||
|
|
139eb95b66 | ||
|
|
0ec39c32c5 | ||
|
|
8254f2233e | ||
|
|
1790bde635 | ||
|
|
8519f767c5 | ||
|
|
2fd7e6a978 | ||
|
|
d716321820 | ||
|
|
82d0f71ebb | ||
|
|
d0db461a56 | ||
|
|
5a45650c12 | ||
|
|
b2e79b2ea5 | ||
|
|
89fd1805a3 | ||
|
|
9fe7d1a2a1 | ||
|
|
91d0f939f3 | ||
|
|
8cf46cab92 | ||
|
|
6419cad878 | ||
|
|
ac75ffdb0f | ||
|
|
544576e98d | ||
|
|
54208aa317 | ||
|
|
ed487bcad4 | ||
|
|
c72f357f2c | ||
|
|
b401d06c1f | ||
|
|
2903847ac2 | ||
|
|
5932cc227b | ||
|
|
b7a6edef6d | ||
|
|
d50d0c070b | ||
|
|
8d77ff32cf | ||
|
|
e042c0c777 | ||
|
|
a9fed35d1c | ||
|
|
6183d00264 | ||
|
|
7bdef738b2 | ||
|
|
dec70516c3 | ||
|
|
0e8783c533 | ||
|
|
6add9c540d | ||
|
|
1aab7ec355 | ||
|
|
c45a7cf38f | ||
|
|
e0332c4efa | ||
|
|
3284a72feb | ||
|
|
8d55079058 | ||
|
|
77c988c21d | ||
|
|
2b53c86277 | ||
|
|
5834da83d8 | ||
|
|
03f276db2c | ||
|
|
7020510f2e | ||
|
|
bc48446e77 | ||
|
|
943df053a9 | ||
|
|
b0ab167f03 | ||
|
|
a0b9ae8142 | ||
|
|
45fc69cee5 | ||
|
|
b9fd0b1233 | ||
|
|
ad2df94a46 | ||
|
|
3fbeee3c3b | ||
|
|
ceb6a4d07a | ||
|
|
2e3f304d2e | ||
|
|
96e0a368b9 | ||
|
|
6c64ef1336 |
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,3 +5,4 @@ bin/
|
|||
|
||||
GitVersion\.h
|
||||
|
||||
.vscode/
|
||||
|
|
|
|||
151
ADF7021.cpp
151
ADF7021.cpp
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2020,2021 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017 by Danilo DB4PLE
|
||||
*
|
||||
* Some of the code is based on work of Guus Van Dooren PE1PLM:
|
||||
|
|
@ -48,13 +49,12 @@ uint16_t m_dmrDev;
|
|||
uint16_t m_ysfDev;
|
||||
uint16_t m_p25Dev;
|
||||
uint16_t m_nxdnDev;
|
||||
uint16_t m_m17Dev;
|
||||
uint16_t m_pocsagDev;
|
||||
|
||||
static void Send_AD7021_control_shift()
|
||||
{
|
||||
int AD7021_counter;
|
||||
|
||||
for(AD7021_counter = 31; AD7021_counter >= 0; AD7021_counter--) {
|
||||
for (int AD7021_counter = 31; AD7021_counter >= 0; AD7021_counter--) {
|
||||
if (bitRead(AD7021_control_word, AD7021_counter) == HIGH)
|
||||
io.SDATA_pin(HIGH);
|
||||
else
|
||||
|
|
@ -65,6 +65,7 @@ static void Send_AD7021_control_shift()
|
|||
io.dlybit();
|
||||
io.SCLK_pin(LOW);
|
||||
}
|
||||
|
||||
// to keep SDATA signal at defined level when idle (not required)
|
||||
io.SDATA_pin(LOW);
|
||||
}
|
||||
|
|
@ -80,10 +81,9 @@ void Send_AD7021_control(bool doSle)
|
|||
{
|
||||
Send_AD7021_control_shift();
|
||||
|
||||
if (doSle) {
|
||||
if (doSle)
|
||||
Send_AD7021_control_slePulse();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DUPLEX)
|
||||
static void Send_AD7021_control_sle2Pulse()
|
||||
|
|
@ -97,10 +97,9 @@ void Send_AD7021_control2(bool doSle)
|
|||
{
|
||||
Send_AD7021_control_shift();
|
||||
|
||||
if (doSle) {
|
||||
if (doSle)
|
||||
Send_AD7021_control_sle2Pulse();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
|
|
@ -108,14 +107,13 @@ uint16_t CIO::readRSSI()
|
|||
{
|
||||
uint32_t AD7021_RB;
|
||||
uint16_t RB_word = 0U;
|
||||
int AD7021_counter;
|
||||
uint8_t RB_code, gain_code, gain_corr;
|
||||
|
||||
// Register 7, readback enable, ADC RSSI mode
|
||||
AD7021_RB = 0x0147;
|
||||
|
||||
// Send control register
|
||||
for(AD7021_counter = 8; AD7021_counter >= 0; AD7021_counter--) {
|
||||
for (int AD7021_counter = 8; AD7021_counter >= 0; AD7021_counter--) {
|
||||
if (bitRead(AD7021_RB, AD7021_counter) == HIGH)
|
||||
SDATA_pin(HIGH);
|
||||
else
|
||||
|
|
@ -128,11 +126,20 @@ uint16_t CIO::readRSSI()
|
|||
}
|
||||
|
||||
SDATA_pin(LOW);
|
||||
|
||||
#if defined(DUPLEX)
|
||||
if (m_duplex || m_calState == STATE_RSSICAL)
|
||||
SLE2_pin(HIGH);
|
||||
else
|
||||
SLE_pin(HIGH);
|
||||
#else
|
||||
SLE_pin(HIGH);
|
||||
#endif
|
||||
|
||||
dlybit();
|
||||
|
||||
// Read SREAD pin
|
||||
for(AD7021_counter = 17; AD7021_counter >= 0; AD7021_counter--) {
|
||||
for (int AD7021_counter = 17; AD7021_counter >= 0; AD7021_counter--) {
|
||||
SCLK_pin(HIGH);
|
||||
dlybit();
|
||||
|
||||
|
|
@ -141,10 +148,16 @@ uint16_t CIO::readRSSI()
|
|||
|
||||
SCLK_pin(LOW);
|
||||
dlybit();
|
||||
|
||||
}
|
||||
|
||||
#if defined(DUPLEX)
|
||||
if (m_duplex || m_calState == STATE_RSSICAL)
|
||||
SLE2_pin(LOW);
|
||||
else
|
||||
SLE_pin(LOW);
|
||||
#else
|
||||
SLE_pin(LOW);
|
||||
#endif
|
||||
|
||||
// Process RSSI code
|
||||
RB_code = RB_word & 0x7f;
|
||||
|
|
@ -200,6 +213,10 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
m_frequency_rx = m_pocsag_freq_tx;
|
||||
}
|
||||
|
||||
#if defined (ZUMSPOT_ADF7021) || defined(SKYBRIDGE_HS)
|
||||
io.checkBand(m_frequency_rx, m_frequency_tx);
|
||||
#endif
|
||||
|
||||
// Toggle CE pin for ADF7021 reset
|
||||
if (reset) {
|
||||
CE_pin(LOW);
|
||||
|
|
@ -212,20 +229,16 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
if ((m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_VHF1; // VHF1, external VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
else if( (m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX) ) {
|
||||
} else if ((m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_VHF2; // VHF1, external VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
else if( (m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX) ) {
|
||||
} else if ((m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
else if( (m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX) ) {
|
||||
} else if ((m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_UHF2; // UHF2, internal VCO
|
||||
div2 = 2U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
|
|
@ -253,6 +266,9 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
case STATE_NXDN:
|
||||
AFC_OFFSET = AFC_OFFSET_NXDN;
|
||||
break;
|
||||
case STATE_M17:
|
||||
AFC_OFFSET = AFC_OFFSET_M17;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -399,7 +415,7 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
break;
|
||||
|
||||
case STATE_YSF:
|
||||
// Dev: +1 symb 900 Hz, symb rate = 4800
|
||||
// Dev: +1 symb 900/450 Hz, symb rate = 4800
|
||||
|
||||
ADF7021_REG3 = (m_LoDevYSF ? ADF7021_REG3_YSF_L : ADF7021_REG3_YSF_H);
|
||||
ADF7021_REG10 = ADF7021_REG10_YSF;
|
||||
|
|
@ -479,6 +495,33 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
#endif
|
||||
break;
|
||||
|
||||
case STATE_M17:
|
||||
// Dev: +1 symb 800 Hz, symb rate = 4800
|
||||
|
||||
ADF7021_REG3 = ADF7021_REG3_M17;
|
||||
ADF7021_REG10 = ADF7021_REG10_M17;
|
||||
|
||||
// K=32
|
||||
ADF7021_REG4 = (uint32_t) 0b0100 << 0; // register 4
|
||||
ADF7021_REG4 |= (uint32_t) 0b011 << 4; // mode, 4FSK
|
||||
ADF7021_REG4 |= (uint32_t) 0b0 << 7;
|
||||
ADF7021_REG4 |= (uint32_t) 0b11 << 8;
|
||||
ADF7021_REG4 |= (uint32_t) ADF7021_DISC_BW_M17 << 10; // Disc BW
|
||||
ADF7021_REG4 |= (uint32_t) ADF7021_POST_BW_M17 << 20; // Post dem BW
|
||||
ADF7021_REG4 |= (uint32_t) 0b10 << 30; // IF filter (25 kHz)
|
||||
|
||||
ADF7021_REG13 = (uint32_t) 0b1101 << 0; // register 13
|
||||
ADF7021_REG13 |= (uint32_t) ADF7021_SLICER_TH_M17 << 4; // slicer threshold
|
||||
|
||||
ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5)
|
||||
ADF7021_REG2 |= (uint32_t) (m_m17Dev / div2) << 19; // deviation
|
||||
#if defined(ADF7021_DISABLE_RC_4FSK)
|
||||
ADF7021_REG2 |= (uint32_t) 0b011 << 4; // modulation (4FSK)
|
||||
#else
|
||||
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -633,7 +676,7 @@ void CIO::ifConf2(MMDVM_STATE modemState)
|
|||
break;
|
||||
|
||||
case STATE_YSF:
|
||||
// Dev: +1 symb 900 Hz, symb rate = 4800
|
||||
// Dev: +1 symb 900/450 Hz, symb rate = 4800
|
||||
|
||||
ADF7021_REG3 = (m_LoDevYSF ? ADF7021_REG3_YSF_L : ADF7021_REG3_YSF_H);
|
||||
ADF7021_REG10 = ADF7021_REG10_YSF;
|
||||
|
|
@ -701,6 +744,29 @@ void CIO::ifConf2(MMDVM_STATE modemState)
|
|||
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
|
||||
break;
|
||||
|
||||
case STATE_M17:
|
||||
// Dev: +1 symb 800 Hz, symb rate = 4800
|
||||
|
||||
ADF7021_REG3 = ADF7021_REG3_M17;
|
||||
ADF7021_REG10 = ADF7021_REG10_M17;
|
||||
|
||||
// K=32
|
||||
ADF7021_REG4 = (uint32_t) 0b0100 << 0; // register 4
|
||||
ADF7021_REG4 |= (uint32_t) 0b011 << 4; // mode, 4FSK
|
||||
ADF7021_REG4 |= (uint32_t) 0b0 << 7;
|
||||
ADF7021_REG4 |= (uint32_t) 0b11 << 8;
|
||||
ADF7021_REG4 |= (uint32_t) ADF7021_DISC_BW_M17 << 10; // Disc BW
|
||||
ADF7021_REG4 |= (uint32_t) ADF7021_POST_BW_M17 << 20; // Post dem BW
|
||||
ADF7021_REG4 |= (uint32_t) 0b10 << 30; // IF filter (25 kHz)
|
||||
|
||||
ADF7021_REG13 = (uint32_t) 0b1101 << 0; // register 13
|
||||
ADF7021_REG13 |= (uint32_t) ADF7021_SLICER_TH_M17 << 4; // slicer threshold
|
||||
|
||||
ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5)
|
||||
ADF7021_REG2 |= (uint32_t) (m_m17Dev / div2) << 19; // deviation
|
||||
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -787,15 +853,13 @@ void CIO::interrupt()
|
|||
// possibly this is a design problem of the RF7021 board or too long wires
|
||||
// on the breadboard build
|
||||
// but normally this will not hurt too much
|
||||
if (clk == last_clk) {
|
||||
if (clk == last_clk)
|
||||
return;
|
||||
} else {
|
||||
else
|
||||
last_clk = clk;
|
||||
}
|
||||
|
||||
// we set the TX bit at TXD low, sampling of ADF7021 happens at rising clock
|
||||
if (m_tx && clk == 0U) {
|
||||
|
||||
m_txBuffer.get(bit, m_control);
|
||||
even = !even;
|
||||
|
||||
|
|
@ -845,7 +909,7 @@ void CIO::interrupt()
|
|||
m_rxBuffer.put(bit, m_control);
|
||||
}
|
||||
|
||||
if (torx_request == true && even == ADF7021_EVEN_BIT && m_tx && clk == 0U) {
|
||||
if (torx_request && even == ADF7021_EVEN_BIT && m_tx && clk == 0U) {
|
||||
// that is absolutely crucial in 4FSK, see datasheet:
|
||||
// enable sle after 1/4 tBit == 26uS when sending MSB (even == false) and clock is low
|
||||
delay_us(26U);
|
||||
|
|
@ -869,6 +933,7 @@ void CIO::interrupt()
|
|||
|
||||
m_watchdog++;
|
||||
m_modeTimerCnt++;
|
||||
m_int1counter++;
|
||||
|
||||
if (m_scanPauseCnt >= SCAN_PAUSE)
|
||||
m_scanPauseCnt = 0U;
|
||||
|
|
@ -890,6 +955,8 @@ void CIO::interrupt2()
|
|||
|
||||
m_rxBuffer.put(bit, m_control);
|
||||
}
|
||||
|
||||
m_int2counter++;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -936,7 +1003,7 @@ void CIO::setPower(uint8_t power)
|
|||
m_power = power >> 2;
|
||||
}
|
||||
|
||||
void CIO::setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t pocsagTXLevel, bool ysfLoDev)
|
||||
void CIO::setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t m17TXLevel, uint8_t pocsagTXLevel, bool ysfLoDev)
|
||||
{
|
||||
m_dstarDev = uint16_t((ADF7021_DEV_DSTAR * uint16_t(dstarTXLevel)) / 128U);
|
||||
m_dmrDev = uint16_t((ADF7021_DEV_DMR * uint16_t(dmrTXLevel)) / 128U);
|
||||
|
|
@ -948,6 +1015,7 @@ void CIO::setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXL
|
|||
|
||||
m_p25Dev = uint16_t((ADF7021_DEV_P25 * uint16_t(p25TXLevel)) / 128U);
|
||||
m_nxdnDev = uint16_t((ADF7021_DEV_NXDN * uint16_t(nxdnTXLevel)) / 128U);
|
||||
m_m17Dev = uint16_t((ADF7021_DEV_M17 * uint16_t(m17TXLevel)) / 128U);
|
||||
m_pocsagDev = uint16_t((ADF7021_DEV_POCSAG * uint16_t(pocsagTXLevel)) / 128U);
|
||||
}
|
||||
|
||||
|
|
@ -960,20 +1028,16 @@ void CIO::updateCal()
|
|||
if ((m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_VHF1; // VHF1, external VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
else if( (m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX) ) {
|
||||
} else if ((m_frequency_tx >= VHF2_MIN) && (m_frequency_tx < VHF2_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_VHF2; // VHF1, external VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
else if( (m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX) ) {
|
||||
} else if ((m_frequency_tx >= UHF1_MIN)&&(m_frequency_tx < UHF1_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
else if( (m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX) ) {
|
||||
} else if ((m_frequency_tx >= UHF2_MIN)&&(m_frequency_tx < UHF2_MAX)) {
|
||||
ADF7021_REG1 = ADF7021_REG1_UHF2; // UHF2, internal VCO
|
||||
div2 = 2U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ADF7021_REG1 = ADF7021_REG1_UHF1; // UHF1, internal VCO
|
||||
div2 = 1U;
|
||||
}
|
||||
|
|
@ -988,8 +1052,15 @@ void CIO::updateCal()
|
|||
Send_AD7021_control();
|
||||
|
||||
ADF7021_REG2 = (uint32_t) 0b10 << 28; // invert data (and RC alpha = 0.5)
|
||||
ADF7021_REG2 |= (uint32_t) (m_dmrDev / div2) << 19; // deviation
|
||||
|
||||
if (m_modemState == STATE_DMR) {
|
||||
ADF7021_REG2 |= (uint32_t) (m_dmrDev / div2) << 19; // DMR deviation
|
||||
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
|
||||
} else if (m_modemState == STATE_POCSAG) {
|
||||
ADF7021_REG2 |= (uint32_t) (m_pocsagDev / div2) << 19; // POCSAG deviation
|
||||
ADF7021_REG2 |= (uint32_t) 0b000 << 4; // modulation (2FSK)
|
||||
}
|
||||
|
||||
ADF7021_REG2 |= (uint32_t) 0b0010; // register 2
|
||||
ADF7021_REG2 |= (uint32_t) m_power << 13; // power level
|
||||
ADF7021_REG2 |= (uint32_t) 0b110001 << 7; // PA
|
||||
|
|
@ -1060,6 +1131,11 @@ uint16_t CIO::devNXDN()
|
|||
return (uint16_t)((ADF7021_PFD * m_nxdnDev) / (f_div * 65536));
|
||||
}
|
||||
|
||||
uint16_t CIO::devM17()
|
||||
{
|
||||
return (uint16_t)((ADF7021_PFD * m_m17Dev) / (f_div * 65536));
|
||||
}
|
||||
|
||||
uint16_t CIO::devPOCSAG()
|
||||
{
|
||||
return (uint16_t)((ADF7021_PFD * m_pocsagDev) / (f_div * 65536));
|
||||
|
|
@ -1076,6 +1152,7 @@ void CIO::printConf()
|
|||
DEBUG2("YSF +1 sym dev (Hz):", devYSF());
|
||||
DEBUG2("P25 +1 sym dev (Hz):", devP25());
|
||||
DEBUG2("NXDN +1 sym dev (Hz):", devNXDN());
|
||||
DEBUG2("M17 +1 sym dev (Hz):", devM17());
|
||||
DEBUG2("POCSAG dev (Hz):", devPOCSAG());
|
||||
}
|
||||
|
||||
|
|
|
|||
29
ADF7021.h
29
ADF7021.h
|
|
@ -1,4 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017 by Danilo DB4PLE
|
||||
|
|
@ -52,7 +53,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
// Support for ADF7021-N version:
|
||||
// #define ADF7021_N_VER
|
||||
|
||||
// Enable AFC support for DMR, YSF and P25 (experimental):
|
||||
// Enable AFC support for DMR, YSF, P25, and M17 (experimental):
|
||||
// (AFC is already enabled by default in D-Star)
|
||||
// #define ADF7021_ENABLE_4FSK_AFC
|
||||
|
||||
|
|
@ -65,7 +66,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
// R = 4
|
||||
// DEMOD_CLK = 2.4576 MHz (DSTAR)
|
||||
// DEMOD_CLK = 4.9152 MHz (DMR, YSF_L, P25)
|
||||
// DEMOD_CLK = 7.3728 MHz (YSF_H)
|
||||
// DEMOD_CLK = 7.3728 MHz (YSF_H, M17)
|
||||
// DEMOD CLK = 3.6864 MHz (NXDN)
|
||||
// DEMOD_CLK = 7.3728 MHz (POCSAG)
|
||||
#define ADF7021_PFD 3686400.0
|
||||
|
|
@ -87,6 +88,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_DEV_P25 22U
|
||||
#endif
|
||||
#define ADF7021_DEV_NXDN 13U
|
||||
#define ADF7021_DEV_M17 28U
|
||||
#define ADF7021_DEV_POCSAG 160U
|
||||
|
||||
// TX/RX CLOCK register (REG 03)
|
||||
|
|
@ -97,12 +99,14 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_REG3_YSF_H 0x2A4C0493
|
||||
#define ADF7021_REG3_P25 0x2A4C04D3
|
||||
#define ADF7021_REG3_NXDN 0x2A4C04D3
|
||||
#define ADF7021_REG3_M17 0x2A4C04D3
|
||||
#else
|
||||
#define ADF7021_REG3_DMR 0x2A4C80D3
|
||||
#define ADF7021_REG3_YSF_L 0x2A4C80D3
|
||||
#define ADF7021_REG3_YSF_H 0x2A4CC093
|
||||
#define ADF7021_REG3_P25 0x2A4C80D3
|
||||
#define ADF7021_REG3_NXDN 0x2A4CC113
|
||||
#define ADF7021_REG3_M17 0x2A4CC093
|
||||
#endif
|
||||
#define ADF7021_REG3_POCSAG 0x2A4F0093
|
||||
|
||||
|
|
@ -114,6 +118,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_DISC_BW_YSF_H 516U // K=28
|
||||
#define ADF7021_DISC_BW_P25 394U // K=32
|
||||
#define ADF7021_DISC_BW_NXDN 295U // K=32
|
||||
#define ADF7021_DISC_BW_M17 590U // K=32
|
||||
#define ADF7021_DISC_BW_POCSAG 406U // K=22
|
||||
|
||||
// Post demodulator bandwith (REG 04)
|
||||
|
|
@ -122,6 +127,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_POST_BW_YSF 20U
|
||||
#define ADF7021_POST_BW_P25 6U
|
||||
#define ADF7021_POST_BW_NXDN 7U
|
||||
#define ADF7021_POST_BW_M17 7U // Test
|
||||
#define ADF7021_POST_BW_POCSAG 1U
|
||||
|
||||
// IF filter (REG 05)
|
||||
|
|
@ -139,26 +145,31 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_REG10_YSF 0x01FE473A
|
||||
#define ADF7021_REG10_P25 0x01FE473A
|
||||
#define ADF7021_REG10_NXDN 0x01FE473A
|
||||
#define ADF7021_REG10_M17 0x01FE473A
|
||||
#if defined(ADF7021_AFC_POS)
|
||||
#define AFC_OFFSET_DMR -250
|
||||
#define AFC_OFFSET_YSF -250
|
||||
#define AFC_OFFSET_P25 -250
|
||||
#define AFC_OFFSET_NXDN -250
|
||||
#define AFC_OFFSET_M17 -250
|
||||
#else
|
||||
#define AFC_OFFSET_DMR 250
|
||||
#define AFC_OFFSET_YSF 250
|
||||
#define AFC_OFFSET_P25 250
|
||||
#define AFC_OFFSET_NXDN 250
|
||||
#define AFC_OFFSET_M17 250
|
||||
#endif
|
||||
#else
|
||||
#define ADF7021_REG10_DMR 0x049E472A
|
||||
#define ADF7021_REG10_YSF 0x049E472A
|
||||
#define ADF7021_REG10_P25 0x049E472A
|
||||
#define ADF7021_REG10_NXDN 0x049E472A
|
||||
#define ADF7021_REG10_M17 0x049E472A
|
||||
#define AFC_OFFSET_DMR 0
|
||||
#define AFC_OFFSET_YSF 0
|
||||
#define AFC_OFFSET_P25 0
|
||||
#define AFC_OFFSET_NXDN 0
|
||||
#define AFC_OFFSET_M17 0
|
||||
#endif
|
||||
|
||||
/****** Support for 12.2880 MHz TCXO ******/
|
||||
|
|
@ -166,7 +177,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
|
||||
// R = 2
|
||||
// DEMOD_CLK = 2.4576 MHz (DSTAR)
|
||||
// DEMOD_CLK = 6.1440 MHz (DMR, YSF_H, YSF_L, P25)
|
||||
// DEMOD_CLK = 6.1440 MHz (DMR, YSF_H, YSF_L, P25, M17)
|
||||
// DEMOD_CLK = 3.0720 MHz (NXDN)
|
||||
// DEMOD_CLK = 6.1440 MHz (POCSAG)
|
||||
#define ADF7021_PFD 6144000.0
|
||||
|
|
@ -188,6 +199,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_DEV_P25 13U
|
||||
#endif
|
||||
#define ADF7021_DEV_NXDN 8U
|
||||
#define ADF7021_DEV_M17 17U
|
||||
#define ADF7021_DEV_POCSAG 96U
|
||||
|
||||
// TX/RX CLOCK register (REG 03)
|
||||
|
|
@ -198,12 +210,14 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_REG3_YSF_H 0x29EC0493
|
||||
#define ADF7021_REG3_P25 0x29EC0493
|
||||
#define ADF7021_REG3_NXDN 0x29EC0493
|
||||
#define ADF7021_REG3_M17 0x29EC0493
|
||||
#else
|
||||
#define ADF7021_REG3_DMR 0x29ECA093
|
||||
#define ADF7021_REG3_YSF_L 0x29ECA093
|
||||
#define ADF7021_REG3_YSF_H 0x29ECA093
|
||||
#define ADF7021_REG3_P25 0x29ECA093
|
||||
#define ADF7021_REG3_NXDN 0x29ECA113
|
||||
#define ADF7021_REG3_M17 0x29ECA093
|
||||
#endif
|
||||
#define ADF7021_REG3_POCSAG 0x29EE8093
|
||||
|
||||
|
|
@ -215,6 +229,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_DISC_BW_YSF_H 430U // K=28
|
||||
#define ADF7021_DISC_BW_P25 493U // K=32
|
||||
#define ADF7021_DISC_BW_NXDN 246U // K=32
|
||||
#define ADF7021_DISC_BW_M17 492U // K=32
|
||||
#define ADF7021_DISC_BW_POCSAG 338U // K=22
|
||||
|
||||
// Post demodulator bandwith (REG 04)
|
||||
|
|
@ -223,6 +238,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_POST_BW_YSF 20U
|
||||
#define ADF7021_POST_BW_P25 6U
|
||||
#define ADF7021_POST_BW_NXDN 8U
|
||||
#define ADF7021_POST_BW_M17 8U // Test
|
||||
#define ADF7021_POST_BW_POCSAG 1U
|
||||
|
||||
// IF filter (REG 05)
|
||||
|
|
@ -240,26 +256,31 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_REG10_YSF 0x01FE557A
|
||||
#define ADF7021_REG10_P25 0x01FE557A
|
||||
#define ADF7021_REG10_NXDN 0x01FE557A
|
||||
#define ADF7021_REG10_M17 0x01FE557A
|
||||
#if defined(ADF7021_AFC_POS)
|
||||
#define AFC_OFFSET_DMR -250
|
||||
#define AFC_OFFSET_YSF -250
|
||||
#define AFC_OFFSET_P25 -250
|
||||
#define AFC_OFFSET_NXDN -250
|
||||
#define AFC_OFFSET_M17 -250
|
||||
#else
|
||||
#define AFC_OFFSET_DMR 250
|
||||
#define AFC_OFFSET_YSF 250
|
||||
#define AFC_OFFSET_P25 250
|
||||
#define AFC_OFFSET_NXDN 250
|
||||
#define AFC_OFFSET_M17 250
|
||||
#endif
|
||||
#else
|
||||
#define ADF7021_REG10_DMR 0x049E556A
|
||||
#define ADF7021_REG10_YSF 0x049E556A
|
||||
#define ADF7021_REG10_P25 0x049E556A
|
||||
#define ADF7021_REG10_NXDN 0x049E556A
|
||||
#define ADF7021_REG10_M17 0x049E556A
|
||||
#define AFC_OFFSET_DMR 0
|
||||
#define AFC_OFFSET_YSF 0
|
||||
#define AFC_OFFSET_P25 0
|
||||
#define AFC_OFFSET_NXDN 0
|
||||
#define AFC_OFFSET_M17 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -273,6 +294,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_SLICER_TH_YSF_H 69U
|
||||
#define ADF7021_SLICER_TH_P25 43U
|
||||
#define ADF7021_SLICER_TH_NXDN 26U
|
||||
#define ADF7021_SLICER_TH_M17 59U // Test
|
||||
|
||||
#else
|
||||
|
||||
|
|
@ -282,6 +304,7 @@ www.analog.com/media/en/technical-documentation/data-sheets/ADF7021.pdf
|
|||
#define ADF7021_SLICER_TH_YSF_H 75U
|
||||
#define ADF7021_SLICER_TH_P25 47U
|
||||
#define ADF7021_SLICER_TH_NXDN 26U
|
||||
#define ADF7021_SLICER_TH_M17 59U // Test
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
100
BUILD.md
100
BUILD.md
|
|
@ -169,23 +169,19 @@ Install the USB bootloader to STM32F103. Follow the instructions:
|
|||
|
||||
https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/stm32duino-bootloader
|
||||
|
||||
Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file
|
||||
(you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation):
|
||||
Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file (you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation):
|
||||
|
||||
My Documents/Arduino/hardware/Arduino_STM32/drivers/win/install_drivers.bat
|
||||
|
||||
You have to be sure that Windows detect your ZUMspot as an USB serial device COMx (please
|
||||
see Windows Device Manager).
|
||||
You have to be sure that Windows detect your ZUMspot as an USB serial device COMx (please see Windows Device Manager).
|
||||
|
||||
Download the source (zip file) of MMDVM_HS from:
|
||||
|
||||
https://github.com/juribeparada/MMDVM_HS
|
||||
|
||||
Do not download or install the STM32F103 library (STM32F10X_Lib) this is not necessary
|
||||
under STM32duino.
|
||||
Do not download or install the STM32F103 library (STM32F10X_Lib) this is not necessary under STM32duino.
|
||||
|
||||
Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this
|
||||
folder can't have spaces.
|
||||
Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this folder can't have spaces.
|
||||
|
||||
Start the Arduino IDE. Open the MMDVM_HS.ino file in the MMDVM_HS folder.
|
||||
|
||||
|
|
@ -207,9 +203,7 @@ Edit Config.h:
|
|||
|
||||
Click the Upload button in the IDE and wait for the transfer.
|
||||
|
||||
Once the transfer is completed, press the RESET button of the board or disconnect and
|
||||
connect the USB cable. You will see the LED (PC13) of the blue pill blinking. Once you connect
|
||||
with MMDVMHost, the LED will blink fast.
|
||||
Once the transfer is completed, press the RESET button of the board or disconnect and connect the USB cable. You will see the LED (PC13) of the blue pill blinking. Once you connect with MMDVMHost, the LED will blink fast.
|
||||
|
||||
For further help with STM32duino and STM32F103 blue pill boards, please see the STM32duino [forum](http://www.stm32duino.com).
|
||||
|
||||
|
|
@ -219,29 +213,25 @@ Download the source code (zip file) of MMDVM_HS from:
|
|||
|
||||
https://github.com/juribeparada/MMDVM_HS
|
||||
|
||||
Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this
|
||||
folder can't have spaces.
|
||||
Unzip MMDVM_HS-master.zip and change the folder name to "MMDVM_HS". The path name to this folder can't have spaces.
|
||||
|
||||
Download the ST libraries STM32F10X_Lib-master.zip from:
|
||||
|
||||
https://github.com/juribeparada/STM32F10X_Lib/
|
||||
|
||||
Extract the STM32F10X_Lib-master folder into the same folder as the MMDVM_HS. Change the folder
|
||||
name to "STM32F10X_Lib".
|
||||
Extract the STM32F10X_Lib-master folder into the same folder as the MMDVM_HS. Change the folder name to "STM32F10X_Lib".
|
||||
|
||||
Download the GNU make utility:
|
||||
|
||||
http://gnuwin32.sourceforge.net/packages/make.htm
|
||||
|
||||
Download the binaries zip file and extract make.exe and put it in the same directory MMDVM_HS. Download
|
||||
the dependencies zip file and extract libintl3.dll and libiconv2.dll and put them in the same directory MMDVM_HS.
|
||||
Download the binaries zip file and extract make.exe and put it in the same directory MMDVM_HS. Download the dependencies zip file and extract libintl3.dll and libiconv2.dll and put them in the same directory MMDVM_HS.
|
||||
|
||||
Download the GNU ARM embedded toolchain from here:
|
||||
|
||||
https://launchpad.net/gcc-arm-embedded/+download
|
||||
|
||||
Currently the direct link to the installer is here:
|
||||
|
||||
https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-win32.exe
|
||||
|
||||
Download STM32duino (Arduino for STM32) from this URL (only for USB drivers):
|
||||
|
|
@ -252,8 +242,7 @@ Unzip and copy Arduino_STM32-ZUMspot folder in (for example):
|
|||
|
||||
C:\Arduino_STM32-ZUMspot
|
||||
|
||||
Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file
|
||||
(you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation):
|
||||
Connect the ZUMspot Libre Kit to your PC. Install the USB Mapple driver using the bat file (you may also check http://wiki.stm32duino.com/index.php?title=Windows_driver_installation):
|
||||
|
||||
C:\Arduino_STM32-ZUMspot\drivers\win\install_drivers.bat
|
||||
|
||||
|
|
@ -321,9 +310,7 @@ If you are using Pi-Star, stop services:
|
|||
sudo systemctl stop mmdvmhost.timer
|
||||
sudo systemctl stop mmdvmhost.service
|
||||
|
||||
Upload bootloader and firmware to ZUMspot Libre Kit, using serial port first (you
|
||||
are using an USB-serial converter with device name /dev/ttyUSB0). Move BOOT0
|
||||
jumper to 1, next press and release RESET and execute:
|
||||
Upload bootloader and firmware to ZUMspot Libre Kit, using serial port first (you are using an USB-serial converter with device name /dev/ttyUSB0). Move BOOT0 jumper to 1, next press and release RESET and execute:
|
||||
|
||||
sudo make serial-bl devser=/dev/ttyUSB0
|
||||
|
||||
|
|
@ -496,25 +483,39 @@ Please check here for detailed instructions:
|
|||
|
||||
- make mmdvm_hs_hat: upload the firmware to MMDVM_HS_Hat board (using internal RPi serial port)
|
||||
|
||||
- make dfu [devser=/dev/ttyXXX]: upload firmware using USB bootloader. "devser" is optional,
|
||||
and it corresponds to the USB serial port device name. This option permits to perform a reset
|
||||
to enter to booloader mode (DFU). If you don't use "devser", you have to press the reset button
|
||||
of the ZUMspot just before using this command.
|
||||
- make nano-hotspot: upload the firmware to Nano hotSPOT board (using internal serial port)
|
||||
|
||||
- make nano-dv: upload the firmware to NanoDV board (using internal serial port)
|
||||
|
||||
- make d2rg_mmdvm_hs: upload the firmware to D2RG MMDVM_HS board (using internal serial port)
|
||||
|
||||
- make skybridge: upload the firmware to SkyBridge HotSpot board (using internal serial port)
|
||||
|
||||
- make dfu [devser=/dev/ttyXXX]: upload firmware using USB bootloader. "devser" is optional, and it corresponds to the USB serial port device name. This option permits to perform a reset to enter to booloader mode (DFU). If you don't use "devser", you have to press the reset button of the ZUMspot just before using this command.
|
||||
|
||||
- make serial devser=/dev/ttyXXX: upload standard firmware using serial port bootloader method.
|
||||
|
||||
- make serial-bl devser=/dev/ttyXXX: upload firmware with USB bootloader support using serial
|
||||
port bootloader method.
|
||||
- make serial-bl devser=/dev/ttyXXX: upload firmware with USB bootloader support using serial port bootloader method.
|
||||
|
||||
- make serial-nobl devser=/dev/ttyXXX: upload firmware with USB support using serial port bootloader method, but without USB bootloader installation.
|
||||
|
||||
- make serial-bl-old devser=/dev/ttyXXX: same as "make serial-bl" but using bootloader with short reset pulse.
|
||||
|
||||
- make stlink: upload standard firmware using ST-Link interface.
|
||||
|
||||
- make stlink-bl: upload firmware with USB bootloader support using ST-Link interface.
|
||||
|
||||
- make ocd: upload standard firmware using ST-Link interface. This method uses a local
|
||||
openocd installation.
|
||||
- make stlink-nobl: upload firmware with USB support using ST-Link interface, but without USB bootloader.
|
||||
|
||||
- make ocd-bl: upload firmware with USB bootloader support using ST-Link interface. This
|
||||
method uses a local openocd installation.
|
||||
- make stlink-bl-old: same as "make stlink-bl" but using bootloader with short reset pulse.
|
||||
|
||||
- make ocd: upload standard firmware using ST-Link interface. This method uses a local openocd installation.
|
||||
|
||||
- make ocd-nobl: upload firmware with USB support using ST-Link interface, but without USB bootloader. This method uses a local openocd installation.
|
||||
|
||||
- make ocd-bl: upload firmware with USB bootloader support using ST-Link interface. This method uses a local openocd installation.
|
||||
|
||||
- make ocd-bl-old: same as "make ocd-bl" but using bootloader with short reset pulse.
|
||||
|
||||
## Common Makefile commands
|
||||
|
||||
|
|
@ -539,11 +540,9 @@ ZUMspot RPi (no USB support needed):
|
|||
|
||||
# Config.h options
|
||||
|
||||
- #define ZUMSPOT_ADF7021: enable pinouts support for ZUMspot RPi or ZUMspot USB. You have
|
||||
to enable this option if you have one of these products.
|
||||
- #define ZUMSPOT_ADF7021: enable pinouts support for ZUMspot RPi or ZUMspot USB. You have to enable this option if you have one of these products.
|
||||
|
||||
- #define LIBRE_KIT_ADF7021: enable this option if you have a ZUMspot Libre Kit (Board with
|
||||
modified RF7021SE and Blue Pill STM32F103).
|
||||
- #define LIBRE_KIT_ADF7021: enable this option if you have a ZUMspot Libre Kit (Board with modified RF7021SE and Blue Pill STM32F103).
|
||||
|
||||
- #define MMDVM_HS_HAT_REV12: enable this option if you have a MMDVM_HS_Hat board for RPi.
|
||||
|
||||
|
|
@ -561,16 +560,11 @@ modified RF7021SE and Blue Pill STM32F103).
|
|||
|
||||
- #define ADF7021_12_2880: select this option if your board uses a 12.2880 MHz.
|
||||
|
||||
- #define STM32_USART1_HOST: enable direct serial host communication with ZUMspot (using USART1
|
||||
PA9 and PA10 pins). Disable STM32_USB_HOST if you enable this option. Enable this if you have
|
||||
a ZUMspot RPi. You don't need to enable this option if you will transfer the bootloader.
|
||||
- #define STM32_USART1_HOST: enable direct serial host communication with ZUMspot (using USART1 PA9 and PA10 pins). Disable STM32_USB_HOST if you enable this option. Enable this if you have a ZUMspot RPi. You don't need to enable this option if you will transfer the bootloader.
|
||||
|
||||
- #define STM32_USB_HOST: enable USB host communication with ZUMspot (using STM32F103 USB
|
||||
interface). Disable STM32_USART1_HOST if you enable this option. Enable this if you have
|
||||
a ZUMspot USB or ZUMspot Libre Kit.
|
||||
- #define STM32_USB_HOST: enable USB host communication with ZUMspot (using STM32F103 USB interface). Disable STM32_USART1_HOST if you enable this option. Enable this if you have a ZUMspot USB or ZUMspot Libre Kit.
|
||||
|
||||
- #define ENABLE_SCAN_MODE: enable automatic mode detection in ZUMspot. This is based on
|
||||
scanning over all enabled modes, and you could have some detection delay. Enabled by default.
|
||||
- #define ENABLE_SCAN_MODE: enable automatic mode detection in ZUMspot. This is based on scanning over all enabled modes, and you could have some detection delay. Enabled by default.
|
||||
|
||||
- #define SEND_RSSI_DATA: enable RSSI reports to MMDVMHost. It is already converted to dBm.
|
||||
|
||||
|
|
@ -636,8 +630,7 @@ Misc pins:
|
|||
PIN_LED PC13 (status led)
|
||||
PIN_DEB PB9 (debugging pin)
|
||||
|
||||
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for
|
||||
reducing EMI.
|
||||
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for reducing EMI.
|
||||
|
||||
## Pinout definitions for Arduino Due/Zero + RF7021SE
|
||||
|
||||
|
|
@ -676,8 +669,7 @@ Misc pins:
|
|||
PIN_LED 13
|
||||
PIN_DEB 11
|
||||
|
||||
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for
|
||||
reducing EMI.
|
||||
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for reducing EMI.
|
||||
|
||||
## Pinout definitions for Teensy (3.1, 3.2, 3.5 or 3.6) + RF7021SE:
|
||||
|
||||
|
|
@ -718,8 +710,7 @@ Misc pins:
|
|||
PIN_LED 13
|
||||
PIN_DEB 23
|
||||
|
||||
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for
|
||||
reducing EMI.
|
||||
You could install a serie resistor (10 - 100 ohms) in each TxRxData and TxRxCLK lines, for reducing EMI.
|
||||
|
||||
# Hidden functions
|
||||
|
||||
|
|
@ -733,11 +724,9 @@ Also in ADF7021.h:
|
|||
|
||||
- #define ADF7021_N_VER: enable support for narrow band version of ADF7021 (ADF7021N). Disabled by default, in general all boards will have just ADF7021.
|
||||
|
||||
- #define ADF7021_ENABLE_4FSK_AFC: enable AFC support for DMR, YSF and P25. This is experimental,
|
||||
depending on your frequency offset this option will improve or not your BER reception.
|
||||
- #define ADF7021_ENABLE_4FSK_AFC: enable AFC support for DMR, YSF and P25. This is experimental, depending on your frequency offset this option will improve or not your BER reception.
|
||||
|
||||
- #define ADF7021_AFC_POS: enable this option if you can not receive any signal after enable the
|
||||
ADF7021_ENABLE_4FSK_AFC option.
|
||||
- #define ADF7021_AFC_POS: enable this option if you can not receive any signal after enable the ADF7021_ENABLE_4FSK_AFC option.
|
||||
|
||||
- #define ADF7021_DISABLE_RC_4FSK: disable TX Raised Cosine filter for 4FSK modulation in ADF7021. Default TX pulse shaping filter for 4FSK is not optimum for DMR, YSF and P25. Activating this option might improve audio in 4FSK digital modes.
|
||||
|
||||
|
|
@ -748,4 +737,3 @@ In Globals.h:
|
|||
In IOSTM.cpp:
|
||||
|
||||
- #define PI_HAT_7021_REV_02: enable pinouts for first revision of ZUMspot RPi. In general is not used.
|
||||
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ const struct {
|
|||
{',', 0xEEAEE000U, 22U},
|
||||
{'-', 0xEAAE0000U, 18U},
|
||||
{'=', 0xEAB80000U, 16U},
|
||||
{'.', 0xBAEB8000U, 20U},
|
||||
{' ', 0x00000000U, 4U},
|
||||
{0U, 0x00000000U, 0U}
|
||||
};
|
||||
|
|
|
|||
18
CalDMR.cpp
18
CalDMR.cpp
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2015 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016 by Colin Durbridge G4EML
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2018,2019 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -53,7 +53,8 @@ CCalDMR::CCalDMR() :
|
|||
m_transmit(false),
|
||||
m_state(DMRCAL1K_IDLE),
|
||||
m_dmr1k(),
|
||||
m_audioSeq(0)
|
||||
m_audioSeq(0),
|
||||
m_count(0)
|
||||
{
|
||||
::memcpy(m_dmr1k, VOICE_1K, DMR_FRAME_LENGTH_BYTES + 1U);
|
||||
}
|
||||
|
|
@ -72,6 +73,17 @@ void CCalDMR::process()
|
|||
case STATE_DMRDMO1K:
|
||||
dmrdmo1k();
|
||||
break;
|
||||
case STATE_INTCAL:
|
||||
// Simple interrupt counter for board diagnostics (TCXO, connections, etc)
|
||||
// Not intended for precise interrupt frequency measurements
|
||||
m_count++;
|
||||
if (m_count >= CAL_DLY_LOOP) {
|
||||
m_count = 0U;
|
||||
uint16_t int1, int2;
|
||||
io.getIntCounter(int1, int2);
|
||||
DEBUG3("Counter INT1/INT2:", int1 >> 1U, int2);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -132,7 +144,7 @@ uint8_t CCalDMR::write(const uint8_t* data, uint8_t length)
|
|||
if (m_transmit && m_state == DMRCAL1K_IDLE && m_calState == STATE_DMRDMO1K)
|
||||
m_state = DMRCAL1K_VH;
|
||||
|
||||
if (!m_transmit)
|
||||
if (m_transmit)
|
||||
io.ifConf(STATE_DMR, true);
|
||||
|
||||
return 0U;
|
||||
|
|
|
|||
1
CalDMR.h
1
CalDMR.h
|
|
@ -47,6 +47,7 @@ private:
|
|||
DMRCAL1K m_state;
|
||||
uint8_t m_dmr1k[DMR_FRAME_LENGTH_BYTES + 1U];
|
||||
uint8_t m_audioSeq;
|
||||
uint32_t m_count;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
30
Config.h
30
Config.h
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,12 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
// 9) LoneStar USB Stick ADF7071
|
||||
// #define LONESTAR_USB
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +64,10 @@
|
|||
// Host communication selection:
|
||||
// #define STM32_USART1_HOST
|
||||
#define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +77,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +97,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
#define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
40
DStarRX.cpp
40
DStarRX.cpp
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2009-2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -25,23 +25,23 @@
|
|||
const unsigned int MAX_SYNC_BITS = 100U * DSTAR_DATA_LENGTH_BITS;
|
||||
|
||||
// D-Star preamble sequence (only 32 bits of 101010...)
|
||||
const uint32_t PREAMBLE_MASK = 0xFFFFFFFFU;
|
||||
const uint32_t PREAMBLE_DATA = 0xAAAAAAAAU;
|
||||
const uint64_t PREAMBLE_MASK = 0x00000000FFFFFFFFU;
|
||||
const uint64_t PREAMBLE_DATA = 0x00000000AAAAAAAAU;
|
||||
const uint8_t PREAMBLE_ERRS = 2U;
|
||||
|
||||
// D-Star bit order version of 0x55 0x55 0x6E 0x0A
|
||||
const uint32_t FRAME_SYNC_DATA = 0x00557650U;
|
||||
const uint32_t FRAME_SYNC_MASK = 0x00FFFFFFU;
|
||||
const uint64_t FRAME_SYNC_DATA = 0x0000000000557650U;
|
||||
const uint64_t FRAME_SYNC_MASK = 0x0000000000FFFFFFU;
|
||||
const uint8_t FRAME_SYNC_ERRS = 2U;
|
||||
|
||||
// D-Star bit order version of 0x55 0x2D 0x16
|
||||
const uint32_t DATA_SYNC_DATA = 0x00AAB468U;
|
||||
const uint32_t DATA_SYNC_MASK = 0x00FFFFFFU;
|
||||
const uint64_t DATA_SYNC_DATA = 0x0000000000AAB468U;
|
||||
const uint64_t DATA_SYNC_MASK = 0x0000000000FFFFFFU;
|
||||
const uint8_t DATA_SYNC_ERRS = 3U;
|
||||
|
||||
// D-Star bit order version of 0x55 0x55 0xC8 0x7A
|
||||
const uint32_t END_SYNC_DATA = 0xAAAA135EU;
|
||||
const uint32_t END_SYNC_MASK = 0xFFFFFFFFU;
|
||||
const uint64_t END_SYNC_DATA = 0x0000AAAAAAAA135EU;
|
||||
const uint64_t END_SYNC_MASK = 0x0000FFFFFFFFFFFFU;
|
||||
const uint8_t END_SYNC_ERRS = 1U;
|
||||
|
||||
const uint8_t BIT_MASK_TABLE0[] = {0x7FU, 0xBFU, 0xDFU, 0xEFU, 0xF7U, 0xFBU, 0xFDU, 0xFEU};
|
||||
|
|
@ -284,7 +284,7 @@ void CDStarRX::processNone(bool bit)
|
|||
m_patternBuffer |= 0x01U;
|
||||
|
||||
// Fuzzy matching of the preamble sync sequence
|
||||
if (countBits32((m_patternBuffer & PREAMBLE_MASK) ^ PREAMBLE_DATA) <= PREAMBLE_ERRS) {
|
||||
if (countBits64((m_patternBuffer & PREAMBLE_MASK) ^ PREAMBLE_DATA) <= PREAMBLE_ERRS) {
|
||||
|
||||
// Extend scan period in D-Star, once preamble is detected
|
||||
m_modeTimerCnt = 0;
|
||||
|
|
@ -295,7 +295,7 @@ void CDStarRX::processNone(bool bit)
|
|||
}
|
||||
|
||||
// Fuzzy matching of the frame sync sequence
|
||||
if (countBits32((m_patternBuffer & FRAME_SYNC_MASK) ^ FRAME_SYNC_DATA) <= FRAME_SYNC_ERRS) {
|
||||
if (countBits64((m_patternBuffer & FRAME_SYNC_MASK) ^ FRAME_SYNC_DATA) <= FRAME_SYNC_ERRS) {
|
||||
DEBUG1("DStarRX: found frame sync in None, fuzzy");
|
||||
|
||||
::memset(m_rxBuffer, 0x00U, DSTAR_FEC_SECTION_LENGTH_BYTES);
|
||||
|
|
@ -306,7 +306,7 @@ void CDStarRX::processNone(bool bit)
|
|||
}
|
||||
|
||||
// Exact matching of the data sync bit sequence
|
||||
if (countBits32((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) == 0U) {
|
||||
if (countBits64((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) == 0U) {
|
||||
DEBUG1("DStarRX: found data sync in None, exact");
|
||||
|
||||
io.setDecode(true);
|
||||
|
|
@ -330,7 +330,10 @@ void CDStarRX::processHeader(bool bit)
|
|||
m_patternBuffer |= 0x01U;
|
||||
|
||||
WRITE_BIT2(m_rxBuffer, m_rxBufferBits, bit);
|
||||
|
||||
m_rxBufferBits++;
|
||||
if (m_rxBufferBits > DSTAR_BUFFER_LENGTH_BITS)
|
||||
reset();
|
||||
|
||||
// A full FEC header
|
||||
if (m_rxBufferBits == DSTAR_FEC_SECTION_LENGTH_BITS) {
|
||||
|
|
@ -361,10 +364,13 @@ void CDStarRX::processData(bool bit)
|
|||
m_patternBuffer |= 0x01U;
|
||||
|
||||
WRITE_BIT2(m_rxBuffer, m_rxBufferBits, bit);
|
||||
|
||||
m_rxBufferBits++;
|
||||
if (m_rxBufferBits > DSTAR_BUFFER_LENGTH_BITS)
|
||||
reset();
|
||||
|
||||
// Fuzzy matching of the end frame sequences
|
||||
if (countBits32((m_patternBuffer & END_SYNC_MASK) ^ END_SYNC_DATA) <= END_SYNC_ERRS) {
|
||||
if (countBits64((m_patternBuffer & END_SYNC_MASK) ^ END_SYNC_DATA) <= END_SYNC_ERRS) {
|
||||
DEBUG1("DStarRX: Found end sync in Data");
|
||||
io.setDecode(false);
|
||||
|
||||
|
|
@ -377,7 +383,7 @@ void CDStarRX::processData(bool bit)
|
|||
// Fuzzy matching of the data sync bit sequence
|
||||
bool syncSeen = false;
|
||||
if (m_rxBufferBits >= (DSTAR_DATA_LENGTH_BITS - 3U)) {
|
||||
if (countBits32((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) <= DATA_SYNC_ERRS) {
|
||||
if (countBits64((m_patternBuffer & DATA_SYNC_MASK) ^ DATA_SYNC_DATA) <= DATA_SYNC_ERRS) {
|
||||
m_rxBufferBits = DSTAR_DATA_LENGTH_BITS;
|
||||
m_dataBits = MAX_SYNC_BITS;
|
||||
syncSeen = true;
|
||||
|
|
@ -387,9 +393,9 @@ void CDStarRX::processData(bool bit)
|
|||
// Check to see if the sync is arriving late
|
||||
if (m_rxBufferBits == DSTAR_DATA_LENGTH_BITS && !syncSeen) {
|
||||
for (uint8_t i = 1U; i <= 3U; i++) {
|
||||
uint32_t syncMask = DATA_SYNC_MASK >> i;
|
||||
uint32_t syncData = DATA_SYNC_DATA >> i;
|
||||
if (countBits32((m_patternBuffer & syncMask) ^ syncData) <= DATA_SYNC_ERRS) {
|
||||
uint64_t syncMask = DATA_SYNC_MASK >> i;
|
||||
uint64_t syncData = DATA_SYNC_DATA >> i;
|
||||
if (countBits64((m_patternBuffer & syncMask) ^ syncData) <= DATA_SYNC_ERRS) {
|
||||
m_rxBufferBits -= i;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include "DStarDefines.h"
|
||||
|
||||
const uint16_t DSTAR_BUFFER_LENGTH_BITS = 800U;
|
||||
|
||||
enum DSRX_STATE {
|
||||
DSRXS_NONE,
|
||||
DSRXS_HEADER,
|
||||
|
|
@ -38,8 +40,8 @@ public:
|
|||
|
||||
private:
|
||||
DSRX_STATE m_rxState;
|
||||
uint32_t m_patternBuffer;
|
||||
uint8_t m_rxBuffer[100U];
|
||||
uint64_t m_patternBuffer;
|
||||
uint8_t m_rxBuffer[DSTAR_BUFFER_LENGTH_BITS / 8U];
|
||||
unsigned int m_rxBufferBits;
|
||||
unsigned int m_dataBits;
|
||||
unsigned int m_mar;
|
||||
|
|
|
|||
2
Debug.h
2
Debug.h
|
|
@ -36,7 +36,7 @@
|
|||
#define DEBUG1(a)
|
||||
#define DEBUG2(a,b)
|
||||
#define DEBUG2I(a,b)
|
||||
#define DEBUG3(a,b,c)
|
||||
#define DEBUG3(a,b,c) serial.writeDebug((a),(b),(c))
|
||||
#define DEBUG4(a,b,c,d)
|
||||
#define DEBUG5(a,b,c,d,e)
|
||||
|
||||
|
|
|
|||
21
Globals.h
21
Globals.h
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2019 by Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -41,13 +42,16 @@ enum MMDVM_STATE {
|
|||
STATE_P25 = 4,
|
||||
STATE_NXDN = 5,
|
||||
STATE_POCSAG = 6,
|
||||
STATE_M17 = 7,
|
||||
|
||||
// Dummy states start at 90
|
||||
STATE_DMRDMO1K = 92,
|
||||
STATE_RSSICAL = 96,
|
||||
STATE_CWID = 97,
|
||||
STATE_DMRCAL = 98,
|
||||
STATE_DSTARCAL = 99
|
||||
STATE_DSTARCAL = 99,
|
||||
STATE_INTCAL = 100,
|
||||
STATE_POCSAGCAL = 101
|
||||
};
|
||||
|
||||
const uint8_t MARK_SLOT1 = 0x08U;
|
||||
|
|
@ -74,6 +78,8 @@ const uint8_t MARK_NONE = 0x00U;
|
|||
#include "YSFTX.h"
|
||||
#include "P25RX.h"
|
||||
#include "P25TX.h"
|
||||
#include "M17RX.h"
|
||||
#include "M17TX.h"
|
||||
#include "NXDNRX.h"
|
||||
#include "NXDNTX.h"
|
||||
#include "POCSAGTX.h"
|
||||
|
|
@ -82,6 +88,7 @@ const uint8_t MARK_NONE = 0x00U;
|
|||
#include "CalDMR.h"
|
||||
#include "Debug.h"
|
||||
#include "Utils.h"
|
||||
#include "I2CHost.h"
|
||||
|
||||
extern MMDVM_STATE m_modemState;
|
||||
extern MMDVM_STATE m_calState;
|
||||
|
|
@ -99,6 +106,7 @@ extern bool m_dmrEnable;
|
|||
extern bool m_ysfEnable;
|
||||
extern bool m_p25Enable;
|
||||
extern bool m_nxdnEnable;
|
||||
extern bool m_m17Enable;
|
||||
extern bool m_pocsagEnable;
|
||||
|
||||
extern bool m_duplex;
|
||||
|
|
@ -129,6 +137,9 @@ extern CYSFTX ysfTX;
|
|||
extern CP25RX p25RX;
|
||||
extern CP25TX p25TX;
|
||||
|
||||
extern CM17RX m17RX;
|
||||
extern CM17TX m17TX;
|
||||
|
||||
extern CNXDNRX nxdnRX;
|
||||
extern CNXDNTX nxdnTX;
|
||||
|
||||
|
|
@ -142,5 +153,9 @@ extern CCalRSSI calRSSI;
|
|||
|
||||
extern CCWIdTX cwIdTX;
|
||||
|
||||
#if defined(STM32_I2C_HOST)
|
||||
extern CI2CHost i2c;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
201
I2CHost.cpp
Normal file
201
I2CHost.cpp
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
/*
|
||||
* Copyright (C) 2019 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
#if defined(STM32_I2C_HOST)
|
||||
|
||||
#include "Globals.h"
|
||||
#include "I2CHost.h"
|
||||
|
||||
extern "C" {
|
||||
void I2C2_EV_IRQHandler(void) {
|
||||
i2c.I2C_EVHandler();
|
||||
}
|
||||
|
||||
void I2C2_ER_IRQHandler(void) {
|
||||
if (I2C_GetITStatus(I2C2, I2C_IT_AF)) {
|
||||
I2C_ClearITPendingBit(I2C2, I2C_IT_AF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CI2CHost::CI2CHost()
|
||||
{
|
||||
}
|
||||
|
||||
void CI2CHost::Init(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
I2C_InitTypeDef I2C_InitStructure;
|
||||
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C2, ENABLE);
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
|
||||
|
||||
// Configure I2C GPIOs
|
||||
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11;
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_OD;
|
||||
GPIO_Init(GPIOB, &GPIO_InitStructure);
|
||||
|
||||
// Configure the I2C event interrupt
|
||||
NVIC_InitStructure.NVIC_IRQChannel = I2C2_EV_IRQn;
|
||||
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 15;
|
||||
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 15;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
|
||||
// Configure the I2C error interrupt
|
||||
NVIC_InitStructure.NVIC_IRQChannel = I2C2_ER_IRQn;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
|
||||
// I2C configuration
|
||||
I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;
|
||||
I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;
|
||||
I2C_InitStructure.I2C_OwnAddress1 = I2C_ADDR << 1;
|
||||
I2C_InitStructure.I2C_Ack = I2C_Ack_Enable;
|
||||
I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
|
||||
I2C_InitStructure.I2C_ClockSpeed = I2C_CLK_FREQ;
|
||||
|
||||
// Enable I2C
|
||||
I2C_Cmd(I2C2, ENABLE);
|
||||
// Apply I2C configuration
|
||||
I2C_Init(I2C2, &I2C_InitStructure);
|
||||
|
||||
I2C_ITConfig(I2C2, I2C_IT_EVT, ENABLE);
|
||||
I2C_ITConfig(I2C2, I2C_IT_BUF, ENABLE);
|
||||
I2C_ITConfig(I2C2, I2C_IT_ERR, ENABLE);
|
||||
|
||||
// Initialize the FIFOs
|
||||
txFIFO_head = 0U;
|
||||
txFIFO_tail = 0U;
|
||||
rxFIFO_head = 0U;
|
||||
rxFIFO_tail = 0U;
|
||||
}
|
||||
|
||||
void CI2CHost::I2C_EVHandler(void) {
|
||||
uint32_t event = I2C_GetLastEvent(I2C2);
|
||||
|
||||
switch (event) {
|
||||
case I2C_EVENT_SLAVE_RECEIVER_ADDRESS_MATCHED:
|
||||
break;
|
||||
case I2C_EVENT_SLAVE_BYTE_RECEIVED:
|
||||
if (rxFIFO_level() < I2C_RX_FIFO_SIZE) {
|
||||
rxFIFO[rxFIFO_head] = I2C_ReceiveData(I2C2);
|
||||
rxFIFO_head++;
|
||||
if (rxFIFO_head >= I2C_RX_FIFO_SIZE)
|
||||
rxFIFO_head = 0U;
|
||||
} else
|
||||
I2C_ReceiveData(I2C2);
|
||||
break;
|
||||
case I2C_EVENT_SLAVE_TRANSMITTER_ADDRESS_MATCHED:
|
||||
case I2C_EVENT_SLAVE_BYTE_TRANSMITTED:
|
||||
if (txFIFO_level() > 0) {
|
||||
I2C_SendData(I2C2, txFIFO[txFIFO_tail]);
|
||||
txFIFO_tail++;
|
||||
if (txFIFO_tail >= I2C_TX_FIFO_SIZE)
|
||||
txFIFO_tail = 0U;
|
||||
} else
|
||||
I2C_SendData(I2C2, 0U);
|
||||
break;
|
||||
case I2C_EVENT_SLAVE_STOP_DETECTED:
|
||||
I2C2_ClearFlag();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CI2CHost::I2C2_ClearFlag(void) {
|
||||
// Clear ADDR flag
|
||||
while((I2C2->SR1 & I2C_SR1_ADDR) == I2C_SR1_ADDR) {
|
||||
I2C2->SR1;
|
||||
I2C2->SR2;
|
||||
}
|
||||
|
||||
// Clear STOPF flag
|
||||
while((I2C2->SR1 & I2C_SR1_STOPF) == I2C_SR1_STOPF) {
|
||||
I2C2->SR1;
|
||||
I2C2->CR1 |= 0x1;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t CI2CHost::txFIFO_level(void)
|
||||
{
|
||||
uint32_t tail = txFIFO_tail;
|
||||
uint32_t head = txFIFO_head;
|
||||
|
||||
if (tail > head)
|
||||
return I2C_TX_FIFO_SIZE + head - tail;
|
||||
else
|
||||
return head - tail;
|
||||
}
|
||||
|
||||
uint16_t CI2CHost::rxFIFO_level(void)
|
||||
{
|
||||
uint32_t tail = rxFIFO_tail;
|
||||
uint32_t head = rxFIFO_head;
|
||||
|
||||
if (tail > head)
|
||||
return I2C_RX_FIFO_SIZE + head - tail;
|
||||
else
|
||||
return head - tail;
|
||||
}
|
||||
|
||||
|
||||
uint8_t CI2CHost::txFIFO_put(uint8_t next)
|
||||
{
|
||||
if (txFIFO_level() < I2C_TX_FIFO_SIZE) {
|
||||
txFIFO[txFIFO_head] = next;
|
||||
|
||||
txFIFO_head++;
|
||||
if (txFIFO_head >= I2C_TX_FIFO_SIZE)
|
||||
txFIFO_head = 0U;
|
||||
return 1U;
|
||||
} else {
|
||||
return 0U;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t CI2CHost::AvailI2C(void)
|
||||
{
|
||||
if (rxFIFO_level() > 0U)
|
||||
return 1U;
|
||||
else
|
||||
return 0U;
|
||||
}
|
||||
|
||||
|
||||
uint8_t CI2CHost::ReadI2C(void)
|
||||
{
|
||||
uint8_t data_c = rxFIFO[rxFIFO_tail];
|
||||
|
||||
rxFIFO_tail++;
|
||||
if (rxFIFO_tail >= I2C_RX_FIFO_SIZE)
|
||||
rxFIFO_tail = 0U;
|
||||
|
||||
return data_c;
|
||||
}
|
||||
|
||||
void CI2CHost::WriteI2C(const uint8_t* data, uint16_t length)
|
||||
{
|
||||
for (uint16_t i = 0U; i < length; i++)
|
||||
txFIFO_put(data[i]);
|
||||
}
|
||||
|
||||
#endif
|
||||
55
I2CHost.h
Normal file
55
I2CHost.h
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (C) 2019 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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(I2CHost_H)
|
||||
#define I2CHost_H
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
#if defined(STM32_I2C_HOST)
|
||||
|
||||
#define I2C_CLK_FREQ 100000U
|
||||
#define I2C_TX_FIFO_SIZE 512U
|
||||
#define I2C_RX_FIFO_SIZE 512U
|
||||
|
||||
class CI2CHost {
|
||||
public:
|
||||
CI2CHost();
|
||||
|
||||
void Init(void);
|
||||
void I2C_EVHandler(void);
|
||||
uint8_t AvailI2C(void);
|
||||
uint8_t ReadI2C(void);
|
||||
void WriteI2C(const uint8_t* data, uint16_t length);
|
||||
|
||||
private:
|
||||
void I2C2_ClearFlag(void);
|
||||
uint16_t txFIFO_level(void);
|
||||
uint16_t rxFIFO_level(void);
|
||||
uint8_t txFIFO_put(uint8_t next);
|
||||
|
||||
volatile uint8_t txFIFO[I2C_TX_FIFO_SIZE];
|
||||
volatile uint8_t rxFIFO[I2C_RX_FIFO_SIZE];
|
||||
volatile uint16_t txFIFO_head, txFIFO_tail;
|
||||
volatile uint16_t rxFIFO_head, rxFIFO_tail;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
107
IO.cpp
107
IO.cpp
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017 by Danilo DB4PLE
|
||||
|
||||
*
|
||||
* 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
|
||||
|
|
@ -37,7 +37,9 @@ m_scanEnable(false),
|
|||
m_scanPauseCnt(0U),
|
||||
m_scanPos(0U),
|
||||
m_ledValue(true),
|
||||
m_watchdog(0U)
|
||||
m_watchdog(0U),
|
||||
m_int1counter(0U),
|
||||
m_int2counter(0U)
|
||||
{
|
||||
Init();
|
||||
|
||||
|
|
@ -49,6 +51,7 @@ m_watchdog(0U)
|
|||
YSF_pin(LOW);
|
||||
P25_pin(LOW);
|
||||
NXDN_pin(LOW);
|
||||
M17_pin(LOW);
|
||||
POCSAG_pin(LOW);
|
||||
COS_pin(LOW);
|
||||
DEB_pin(LOW);
|
||||
|
|
@ -87,6 +90,7 @@ void CIO::selfTest()
|
|||
YSF_pin(ledValue);
|
||||
P25_pin(ledValue);
|
||||
NXDN_pin(ledValue);
|
||||
M17_pin(ledValue);
|
||||
POCSAG_pin(ledValue);
|
||||
COS_pin(ledValue);
|
||||
|
||||
|
|
@ -109,7 +113,7 @@ void CIO::process()
|
|||
if (m_started) {
|
||||
// Two seconds timeout
|
||||
if (m_watchdog >= 19200U) {
|
||||
if (m_modemState == STATE_DSTAR || m_modemState == STATE_DMR || m_modemState == STATE_YSF || m_modemState == STATE_P25 || m_modemState == STATE_NXDN) {
|
||||
if (m_modemState == STATE_DSTAR || m_modemState == STATE_DMR || m_modemState == STATE_YSF || m_modemState == STATE_P25 || m_modemState == STATE_NXDN || m_modemState == STATE_M17) {
|
||||
m_modemState = STATE_IDLE;
|
||||
setMode(m_modemState);
|
||||
}
|
||||
|
|
@ -176,6 +180,8 @@ void CIO::process()
|
|||
scantime = SCAN_TIME;
|
||||
else if(m_modemState_prev == STATE_NXDN)
|
||||
scantime = SCAN_TIME;
|
||||
else if(m_modemState_prev == STATE_M17)
|
||||
scantime = SCAN_TIME;
|
||||
else
|
||||
scantime = SCAN_TIME;
|
||||
|
||||
|
|
@ -219,6 +225,9 @@ void CIO::process()
|
|||
case STATE_NXDN:
|
||||
nxdnRX.databit(bit);
|
||||
break;
|
||||
case STATE_M17:
|
||||
m17RX.databit(bit);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -250,6 +259,10 @@ void CIO::start()
|
|||
m_Modes[m_TotalModes] = STATE_NXDN;
|
||||
m_TotalModes++;
|
||||
}
|
||||
if(m_m17Enable) {
|
||||
m_Modes[m_TotalModes] = STATE_M17;
|
||||
m_TotalModes++;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_SCAN_MODE)
|
||||
if(m_TotalModes > 1U)
|
||||
|
|
@ -305,11 +318,53 @@ bool CIO::hasRXOverflow()
|
|||
return m_rxBuffer.hasOverflowed();
|
||||
}
|
||||
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
|
||||
void CIO::checkBand(uint32_t frequency_rx, uint32_t frequency_tx) {
|
||||
if (!(io.hasSingleADF7021())) {
|
||||
// There are two ADF7021s on the board
|
||||
if (io.isDualBand()) {
|
||||
// Dual band
|
||||
if ((frequency_tx <= VHF2_MAX) && (frequency_rx <= VHF2_MAX)) {
|
||||
// Turn on VHF side
|
||||
io.setBandVHF(true);
|
||||
} else if ((frequency_tx >= UHF1_MIN) && (frequency_rx >= UHF1_MIN)) {
|
||||
// Turn on UHF side
|
||||
io.setBandVHF(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t CIO::checkZUMspot(uint32_t frequency_rx, uint32_t frequency_tx) {
|
||||
if (!(io.hasSingleADF7021())) {
|
||||
// There are two ADF7021s on the board
|
||||
if (io.isDualBand()) {
|
||||
// Dual band
|
||||
if ((frequency_tx <= VHF2_MAX) && (frequency_rx <= VHF2_MAX)) {
|
||||
// Turn on VHF side
|
||||
io.setBandVHF(true);
|
||||
} else if ((frequency_tx >= UHF1_MIN) && (frequency_rx >= UHF1_MIN)) {
|
||||
// Turn on UHF side
|
||||
io.setBandVHF(false);
|
||||
}
|
||||
} else if (!io.isDualBand()) {
|
||||
// Duplex board
|
||||
if ((frequency_tx < UHF1_MIN) || (frequency_rx < UHF1_MIN)) {
|
||||
// Reject VHF frequencies
|
||||
return 4U;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0U;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_power, uint32_t pocsag_freq_tx)
|
||||
{
|
||||
// Configure power level
|
||||
setPower(rf_power);
|
||||
|
||||
#if !defined(DISABLE_FREQ_CHECK)
|
||||
// Check frequency ranges
|
||||
if( !( ((frequency_rx >= VHF1_MIN)&&(frequency_rx < VHF1_MAX)) || ((frequency_tx >= VHF1_MIN)&&(frequency_tx < VHF1_MAX)) || \
|
||||
((frequency_rx >= UHF1_MIN)&&(frequency_rx < UHF1_MAX)) || ((frequency_tx >= UHF1_MIN)&&(frequency_tx < UHF1_MAX)) || \
|
||||
|
|
@ -322,6 +377,25 @@ uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_po
|
|||
((pocsag_freq_tx >= VHF2_MIN)&&(pocsag_freq_tx < VHF2_MAX)) || \
|
||||
((pocsag_freq_tx >= UHF2_MIN)&&(pocsag_freq_tx < UHF2_MAX)) ) )
|
||||
return 4U;
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_FREQ_BAN)
|
||||
// Check banned frequency ranges
|
||||
if( ((frequency_rx >= BAN1_MIN)&&(frequency_rx <= BAN1_MAX)) || ((frequency_tx >= BAN1_MIN)&&(frequency_tx <= BAN1_MAX)) || \
|
||||
((frequency_rx >= BAN2_MIN)&&(frequency_rx <= BAN2_MAX)) || ((frequency_tx >= BAN2_MIN)&&(frequency_tx <= BAN2_MAX)) )
|
||||
return 4U;
|
||||
|
||||
if( ((pocsag_freq_tx >= BAN1_MIN)&&(pocsag_freq_tx <= BAN1_MAX)) || \
|
||||
((pocsag_freq_tx >= BAN2_MIN)&&(pocsag_freq_tx <= BAN2_MAX)) )
|
||||
return 4U;
|
||||
#endif
|
||||
|
||||
// Check if we have a single, dualband or duplex board
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
|
||||
if (checkZUMspot(frequency_rx, frequency_tx) > 0) {
|
||||
return 4U;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Configure frequency
|
||||
m_frequency_rx = frequency_rx;
|
||||
|
|
@ -349,6 +423,14 @@ void CIO::setMode(MMDVM_STATE modemState)
|
|||
#if defined(USE_ALTERNATE_NXDN_LEDS)
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
if (modemState != STATE_M17) {
|
||||
#endif
|
||||
YSF_pin(modemState == STATE_YSF);
|
||||
P25_pin(modemState == STATE_P25);
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_ALTERNATE_NXDN_LEDS)
|
||||
if (modemState != STATE_YSF && modemState != STATE_P25) {
|
||||
#endif
|
||||
|
|
@ -363,6 +445,13 @@ void CIO::setMode(MMDVM_STATE modemState)
|
|||
#if defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||
}
|
||||
#endif
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
if (modemState != STATE_DSTAR && modemState != STATE_P25) {
|
||||
#endif
|
||||
M17_pin(modemState == STATE_M17);
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CIO::setDecode(bool dcd)
|
||||
|
|
@ -389,3 +478,11 @@ uint32_t CIO::getWatchdog()
|
|||
{
|
||||
return m_watchdog;
|
||||
}
|
||||
|
||||
void CIO::getIntCounter(uint16_t &int1, uint16_t &int2)
|
||||
{
|
||||
int1 = m_int1counter;
|
||||
int2 = m_int2counter;
|
||||
m_int1counter = 0U;
|
||||
m_int2counter = 0U;
|
||||
}
|
||||
|
|
|
|||
43
IO.h
43
IO.h
|
|
@ -1,8 +1,8 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017 by Danilo DB4PLE
|
||||
|
||||
*
|
||||
* 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
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
#define LOW 0
|
||||
#define HIGH 1
|
||||
|
||||
// HS frequency ranges
|
||||
#define VHF1_MIN 144000000
|
||||
#define VHF1_MAX 148000000
|
||||
#define VHF2_MIN 219000000
|
||||
|
|
@ -37,9 +38,29 @@
|
|||
#define UHF2_MIN 842000000
|
||||
#define UHF2_MAX 950000000
|
||||
|
||||
// Banned amateur frequency ranges (satellite only, ISS, etc)
|
||||
#define BAN1_MIN 145800000
|
||||
#define BAN1_MAX 146000000
|
||||
#define BAN2_MIN 435000000
|
||||
#define BAN2_MAX 438000000
|
||||
|
||||
#define SCAN_TIME 1920
|
||||
#define SCAN_PAUSE 20000
|
||||
|
||||
#if defined(DUPLEX)
|
||||
#if defined(STM32_USB_HOST)
|
||||
#define CAL_DLY_LOOP 98950U
|
||||
#else
|
||||
#define CAL_DLY_LOOP 96100U
|
||||
#endif
|
||||
#else
|
||||
#if defined(STM32_USB_HOST)
|
||||
#define CAL_DLY_LOOP 110850U
|
||||
#else
|
||||
#define CAL_DLY_LOOP 104600U
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern uint32_t m_frequency_rx;
|
||||
extern uint32_t m_frequency_tx;
|
||||
extern uint32_t m_pocsag_freq_tx;
|
||||
|
|
@ -77,6 +98,7 @@ public:
|
|||
void YSF_pin(bool on);
|
||||
void P25_pin(bool on);
|
||||
void NXDN_pin(bool on);
|
||||
void M17_pin(bool on);
|
||||
void POCSAG_pin(bool on);
|
||||
void COS_pin(bool on);
|
||||
void interrupt(void);
|
||||
|
|
@ -101,7 +123,15 @@ public:
|
|||
void setLoDevYSF(bool ysfLoDev);
|
||||
void resetWatchdog(void);
|
||||
uint32_t getWatchdog(void);
|
||||
void getIntCounter(uint16_t &int1, uint16_t &int2);
|
||||
void selfTest(void);
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
|
||||
void checkBand(uint32_t frequency_rx, uint32_t frequency_tx);
|
||||
uint8_t checkZUMspot(uint32_t frequency_rx, uint32_t frequency_tx);
|
||||
void setBandVHF(bool vhf_on);
|
||||
bool hasSingleADF7021(void);
|
||||
bool isDualBand(void);
|
||||
#endif
|
||||
|
||||
// RF interface API
|
||||
void setTX(void);
|
||||
|
|
@ -112,7 +142,7 @@ public:
|
|||
#endif
|
||||
void start(void);
|
||||
void startInt(void);
|
||||
void setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t pocsagTXLevel, bool ysfLoDev);
|
||||
void setDeviations(uint8_t dstarTXLevel, uint8_t dmrTXLevel, uint8_t ysfTXLevel, uint8_t p25TXLevel, uint8_t nxdnTXLevel, uint8_t m17TXLevel, uint8_t pocsagTXLevel, bool ysfLoDev);
|
||||
void updateCal(void);
|
||||
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
|
|
@ -133,6 +163,7 @@ public:
|
|||
uint16_t devYSF(void);
|
||||
uint16_t devP25(void);
|
||||
uint16_t devNXDN(void);
|
||||
uint16_t devM17(void);
|
||||
uint16_t devPOCSAG(void);
|
||||
void printConf();
|
||||
#endif
|
||||
|
|
@ -152,9 +183,11 @@ private:
|
|||
uint32_t m_scanPauseCnt;
|
||||
uint8_t m_scanPos;
|
||||
uint8_t m_TotalModes;
|
||||
MMDVM_STATE m_Modes[5];
|
||||
MMDVM_STATE m_Modes[6];
|
||||
bool m_ledValue;
|
||||
volatile uint32_t m_watchdog;
|
||||
volatile uint16_t m_int1counter;
|
||||
volatile uint16_t m_int2counter;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017 by Danilo DB4PLE
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
// STM32F1 pin definitions, using STM32duino
|
||||
|
||||
#if defined(ZUMSPOT_ADF7021)
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
|
||||
|
||||
#define PIN_SCLK PB5
|
||||
#define PIN_SREAD PB6
|
||||
|
|
@ -37,9 +37,9 @@
|
|||
#define PIN_SLE2 PA6
|
||||
#define PIN_CE PC14
|
||||
#define PIN_RXD PB4
|
||||
#define PIN_RXD2 PA4
|
||||
#define PIN_RXD2 PA11
|
||||
#define PIN_TXD PB3
|
||||
#define PIN_TXD2 PA5
|
||||
#define PIN_TXD2 PA8
|
||||
#define PIN_CLKOUT PA15
|
||||
#define PIN_LED PC13
|
||||
#define PIN_DEB PB9
|
||||
|
|
@ -47,7 +47,12 @@
|
|||
#define PIN_DMR_LED PB13
|
||||
#define PIN_YSF_LED PB1
|
||||
#define PIN_P25_LED PB0
|
||||
#define PIN_NXDN_LED PA8
|
||||
#if defined(STM32_USB_HOST)
|
||||
#define PIN_NXDN_LED PA1
|
||||
#else
|
||||
#define PIN_NXDN_LED PA7
|
||||
#endif
|
||||
#define PIN_POCSAG_LED PA5
|
||||
#define PIN_PTT_LED PB14
|
||||
#define PIN_COS_LED PB15
|
||||
|
||||
|
|
@ -71,11 +76,12 @@
|
|||
#define PIN_YSF_LED PB1
|
||||
#define PIN_P25_LED PB0
|
||||
#define PIN_NXDN_LED PA8
|
||||
#define PIN_POCSAG_LED PA7
|
||||
#define PIN_PTT_LED PB14
|
||||
#define PIN_COS_LED PB15
|
||||
|
||||
#else
|
||||
#error "Either ZUMSPOT_ADF7021, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT or NANO_DV_REV10 need to be defined"
|
||||
#error "Either ZUMSPOT_ADF7021, LONESTAR_USB, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT, NANO_DV_REV10 or SKYBRIDGE_HS need to be defined"
|
||||
#endif
|
||||
|
||||
#elif defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
|
||||
|
|
@ -96,6 +102,7 @@
|
|||
#define PIN_YSF_LED 18
|
||||
#define PIN_P25_LED 19
|
||||
#define PIN_NXDN_LED 20
|
||||
#define PIN_POCSAG_LED 21
|
||||
#define PIN_PTT_LED 14
|
||||
#define PIN_COS_LED 15
|
||||
|
||||
|
|
@ -117,6 +124,7 @@
|
|||
#define PIN_YSF_LED 16
|
||||
#define PIN_P25_LED 17
|
||||
#define PIN_NXDN_LED 18
|
||||
#define PIN_POCSAG_LED 19
|
||||
#define PIN_PTT_LED 9
|
||||
#define PIN_COS_LED 10
|
||||
|
||||
|
|
@ -148,7 +156,7 @@ void CIO::Init()
|
|||
{
|
||||
#if defined (__STM32F1__)
|
||||
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10) || defined(SKYBRIDGE_HS)
|
||||
afio_cfg_debug_ports(AFIO_DEBUG_SW_ONLY);
|
||||
#endif
|
||||
|
||||
|
|
@ -168,6 +176,7 @@ void CIO::Init()
|
|||
pinMode(PIN_YSF_LED, OUTPUT);
|
||||
pinMode(PIN_P25_LED, OUTPUT);
|
||||
pinMode(PIN_NXDN_LED, OUTPUT);
|
||||
pinMode(PIN_POCSAG_LED, OUTPUT);
|
||||
pinMode(PIN_PTT_LED, OUTPUT);
|
||||
pinMode(PIN_COS_LED, OUTPUT);
|
||||
|
||||
|
|
@ -182,7 +191,6 @@ void CIO::Init()
|
|||
#else
|
||||
pinMode(PIN_TXD, OUTPUT);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void CIO::startInt()
|
||||
|
|
@ -326,8 +334,9 @@ void CIO::POCSAG_pin(bool on)
|
|||
#if defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||
digitalWrite(PIN_DSTAR_LED, on ? HIGH : LOW);
|
||||
digitalWrite(PIN_DMR_LED, on ? HIGH : LOW);
|
||||
#else
|
||||
digitalWrite(PIN_POCSAG_LED, on ? HIGH : LOW);
|
||||
#endif
|
||||
// TODO: add a separate LED pin for POCSAG mode
|
||||
}
|
||||
|
||||
void CIO::PTT_pin(bool on)
|
||||
|
|
|
|||
175
IOSTM.cpp
175
IOSTM.cpp
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017 by Danilo DB4PLE
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -83,13 +84,20 @@
|
|||
#define PIN_NXDN_LED GPIO_Pin_8
|
||||
#define PORT_NXDN_LED GPIOA
|
||||
|
||||
// XXX FIXME
|
||||
#define PIN_M17_LED GPIO_Pin_8
|
||||
#define PORT_M17_LED GPIOA
|
||||
|
||||
#define PIN_POCSAG_LED GPIO_Pin_5
|
||||
#define PORT_POCSAG_LED GPIOA
|
||||
|
||||
#define PIN_PTT_LED GPIO_Pin_12
|
||||
#define PORT_PTT_LED GPIOB
|
||||
|
||||
#define PIN_COS_LED GPIO_Pin_13
|
||||
#define PORT_COS_LED GPIOB
|
||||
|
||||
#elif defined(ZUMSPOT_ADF7021)
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(SKYBRIDGE_HS) || defined(LONESTAR_USB)
|
||||
|
||||
#define PIN_SCLK GPIO_Pin_5
|
||||
#define PORT_SCLK GPIOB
|
||||
|
|
@ -112,6 +120,15 @@
|
|||
#define PIN_RXD GPIO_Pin_4
|
||||
#define PORT_RXD GPIOB
|
||||
|
||||
#define PIN_SGL_DBL GPIO_Pin_12
|
||||
#define PORT_SGL_DBL GPIOA
|
||||
|
||||
#define PIN_DL_DPX GPIO_Pin_15
|
||||
#define PORT_DL_DPX GPIOC
|
||||
|
||||
#define PIN_SET_BAND GPIO_Pin_15
|
||||
#define PORT_SET_BAND GPIOA
|
||||
|
||||
// TXD used in SPI Data mode of ADF7021
|
||||
// TXD is TxRxCLK of ADF7021, standard TX/RX data interface
|
||||
#define PIN_TXD GPIO_Pin_3
|
||||
|
|
@ -119,6 +136,17 @@
|
|||
#define PIN_TXD_INT GPIO_PinSource3
|
||||
#define PORT_TXD_INT GPIO_PortSourceGPIOB
|
||||
|
||||
#if defined(DUPLEX)
|
||||
#define PIN_RXD2 GPIO_Pin_11
|
||||
#define PORT_RXD2 GPIOA
|
||||
|
||||
// TXD2 is TxRxCLK of the second ADF7021, standard TX/RX data interface
|
||||
#define PIN_TXD2 GPIO_Pin_8
|
||||
#define PORT_TXD2 GPIOA
|
||||
#define PIN_TXD2_INT GPIO_PinSource8
|
||||
#define PORT_TXD2_INT GPIO_PortSourceGPIOA
|
||||
#endif
|
||||
|
||||
// CLKOUT used in SPI Data mode of ADF7021
|
||||
#define PIN_CLKOUT GPIO_Pin_15
|
||||
#define PORT_CLKOUT GPIOA
|
||||
|
|
@ -143,16 +171,31 @@
|
|||
#define PIN_P25_LED GPIO_Pin_0
|
||||
#define PORT_P25_LED GPIOB
|
||||
|
||||
#define PIN_NXDN_LED GPIO_Pin_8
|
||||
#if defined(STM32_USB_HOST)
|
||||
#define PIN_NXDN_LED GPIO_Pin_1
|
||||
#else
|
||||
#define PIN_NXDN_LED GPIO_Pin_7
|
||||
#endif
|
||||
#define PORT_NXDN_LED GPIOA
|
||||
|
||||
// XXX FIXME
|
||||
#if defined(STM32_USB_HOST)
|
||||
#define PIN_M17_LED GPIO_Pin_1
|
||||
#else
|
||||
#define PIN_M17_LED GPIO_Pin_7
|
||||
#endif
|
||||
#define PORT_M17_LED GPIOA
|
||||
|
||||
#define PIN_POCSAG_LED GPIO_Pin_5
|
||||
#define PORT_POCSAG_LED GPIOA
|
||||
|
||||
#define PIN_PTT_LED GPIO_Pin_14
|
||||
#define PORT_PTT_LED GPIOB
|
||||
|
||||
#define PIN_COS_LED GPIO_Pin_15
|
||||
#define PORT_COS_LED GPIOB
|
||||
|
||||
#elif defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
|
||||
#elif defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS)
|
||||
|
||||
#define PIN_SCLK GPIO_Pin_5
|
||||
#define PORT_SCLK GPIOB
|
||||
|
|
@ -218,6 +261,13 @@
|
|||
#define PIN_NXDN_LED GPIO_Pin_8
|
||||
#define PORT_NXDN_LED GPIOA
|
||||
|
||||
// XXX FIXME
|
||||
#define PIN_M17_LED GPIO_Pin_8
|
||||
#define PORT_M17_LED GPIOA
|
||||
|
||||
#define PIN_POCSAG_LED GPIO_Pin_7
|
||||
#define PORT_POCSAG_LED GPIOA
|
||||
|
||||
#define PIN_PTT_LED GPIO_Pin_14
|
||||
#define PORT_PTT_LED GPIOB
|
||||
|
||||
|
|
@ -225,7 +275,7 @@
|
|||
#define PORT_COS_LED GPIOB
|
||||
|
||||
#else
|
||||
#error "Either PI_HAT_7021_REV_02, ZUMSPOT_ADF7021, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT or NANO_DV_REV10 need to be defined"
|
||||
#error "Either PI_HAT_7021_REV_02, ZUMSPOT_ADF7021, LONESTAR_USB, LIBRE_KIT_ADF7021, MMDVM_HS_HAT_REV12, MMDVM_HS_DUAL_HAT_REV10, NANO_HOTSPOT, NANO_DV_REV11, D2RG_MMDVM_HS or SKYBRIDGE_HS need to be defined"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
|
@ -247,7 +297,7 @@ extern "C" {
|
|||
}
|
||||
#endif
|
||||
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS)
|
||||
|
||||
#if defined(BIDIR_DATA_PIN)
|
||||
void EXTI3_IRQHandler(void) {
|
||||
|
|
@ -267,10 +317,17 @@ extern "C" {
|
|||
|
||||
#if defined(DUPLEX)
|
||||
void EXTI9_5_IRQHandler(void) {
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(SKYBRIDGE_HS)
|
||||
if(EXTI_GetITStatus(EXTI_Line8)!=RESET) {
|
||||
io.interrupt2();
|
||||
EXTI_ClearITPendingBit(EXTI_Line8);
|
||||
}
|
||||
#else
|
||||
if(EXTI_GetITStatus(EXTI_Line5)!=RESET) {
|
||||
io.interrupt2();
|
||||
EXTI_ClearITPendingBit(EXTI_Line5);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -279,41 +336,72 @@ extern "C" {
|
|||
|
||||
void CIO::Init()
|
||||
{
|
||||
// USB Conf IO:
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
|
||||
|
||||
#if defined(PI_HAT_7021_REV_02)
|
||||
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE);
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
|
||||
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
|
||||
#endif
|
||||
|
||||
RCC_USBCLKConfig(RCC_USBCLKSource_PLLCLK_1Div5);
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USB, ENABLE);
|
||||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
GPIO_StructInit(&GPIO_InitStruct);
|
||||
|
||||
EXTI_InitTypeDef EXTI_InitStructure;
|
||||
#if defined(DUPLEX)
|
||||
EXTI_InitTypeDef EXTI_InitStructure2;
|
||||
#endif
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
GPIO_StructInit(&GPIO_InitStruct);
|
||||
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
|
||||
|
||||
// Pin PA12 = LOW, USB Reset in generic boards
|
||||
#if defined(PI_HAT_7021_REV_02)
|
||||
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE);
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS)
|
||||
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);
|
||||
#endif
|
||||
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
|
||||
// Pin defines if the board has a single ADF7021 or double
|
||||
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_SGL_DBL;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPU;
|
||||
GPIO_Init(PORT_SGL_DBL, &GPIO_InitStruct);
|
||||
|
||||
// Pin defines if the board is dual band or duplex
|
||||
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_DL_DPX;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IPU;
|
||||
GPIO_Init(PORT_DL_DPX, &GPIO_InitStruct);
|
||||
|
||||
// Pin will set UHF or VHF
|
||||
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_SET_BAND;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_Init(PORT_SET_BAND, &GPIO_InitStruct);
|
||||
// TODO: Remove this line
|
||||
// GPIO_WriteBit(PORT_SET_BAND, PIN_SET_BAND, Bit_RESET);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(STM32_USB_HOST)
|
||||
// Pin PA11,PA12 = LOW, USB Reset
|
||||
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
GPIO_WriteBit(GPIOA, GPIO_Pin_11, Bit_RESET);
|
||||
GPIO_WriteBit(GPIOA, GPIO_Pin_12, Bit_RESET);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(LONG_USB_RESET)
|
||||
// 10 ms delay
|
||||
delay_us(10000U);
|
||||
#else
|
||||
volatile unsigned int delay;
|
||||
for(delay = 0;delay<512;delay++);
|
||||
#endif
|
||||
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_12;
|
||||
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING;
|
||||
GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
|
||||
RCC_USBCLKConfig(RCC_USBCLKSource_PLLCLK_1Div5);
|
||||
RCC_APB1PeriphClockCmd(RCC_APB1Periph_USB, ENABLE);
|
||||
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
|
||||
|
||||
// Pin SCLK
|
||||
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_SCLK;
|
||||
|
|
@ -375,6 +463,7 @@ void CIO::Init()
|
|||
#endif
|
||||
GPIO_Init(PORT_TXD, &GPIO_InitStruct);
|
||||
#if defined(DUPLEX)
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_TXD2;
|
||||
GPIO_Init(PORT_TXD2, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
|
|
@ -428,6 +517,12 @@ void CIO::Init()
|
|||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_Init(PORT_NXDN_LED, &GPIO_InitStruct);
|
||||
|
||||
// POCSAG LED
|
||||
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_POCSAG_LED;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_Out_PP;
|
||||
GPIO_Init(PORT_POCSAG_LED, &GPIO_InitStruct);
|
||||
|
||||
// PTT LED
|
||||
GPIO_InitStruct.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_PTT_LED;
|
||||
|
|
@ -454,7 +549,7 @@ void CIO::Init()
|
|||
EXTI_InitStructure.EXTI_Line = EXTI_Line14;
|
||||
#endif
|
||||
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS)
|
||||
|
||||
#if defined(BIDIR_DATA_PIN)
|
||||
// Connect EXTI3 Line
|
||||
|
|
@ -472,8 +567,12 @@ void CIO::Init()
|
|||
// Connect EXTI5 Line
|
||||
GPIO_EXTILineConfig(PORT_TXD2_INT, PIN_TXD2_INT);
|
||||
// Configure EXT5 line
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
|
||||
EXTI_InitStructure2.EXTI_Line = EXTI_Line8;
|
||||
#else
|
||||
EXTI_InitStructure2.EXTI_Line = EXTI_Line5;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -502,7 +601,7 @@ void CIO::startInt()
|
|||
|
||||
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;
|
||||
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV10)
|
||||
#elif defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(LIBRE_KIT_ADF7021) || defined(MMDVM_HS_HAT_REV12) || defined(MMDVM_HS_DUAL_HAT_REV10) || defined(NANO_HOTSPOT) || defined(NANO_DV_REV11) || defined(D2RG_MMDVM_HS) || defined(SKYBRIDGE_HS)
|
||||
|
||||
#if defined(BIDIR_DATA_PIN)
|
||||
// Enable and set EXTI3 Interrupt
|
||||
|
|
@ -652,13 +751,24 @@ void CIO::NXDN_pin(bool on)
|
|||
#endif
|
||||
}
|
||||
|
||||
void CIO::M17_pin(bool on)
|
||||
{
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
GPIO_WriteBit(PORT_DSTAR_LED, PIN_DSTAR_LED, on ? Bit_SET : Bit_RESET);
|
||||
GPIO_WriteBit(PORT_P25_LED, PIN_P25_LED, on ? Bit_SET : Bit_RESET);
|
||||
#else
|
||||
GPIO_WriteBit(PORT_M17_LED, PIN_M17_LED, on ? Bit_SET : Bit_RESET);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CIO::POCSAG_pin(bool on)
|
||||
{
|
||||
#if defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||
GPIO_WriteBit(PORT_DSTAR_LED, PIN_DSTAR_LED, on ? Bit_SET : Bit_RESET);
|
||||
GPIO_WriteBit(PORT_DMR_LED, PIN_DMR_LED, on ? Bit_SET : Bit_RESET);
|
||||
#else
|
||||
GPIO_WriteBit(PORT_POCSAG_LED, PIN_POCSAG_LED, on ? Bit_SET : Bit_RESET);
|
||||
#endif
|
||||
// TODO: add a separate LED pin for POCSAG mode
|
||||
}
|
||||
|
||||
void CIO::PTT_pin(bool on)
|
||||
|
|
@ -671,6 +781,19 @@ void CIO::COS_pin(bool on)
|
|||
GPIO_WriteBit(PORT_COS_LED, PIN_COS_LED, on ? Bit_SET : Bit_RESET);
|
||||
}
|
||||
|
||||
#if defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS)
|
||||
void CIO::setBandVHF(bool vhf_on) {
|
||||
GPIO_WriteBit(PORT_SET_BAND, PIN_SET_BAND, vhf_on ? Bit_SET : Bit_RESET);
|
||||
}
|
||||
|
||||
bool CIO::hasSingleADF7021() {
|
||||
return GPIO_ReadInputDataBit(PORT_SGL_DBL, PIN_SGL_DBL) == Bit_SET;
|
||||
}
|
||||
|
||||
bool CIO::isDualBand() {
|
||||
return GPIO_ReadInputDataBit(PORT_DL_DPX, PIN_DL_DPX) == Bit_SET;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Function delay_us() from stm32duino project
|
||||
|
|
|
|||
41
M17Defines.h
Normal file
41
M17Defines.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018,2020,2021 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(M17DEFINES_H)
|
||||
#define M17DEFINES_H
|
||||
|
||||
const unsigned int M17_RADIO_SYMBOL_LENGTH = 5U; // At 24 kHz sample rate
|
||||
|
||||
const unsigned int M17_FRAME_LENGTH_BITS = 384U;
|
||||
const unsigned int M17_FRAME_LENGTH_BYTES = M17_FRAME_LENGTH_BITS / 8U;
|
||||
|
||||
const unsigned int M17_SYNC_LENGTH_BITS = 16U;
|
||||
const unsigned int M17_SYNC_LENGTH_BYTES = M17_SYNC_LENGTH_BITS / 8U;
|
||||
|
||||
const uint8_t M17_LINK_SETUP_SYNC_BYTES[] = {0x55U, 0xF7U};
|
||||
const uint8_t M17_STREAM_SYNC_BYTES[] = {0xFFU, 0x5DU};
|
||||
const uint8_t M17_EOT_SYNC_BYTES[] = {0x55U, 0x5DU};
|
||||
|
||||
const uint8_t M17_SYNC_BYTES_LENGTH = 2U;
|
||||
|
||||
const uint16_t M17_LINK_SETUP_SYNC_BITS = 0x55F7U;
|
||||
const uint16_t M17_STREAM_SYNC_BITS = 0xFF5DU;
|
||||
const uint16_t M17_EOT_SYNC_BITS = 0x555DU;
|
||||
|
||||
#endif
|
||||
|
||||
203
M17RX.cpp
Normal file
203
M17RX.cpp
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2018,2020,2021 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016-2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "Globals.h"
|
||||
#include "M17RX.h"
|
||||
#include "Utils.h"
|
||||
|
||||
const uint8_t MAX_SYNC_BIT_START_ERRS = 0U;
|
||||
const uint8_t MAX_SYNC_BIT_RUN_ERRS = 2U;
|
||||
|
||||
const unsigned int MAX_SYNC_FRAMES = 3U + 1U;
|
||||
|
||||
const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U};
|
||||
|
||||
#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])
|
||||
|
||||
CM17RX::CM17RX() :
|
||||
m_state(M17RXS_NONE),
|
||||
m_bitBuffer(0x00U),
|
||||
m_outBuffer(),
|
||||
m_buffer(NULL),
|
||||
m_bufferPtr(0U),
|
||||
m_lostCount(0U)
|
||||
{
|
||||
m_buffer = m_outBuffer + 1U;
|
||||
}
|
||||
|
||||
void CM17RX::reset()
|
||||
{
|
||||
m_state = M17RXS_NONE;
|
||||
m_bitBuffer = 0x00U;
|
||||
m_bufferPtr = 0U;
|
||||
m_lostCount = 0U;
|
||||
}
|
||||
|
||||
void CM17RX::databit(bool bit)
|
||||
{
|
||||
switch (m_state) {
|
||||
case M17RXS_LINK_SETUP:
|
||||
case M17RXS_STREAM:
|
||||
processData(bit);
|
||||
break;
|
||||
default:
|
||||
processNone(bit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CM17RX::processNone(bool bit)
|
||||
{
|
||||
m_bitBuffer <<= 1;
|
||||
if (bit)
|
||||
m_bitBuffer |= 0x01U;
|
||||
|
||||
// Exact matching of the link setup sync bit sequence
|
||||
if (countBits16(m_bitBuffer ^ M17_LINK_SETUP_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
|
||||
DEBUG1("M17RX: link setup sync found in None");
|
||||
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
|
||||
m_buffer[i] = M17_LINK_SETUP_SYNC_BYTES[i];
|
||||
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
||||
m_state = M17RXS_LINK_SETUP;
|
||||
|
||||
io.setDecode(true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Exact matching of the stream sync bit sequence
|
||||
if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_START_ERRS) {
|
||||
DEBUG1("M17RX: stream sync found in None");
|
||||
for (uint8_t i = 0U; i < M17_SYNC_BYTES_LENGTH; i++)
|
||||
m_buffer[i] = M17_STREAM_SYNC_BYTES[i];
|
||||
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
||||
m_state = M17RXS_STREAM;
|
||||
|
||||
io.setDecode(true);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CM17RX::processData(bool bit)
|
||||
{
|
||||
m_bitBuffer <<= 1;
|
||||
if (bit)
|
||||
m_bitBuffer |= 0x01U;
|
||||
|
||||
WRITE_BIT1(m_buffer, m_bufferPtr, bit);
|
||||
|
||||
m_bufferPtr++;
|
||||
if (m_bufferPtr > M17_FRAME_LENGTH_BITS)
|
||||
reset();
|
||||
|
||||
// Only search for the syncs in the right place +-1 bit
|
||||
if (m_bufferPtr >= (M17_SYNC_LENGTH_BITS - 1U) && m_bufferPtr <= (M17_SYNC_LENGTH_BITS + 1U)) {
|
||||
// Fuzzy matching of the link setup sync bit sequence
|
||||
if (countBits16(m_bitBuffer ^ M17_LINK_SETUP_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
|
||||
DEBUG2("M17RX: found link setup sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
||||
m_state = M17RXS_LINK_SETUP;
|
||||
return;
|
||||
}
|
||||
|
||||
// Fuzzy matching of the stream sync bit sequence
|
||||
if (countBits16(m_bitBuffer ^ M17_STREAM_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
|
||||
DEBUG2("M17RX: found stream sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_bufferPtr = M17_SYNC_LENGTH_BITS;
|
||||
m_state = M17RXS_STREAM;
|
||||
return;
|
||||
}
|
||||
|
||||
// Fuzzy matching of the EOT sync bit sequence
|
||||
if (countBits16(m_bitBuffer ^ M17_EOT_SYNC_BITS) <= MAX_SYNC_BIT_RUN_ERRS) {
|
||||
DEBUG2("M17RX: found eot sync, pos", m_bufferPtr - M17_SYNC_LENGTH_BITS);
|
||||
io.setDecode(false);
|
||||
serial.writeM17EOT();
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Send a frame to the host if the required number of bits have been received
|
||||
if (m_bufferPtr == M17_FRAME_LENGTH_BITS) {
|
||||
// We've not seen a sync for too long, signal RXLOST and change to RX_NONE
|
||||
m_lostCount--;
|
||||
if (m_lostCount == 0U) {
|
||||
DEBUG1("M17RX: sync timed out, lost lock");
|
||||
io.setDecode(false);
|
||||
serial.writeM17Lost();
|
||||
reset();
|
||||
} else {
|
||||
// Write data to host
|
||||
m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
|
||||
|
||||
switch (m_state) {
|
||||
case M17RXS_LINK_SETUP:
|
||||
writeRSSILinkSetup(m_outBuffer);
|
||||
break;
|
||||
case M17RXS_STREAM:
|
||||
writeRSSIStream(m_outBuffer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Start the next frame
|
||||
::memset(m_outBuffer, 0x00U, M17_FRAME_LENGTH_BYTES + 3U);
|
||||
m_bufferPtr = 0U;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CM17RX::writeRSSILinkSetup(uint8_t* data)
|
||||
{
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
uint16_t rssi = io.readRSSI();
|
||||
|
||||
data[49U] = (rssi >> 8) & 0xFFU;
|
||||
data[50U] = (rssi >> 0) & 0xFFU;
|
||||
|
||||
serial.writeM17LinkSetup(data, M17_FRAME_LENGTH_BYTES + 3U);
|
||||
#else
|
||||
serial.writeM17LinkSetup(data, M17_FRAME_LENGTH_BYTES + 1U);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CM17RX::writeRSSIStream(uint8_t* data)
|
||||
{
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
uint16_t rssi = io.readRSSI();
|
||||
|
||||
data[49U] = (rssi >> 8) & 0xFFU;
|
||||
data[50U] = (rssi >> 0) & 0xFFU;
|
||||
|
||||
serial.writeM17Stream(data, M17_FRAME_LENGTH_BYTES + 3U);
|
||||
#else
|
||||
serial.writeM17Stream(data, M17_FRAME_LENGTH_BYTES + 1U);
|
||||
#endif
|
||||
}
|
||||
|
||||
54
M17RX.h
Normal file
54
M17RX.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (C) 2015-2018,2020,2021 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016-2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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(M17RX_H)
|
||||
#define M17RX_H
|
||||
|
||||
#include "M17Defines.h"
|
||||
|
||||
enum M17RX_STATE {
|
||||
M17RXS_NONE,
|
||||
M17RXS_LINK_SETUP,
|
||||
M17RXS_STREAM
|
||||
};
|
||||
|
||||
class CM17RX {
|
||||
public:
|
||||
CM17RX();
|
||||
|
||||
void databit(bool bit);
|
||||
|
||||
void reset();
|
||||
|
||||
private:
|
||||
M17RX_STATE m_state;
|
||||
uint16_t m_bitBuffer;
|
||||
uint8_t m_outBuffer[M17_FRAME_LENGTH_BYTES + 3U];
|
||||
uint8_t* m_buffer;
|
||||
uint16_t m_bufferPtr;
|
||||
uint16_t m_lostCount;
|
||||
|
||||
void processNone(bool bit);
|
||||
void processData(bool bit);
|
||||
void writeRSSILinkSetup(uint8_t* data);
|
||||
void writeRSSIStream(uint8_t* data);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
124
M17TX.cpp
Normal file
124
M17TX.cpp
Normal file
|
|
@ -0,0 +1,124 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2018,2020,2021 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2017 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "Config.h"
|
||||
#include "Globals.h"
|
||||
#include "M17TX.h"
|
||||
|
||||
#include "M17Defines.h"
|
||||
|
||||
const uint8_t M17_SYNC = 0x77U;
|
||||
const uint8_t M17_PREAMBLE = 0x77U;
|
||||
|
||||
CM17TX::CM17TX() :
|
||||
m_buffer(1500U),
|
||||
m_poBuffer(),
|
||||
m_poLen(0U),
|
||||
m_poPtr(0U),
|
||||
m_txDelay(240U), // 200ms
|
||||
m_delay(false)
|
||||
{
|
||||
}
|
||||
|
||||
void CM17TX::process()
|
||||
{
|
||||
if (m_buffer.getData() == 0U && m_poLen == 0U)
|
||||
return;
|
||||
|
||||
if (m_poLen == 0U) {
|
||||
if (!m_tx) {
|
||||
m_delay = true;
|
||||
m_poLen = m_txDelay;
|
||||
} else {
|
||||
m_delay = false;
|
||||
for (uint8_t i = 0U; i < M17_FRAME_LENGTH_BYTES; i++)
|
||||
m_poBuffer[m_poLen++] = m_buffer.get();
|
||||
}
|
||||
|
||||
m_poPtr = 0U;
|
||||
}
|
||||
|
||||
if (m_poLen > 0U) {
|
||||
uint16_t space = io.getSpace();
|
||||
|
||||
while (space > 8U) {
|
||||
if (m_delay) {
|
||||
writeByte(M17_SYNC);
|
||||
m_poPtr++;
|
||||
} else
|
||||
writeByte(m_poBuffer[m_poPtr++]);
|
||||
|
||||
space -= 8U;
|
||||
|
||||
if (m_poPtr >= m_poLen) {
|
||||
if (m_delay) {
|
||||
m_delay = false;
|
||||
m_poPtr = 0U;
|
||||
m_poLen = 3U;
|
||||
} else {
|
||||
m_poPtr = 0U;
|
||||
m_poLen = 0U;
|
||||
m_delay = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t CM17TX::writeData(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
if (length != (M17_FRAME_LENGTH_BYTES + 1U))
|
||||
return 4U;
|
||||
|
||||
uint16_t space = m_buffer.getSpace();
|
||||
if (space < M17_FRAME_LENGTH_BYTES)
|
||||
return 5U;
|
||||
|
||||
for (uint8_t i = 0U; i < M17_FRAME_LENGTH_BYTES; i++)
|
||||
m_buffer.put(data[i + 1U]);
|
||||
|
||||
return 0U;
|
||||
}
|
||||
|
||||
void CM17TX::writeByte(uint8_t c)
|
||||
{
|
||||
uint8_t bit;
|
||||
uint8_t mask = 0x80U;
|
||||
|
||||
for (uint8_t i = 0U; i < 8U; i++, c <<= 1) {
|
||||
if ((c & mask) == mask)
|
||||
bit = 1U;
|
||||
else
|
||||
bit = 0U;
|
||||
|
||||
io.write(&bit, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void CM17TX::setTXDelay(uint8_t delay)
|
||||
{
|
||||
m_txDelay = 600U + uint16_t(delay) * 12U; // 500ms + tx delay
|
||||
}
|
||||
|
||||
uint8_t CM17TX::getSpace() const
|
||||
{
|
||||
return m_buffer.getSpace() / M17_FRAME_LENGTH_BYTES;
|
||||
}
|
||||
|
||||
50
M17TX.h
Normal file
50
M17TX.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016,2017,2020,2021 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(M17TX_H)
|
||||
#define M17TX_H
|
||||
|
||||
#include "Config.h"
|
||||
|
||||
#include "SerialRB.h"
|
||||
|
||||
class CM17TX {
|
||||
public:
|
||||
CM17TX();
|
||||
|
||||
uint8_t writeData(const uint8_t* data, uint8_t length);
|
||||
|
||||
void process();
|
||||
|
||||
void setTXDelay(uint8_t delay);
|
||||
|
||||
uint8_t getSpace() const;
|
||||
|
||||
private:
|
||||
CSerialRB m_buffer;
|
||||
uint8_t m_poBuffer[1200U];
|
||||
uint16_t m_poLen;
|
||||
uint16_t m_poPtr;
|
||||
uint16_t m_txDelay;
|
||||
bool m_delay;
|
||||
|
||||
void writeByte(uint8_t c);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
18
MMDVM_HS.cpp
18
MMDVM_HS.cpp
|
|
@ -1,8 +1,9 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016 by Mathis Schmieder DB9MAT
|
||||
* Copyright (C) 2016 by Colin Durbridge G4EML
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2019 by Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -42,6 +43,7 @@ bool m_dmrEnable = true;
|
|||
bool m_ysfEnable = true;
|
||||
bool m_p25Enable = true;
|
||||
bool m_nxdnEnable = true;
|
||||
bool m_m17Enable = true;
|
||||
bool m_pocsagEnable = true;
|
||||
|
||||
bool m_duplex = false;
|
||||
|
|
@ -69,6 +71,9 @@ CYSFTX ysfTX;
|
|||
CP25RX p25RX;
|
||||
CP25TX p25TX;
|
||||
|
||||
CM17RX m17RX;
|
||||
CM17TX m17TX;
|
||||
|
||||
CNXDNRX nxdnRX;
|
||||
CNXDNTX nxdnTX;
|
||||
|
||||
|
|
@ -85,6 +90,10 @@ CCWIdTX cwIdTX;
|
|||
CSerialPort serial;
|
||||
CIO io;
|
||||
|
||||
#if defined(STM32_I2C_HOST)
|
||||
CI2CHost i2c;
|
||||
#endif
|
||||
|
||||
void setup()
|
||||
{
|
||||
serial.start();
|
||||
|
|
@ -120,10 +129,13 @@ void loop()
|
|||
if (m_nxdnEnable && m_modemState == STATE_NXDN)
|
||||
nxdnTX.process();
|
||||
|
||||
if (m_m17Enable && m_modemState == STATE_M17)
|
||||
m17TX.process();
|
||||
|
||||
if (m_pocsagEnable && (m_modemState == STATE_POCSAG || pocsagTX.busy()))
|
||||
pocsagTX.process();
|
||||
|
||||
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K)
|
||||
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K || m_calState == STATE_INTCAL)
|
||||
calDMR.process();
|
||||
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
|
|
|
|||
11
MMDVM_HS.ino
11
MMDVM_HS.ino
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016 by Colin Durbridge G4EML
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
*
|
||||
|
|
@ -38,6 +38,7 @@ bool m_dmrEnable = true;
|
|||
bool m_ysfEnable = true;
|
||||
bool m_p25Enable = true;
|
||||
bool m_nxdnEnable = true;
|
||||
bool m_m17Enable = true;
|
||||
bool m_pocsagEnable = true;
|
||||
|
||||
bool m_duplex = false;
|
||||
|
|
@ -65,6 +66,9 @@ CYSFTX ysfTX;
|
|||
CP25RX p25RX;
|
||||
CP25TX p25TX;
|
||||
|
||||
CM17RX m17RX;
|
||||
CM17TX m17TX;
|
||||
|
||||
CNXDNRX nxdnRX;
|
||||
CNXDNTX nxdnTX;
|
||||
|
||||
|
|
@ -115,10 +119,13 @@ void loop()
|
|||
if (m_nxdnEnable && m_modemState == STATE_NXDN)
|
||||
nxdnTX.process();
|
||||
|
||||
if (m_m17Enable && m_modemState == STATE_M17)
|
||||
m17TX.process();
|
||||
|
||||
if (m_pocsagEnable && (m_modemState == STATE_POCSAG || pocsagTX.busy()))
|
||||
pocsagTX.process();
|
||||
|
||||
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K)
|
||||
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K || m_calState == STATE_INTCAL)
|
||||
calDMR.process();
|
||||
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
|
|
|
|||
131
Makefile
131
Makefile
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2016 by Jim McLaughlin KI6ZUM
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -40,6 +40,9 @@ BINBIN_F1=mmdvm_f1.bin
|
|||
BINELF_F1BL=mmdvm_f1bl.elf
|
||||
BINHEX_F1BL=mmdvm_f1bl.hex
|
||||
BINBIN_F1BL=mmdvm_f1bl.bin
|
||||
BINELF_F1NOBL=mmdvm_f1nobl.elf
|
||||
BINHEX_F1NOBL=mmdvm_f1nobl.hex
|
||||
BINBIN_F1NOBL=mmdvm_f1nobl.bin
|
||||
BINELF_F4=mmdvm_f4.elf
|
||||
BINHEX_F4=mmdvm_f4.hex
|
||||
BINBIN_F4=mmdvm_f4.bin
|
||||
|
|
@ -103,14 +106,24 @@ ifeq ($(OS),Windows_NT)
|
|||
DFU_UTIL=./$(F1_LIB_PATH)/utils/win/dfu-util.exe
|
||||
STM32FLASH=./$(F1_LIB_PATH)/utils/win/stm32flash.exe
|
||||
else
|
||||
CLEANCMD=rm -f $(OBJ_F1BL) $(OBJ_F4) $(OBJ_F7) $(BINDIR)/*.hex $(BINDIR)/mmdvm_f1.bin $(BINDIR)/*.elf
|
||||
CLEANCMD=rm -f $(OBJ_F1BL) $(OBJ_F4) $(OBJ_F7) $(BINDIR)/*.hex $(BINDIR)/mmdvm_f1.bin $(BINDIR)/mmdvm_f1bl.bin $(BINDIR)/mmdvm_f1nobl.bin $(BINDIR)/*.elf
|
||||
MDDIRS=mkdir $@
|
||||
|
||||
ifeq ($(shell uname -s),Linux)
|
||||
ST_FLASH_ON_PATH=$(shell which st-flash)
|
||||
ST_FLASH_IS_ON_PATH=$(.SHELLSTATUS)
|
||||
ifeq ($(shell uname -m),x86_64)
|
||||
DFU_RST=./$(F1_LIB_PATH)/utils/linux64/upload-reset
|
||||
DFU_UTIL=./$(F1_LIB_PATH)/utils/linux64/dfu-util
|
||||
DFU_RST=./$(F1_LIB_PATH)/utils/linux64/upload-reset
|
||||
DFU_UTIL=./$(F1_LIB_PATH)/utils/linux64/dfu-util
|
||||
ifeq ($(ST_FLASH_IS_ON_PATH),0)
|
||||
ST_FLASH=$(ST_FLASH_ON_PATH)
|
||||
ST_FLASH_OPTS=--flash=128k
|
||||
else
|
||||
ST_FLASH=./$(F1_LIB_PATH)/utils/linux64/st-flash
|
||||
ST_FLASH_OPTS=
|
||||
endif
|
||||
STM32FLASH=./$(F1_LIB_PATH)/utils/linux64/stm32flash
|
||||
else ifeq ($(shell uname -m),armv7l)
|
||||
DFU_RST=./$(F1_LIB_PATH)/utils/rpi32/upload-reset
|
||||
|
|
@ -125,7 +138,13 @@ else
|
|||
else
|
||||
DFU_RST=./$(F1_LIB_PATH)/utils/linux/upload-reset
|
||||
DFU_UTIL=./$(F1_LIB_PATH)/utils/linux/dfu-util
|
||||
ifeq ($(ST_FLASH_IS_ON_PATH),0)
|
||||
ST_FLASH=$(ST_FLASH_ON_PATH)
|
||||
ST_FLASH_OPTS=--flash=128k
|
||||
else
|
||||
ST_FLASH=./$(F1_LIB_PATH)/utils/linux/st-flash
|
||||
ST_FLASH_OPTS=
|
||||
endif
|
||||
STM32FLASH=./$(F1_LIB_PATH)/utils/linux/stm32flash
|
||||
endif
|
||||
endif
|
||||
|
|
@ -200,7 +219,7 @@ CXXFLAGS=-Os -fno-exceptions -ffunction-sections -fdata-sections -nostdlib -fno-
|
|||
LDFLAGS=-Os --specs=nano.specs --specs=nosys.specs
|
||||
|
||||
# Build Rules
|
||||
.PHONY: all release_f1 release_f4 release_f7 hs bl pi-f4 f446 f767 clean
|
||||
.PHONY: all release_f1 release_f4 release_f7 hs bl nobl pi-f4 f446 f767 clean
|
||||
|
||||
all: hs
|
||||
|
||||
|
|
@ -229,6 +248,11 @@ bl: CXXFLAGS+=$(CXXFLAGS_F1) $(DEFS_F1_HS_BL)
|
|||
bl: LDFLAGS+=$(LDFLAGS_F1_BL)
|
||||
bl: release_f1bl
|
||||
|
||||
nobl: CFLAGS+=$(CFLAGS_F1) $(DEFS_F1_HS)
|
||||
nobl: CXXFLAGS+=$(CXXFLAGS_F1) $(DEFS_F1_HS)
|
||||
nobl: LDFLAGS+=$(LDFLAGS_F1_N)
|
||||
nobl: release_f1nobl
|
||||
|
||||
release_f1: GitVersion.h
|
||||
release_f1: $(BINDIR)
|
||||
release_f1: $(OBJDIR_F1)
|
||||
|
|
@ -241,6 +265,12 @@ release_f1bl: $(OBJDIR_F1)
|
|||
release_f1bl: $(BINDIR)/$(BINHEX_F1BL)
|
||||
release_f1bl: $(BINDIR)/$(BINBIN_F1BL)
|
||||
|
||||
release_f1nobl: GitVersion.h
|
||||
release_f1nobl: $(BINDIR)
|
||||
release_f1nobl: $(OBJDIR_F1)
|
||||
release_f1nobl: $(BINDIR)/$(BINHEX_F1NOBL)
|
||||
release_f1nobl: $(BINDIR)/$(BINBIN_F1NOBL)
|
||||
|
||||
release_f4: GitVersion.h
|
||||
release_f4: $(BINDIR)
|
||||
release_f4: $(OBJDIR_F4)
|
||||
|
|
@ -278,6 +308,19 @@ $(BINDIR)/$(BINELF_F1BL): $(OBJ_F1BL)
|
|||
@echo "Linking complete!\n"
|
||||
$(SIZE) $(BINDIR)/$(BINELF_F1BL)
|
||||
|
||||
$(BINDIR)/$(BINHEX_F1NOBL): $(BINDIR)/$(BINELF_F1NOBL)
|
||||
$(CP) -O ihex $< $@
|
||||
@echo "Objcopy from ELF to IHEX complete!\n"
|
||||
|
||||
$(BINDIR)/$(BINBIN_F1NOBL): $(BINDIR)/$(BINELF_F1NOBL)
|
||||
$(CP) -O binary $< $@
|
||||
@echo "Objcopy from ELF to BINARY complete!\n"
|
||||
|
||||
$(BINDIR)/$(BINELF_F1NOBL): $(OBJ_F1BL)
|
||||
$(CXX) $(OBJ_F1BL) $(LDFLAGS) -o $@
|
||||
@echo "Linking complete!\n"
|
||||
$(SIZE) $(BINDIR)/$(BINELF_F1NOBL)
|
||||
|
||||
$(BINDIR)/$(BINHEX_F1): $(BINDIR)/$(BINELF_F1)
|
||||
$(CP) -O ihex $< $@
|
||||
@echo "Objcopy from ELF to IHEX complete!\n"
|
||||
|
|
@ -378,17 +421,35 @@ clean:
|
|||
$(RM) GitVersion.h
|
||||
|
||||
stlink:
|
||||
$(ST_FLASH) write bin/$(BINBIN_F1) 0x8000000
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1) 0x8000000
|
||||
|
||||
stlink-nobl:
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1NOBL) 0x8000000
|
||||
|
||||
stlink-bl:
|
||||
$(ST_FLASH) write $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin 0x8000000
|
||||
$(ST_FLASH) write bin/$(BINBIN_F1BL) 0x8002000
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin 0x8000000
|
||||
sleep 3
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1BL) 0x8002000
|
||||
|
||||
stlink-bl-old:
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin 0x8000000
|
||||
sleep 3
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1BL) 0x8002000
|
||||
|
||||
serial:
|
||||
$(STM32FLASH) -v -w bin/$(BINBIN_F1) -g 0x0 $(devser)
|
||||
|
||||
serial-nobl:
|
||||
$(STM32FLASH) -v -w bin/$(BINBIN_F1NOBL) -g 0x0 $(devser)
|
||||
|
||||
serial-bl:
|
||||
$(STM32FLASH) -v -w $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin -g 0x0 $(devser)
|
||||
sleep 3
|
||||
$(STM32FLASH) -v -w bin/$(BINBIN_F1BL) -g 0x0 -S 0x08002000 $(devser)
|
||||
|
||||
serial-bl-old:
|
||||
$(STM32FLASH) -v -w $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin -g 0x0 $(devser)
|
||||
sleep 3
|
||||
$(STM32FLASH) -v -w bin/$(BINBIN_F1BL) -g 0x0 -S 0x08002000 $(devser)
|
||||
|
||||
nano-hotspot:
|
||||
|
|
@ -402,11 +463,20 @@ endif
|
|||
|
||||
nano-dv:
|
||||
ifneq ($(wildcard /usr/local/bin/stm32flash),)
|
||||
/usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 67,-66,66:-67,66 /dev/ttyAMA0
|
||||
/usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 66,-67,67:-66,67 /dev/ttyAMA0
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /usr/bin/stm32flash),)
|
||||
/usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 67,-66,66:-67,66 /dev/ttyAMA0
|
||||
/usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 66,-67,67:-66,67 /dev/ttyAMA0
|
||||
endif
|
||||
|
||||
d2rg_mmdvm_hs:
|
||||
ifneq ($(wildcard /usr/local/bin/stm32flash),)
|
||||
/usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 23,-22,22:-23,22 /dev/ttySC0
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /usr/bin/stm32flash),)
|
||||
/usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 23,-22,22:-23,22 /dev/ttySC0
|
||||
endif
|
||||
|
||||
zumspot-pi:
|
||||
|
|
@ -422,6 +492,21 @@ mmdvm_hs_hat: zumspot-pi
|
|||
|
||||
mmdvm_hs_dual_hat: zumspot-pi
|
||||
|
||||
skybridge: zumspot-pi
|
||||
|
||||
hotpot-opipc_opipcplus:
|
||||
ifneq ($(wildcard /usr/local/bin/stm32flash),)
|
||||
/usr/local/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /usr/bin/stm32flash),)
|
||||
/usr/bin/stm32flash -v -w bin/$(BINBIN_F1) -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3
|
||||
endif
|
||||
|
||||
mmdvm_hs_hat_opi: hotpot-opipc_opipcplus
|
||||
|
||||
mmdvm_hs_dual_hat_opi: hotpot-opipc_opipcplus
|
||||
|
||||
dfu:
|
||||
ifdef devser
|
||||
$(DFU_RST) $(devser) 750
|
||||
|
|
@ -441,7 +526,36 @@ ifneq ($(wildcard /opt/openocd/bin/openocd),)
|
|||
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1) verify reset exit"
|
||||
endif
|
||||
|
||||
ocd-nobl:
|
||||
ifneq ($(wildcard /usr/bin/openocd),)
|
||||
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1NOBL) verify reset exit"
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /usr/local/bin/openocd),)
|
||||
/usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1NOBL) verify reset exit"
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /opt/openocd/bin/openocd),)
|
||||
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINELF_F1NOBL) verify reset exit"
|
||||
endif
|
||||
|
||||
ocd-bl:
|
||||
ifneq ($(wildcard /usr/bin/openocd),)
|
||||
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin verify reset exit 0x08000000"
|
||||
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /usr/local/bin/openocd),)
|
||||
/usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin verify reset exit 0x08000000"
|
||||
/usr/local/bin/openocd -f /usr/local/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/local/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard /opt/openocd/bin/openocd),)
|
||||
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.bin verify reset exit 0x08000000"
|
||||
/opt/openocd/bin/openocd -f /opt/openocd/scripts/interface/stlink-v2-1.cfg -f /opt/openocd/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
|
||||
endif
|
||||
|
||||
ocd-bl-old:
|
||||
ifneq ($(wildcard /usr/bin/openocd),)
|
||||
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13.bin verify reset exit 0x08000000"
|
||||
/usr/bin/openocd -f /usr/share/openocd/scripts/interface/stlink-v2-1.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -c "program bin/$(BINBIN_F1BL) verify reset exit 0x08002000"
|
||||
|
|
@ -472,4 +586,3 @@ endif
|
|||
endif
|
||||
|
||||
.FORCE:
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -19,16 +20,10 @@
|
|||
#if !defined(NXDNDEFINES_H)
|
||||
#define NXDNDEFINES_H
|
||||
|
||||
const unsigned int NXDN_RADIO_SYMBOL_LENGTH = 10U; // At 24 kHz sample rate
|
||||
|
||||
const unsigned int NXDN_FRAME_LENGTH_BITS = 384U;
|
||||
const unsigned int NXDN_FRAME_LENGTH_BYTES = NXDN_FRAME_LENGTH_BITS / 8U;
|
||||
const unsigned int NXDN_FRAME_LENGTH_SYMBOLS = NXDN_FRAME_LENGTH_BITS / 2U;
|
||||
const unsigned int NXDN_FRAME_LENGTH_SAMPLES = NXDN_FRAME_LENGTH_SYMBOLS * NXDN_RADIO_SYMBOL_LENGTH;
|
||||
|
||||
const unsigned int NXDN_FSW_LENGTH_BITS = 20U;
|
||||
const unsigned int NXDN_FSW_LENGTH_SYMBOLS = NXDN_FSW_LENGTH_BITS / 2U;
|
||||
const unsigned int NXDN_FSW_LENGTH_SAMPLES = NXDN_FSW_LENGTH_SYMBOLS * NXDN_RADIO_SYMBOL_LENGTH;
|
||||
|
||||
const uint8_t NXDN_FSW_BYTES[] = {0xCDU, 0xF5U, 0x90U};
|
||||
const uint8_t NXDN_FSW_BYTES_MASK[] = {0xFFU, 0xFFU, 0xF0U};
|
||||
|
|
@ -37,14 +32,4 @@ const uint8_t NXDN_FSW_BYTES_LENGTH = 3U;
|
|||
const uint32_t NXDN_FSW_BITS = 0x000CDF59U;
|
||||
const uint32_t NXDN_FSW_BITS_MASK = 0x000FFFFFU;
|
||||
|
||||
// C D F 5 9
|
||||
// 11 00 11 01 11 11 01 01 10 01
|
||||
// -3 +1 -3 +3 -3 -3 +3 +3 -1 +3
|
||||
|
||||
const int8_t NXDN_FSW_SYMBOLS_VALUES[] = {-3, +1, -3, +3, -3, -3, +3, +3, -1, +3};
|
||||
|
||||
const uint16_t NXDN_FSW_SYMBOLS = 0x014DU;
|
||||
const uint16_t NXDN_FSW_SYMBOLS_MASK = 0x03FFU;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
12
NXDNRX.cpp
12
NXDNRX.cpp
|
|
@ -32,7 +32,6 @@ const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02
|
|||
#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])
|
||||
|
||||
CNXDNRX::CNXDNRX() :
|
||||
m_prev(false),
|
||||
m_state(NXDNRXS_NONE),
|
||||
m_bitBuffer(0x00U),
|
||||
m_outBuffer(),
|
||||
|
|
@ -45,7 +44,6 @@ m_lostCount(0U)
|
|||
|
||||
void CNXDNRX::reset()
|
||||
{
|
||||
m_prev = false;
|
||||
m_state = NXDNRXS_NONE;
|
||||
m_bitBuffer = 0x00U;
|
||||
m_bufferPtr = 0U;
|
||||
|
|
@ -77,7 +75,6 @@ void CNXDNRX::processNone(bool bit)
|
|||
m_state = NXDNRXS_DATA;
|
||||
|
||||
io.setDecode(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -89,7 +86,10 @@ void CNXDNRX::processData(bool bit)
|
|||
m_bitBuffer |= 0x01U;
|
||||
|
||||
WRITE_BIT1(m_buffer, m_bufferPtr, bit);
|
||||
|
||||
m_bufferPtr++;
|
||||
if (m_bufferPtr > NXDN_FRAME_LENGTH_BITS)
|
||||
reset();
|
||||
|
||||
// Only search for a sync in the right place +-2 symbols
|
||||
if (m_bufferPtr >= (NXDN_FSW_LENGTH_BITS - 2U) && m_bufferPtr <= (NXDN_FSW_LENGTH_BITS + 2U)) {
|
||||
|
|
@ -108,13 +108,11 @@ void CNXDNRX::processData(bool bit)
|
|||
if (m_lostCount == 0U) {
|
||||
DEBUG1("NXDNRX: sync timed out, lost lock");
|
||||
io.setDecode(false);
|
||||
|
||||
serial.writeNXDNLost();
|
||||
|
||||
m_state = NXDNRXS_NONE;
|
||||
reset();
|
||||
} else {
|
||||
// Write data to host
|
||||
m_outBuffer[0U] = m_lostCount == (MAX_FSW_FRAMES - 1U) ? 0x01U : 0x00U;
|
||||
|
||||
writeRSSIData(m_outBuffer);
|
||||
|
||||
// Start the next frame
|
||||
|
|
|
|||
2
NXDNRX.h
2
NXDNRX.h
|
|
@ -36,7 +36,6 @@ public:
|
|||
void reset();
|
||||
|
||||
private:
|
||||
bool m_prev;
|
||||
NXDNRX_STATE m_state;
|
||||
uint64_t m_bitBuffer;
|
||||
uint8_t m_outBuffer[NXDN_FRAME_LENGTH_BYTES + 3U];
|
||||
|
|
@ -51,4 +50,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
29
P25Defines.h
29
P25Defines.h
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -21,26 +22,27 @@
|
|||
|
||||
const unsigned int P25_HDR_FRAME_LENGTH_BYTES = 99U;
|
||||
const unsigned int P25_HDR_FRAME_LENGTH_BITS = P25_HDR_FRAME_LENGTH_BYTES * 8U;
|
||||
const unsigned int P25_HDR_FRAME_LENGTH_SYMBOLS = P25_HDR_FRAME_LENGTH_BYTES * 4U;
|
||||
|
||||
const unsigned int P25_LDU_FRAME_LENGTH_BYTES = 216U;
|
||||
const unsigned int P25_LDU_FRAME_LENGTH_BITS = P25_LDU_FRAME_LENGTH_BYTES * 8U;
|
||||
const unsigned int P25_LDU_FRAME_LENGTH_SYMBOLS = P25_LDU_FRAME_LENGTH_BYTES * 4U;
|
||||
|
||||
const unsigned int P25_TERMLC_FRAME_LENGTH_BYTES = 54U;
|
||||
const unsigned int P25_TERMLC_FRAME_LENGTH_BITS = P25_TERMLC_FRAME_LENGTH_BYTES * 8U;
|
||||
const unsigned int P25_TERMLC_FRAME_LENGTH_SYMBOLS = P25_TERMLC_FRAME_LENGTH_BYTES * 4U;
|
||||
|
||||
const unsigned int P25_TERM_FRAME_LENGTH_BYTES = 18U;
|
||||
const unsigned int P25_TERM_FRAME_LENGTH_BITS = P25_TERM_FRAME_LENGTH_BYTES * 8U;
|
||||
const unsigned int P25_TERM_FRAME_LENGTH_SYMBOLS = P25_TERM_FRAME_LENGTH_BYTES * 4U;
|
||||
|
||||
const unsigned int P25_TSDU_FRAME_LENGTH_BYTES = 45U;
|
||||
const unsigned int P25_TSDU_FRAME_LENGTH_BITS = P25_TSDU_FRAME_LENGTH_BYTES * 8U;
|
||||
|
||||
const unsigned int P25_PDU_HDR_FRAME_LENGTH_BYTES = 45U;
|
||||
const unsigned int P25_PDU_HDR_FRAME_LENGTH_BITS = P25_PDU_HDR_FRAME_LENGTH_BYTES * 8U;
|
||||
|
||||
const unsigned int P25_SYNC_LENGTH_BYTES = 6U;
|
||||
const unsigned int P25_SYNC_LENGTH_BITS = P25_SYNC_LENGTH_BYTES * 8U;
|
||||
const unsigned int P25_SYNC_LENGTH_SYMBOLS = P25_SYNC_LENGTH_BYTES * 4U;
|
||||
|
||||
const unsigned int P25_NID_LENGTH_BITS = 64U;
|
||||
const unsigned int P25_NID_LENGTH_SYMBOLS = 32U;
|
||||
const unsigned int P25_NID_LENGTH_BYTES = 8U;
|
||||
const unsigned int P25_NID_LENGTH_BITS = P25_NID_LENGTH_BYTES * 8U;
|
||||
|
||||
const uint8_t P25_SYNC_BYTES[] = {0x55U, 0x75U, 0xF5U, 0xFFU, 0x77U, 0xFFU};
|
||||
const uint8_t P25_SYNC_BYTES_LENGTH = 6U;
|
||||
|
|
@ -48,11 +50,12 @@ const uint8_t P25_SYNC_BYTES_LENGTH = 6U;
|
|||
const uint64_t P25_SYNC_BITS = 0x00005575F5FF77FFU;
|
||||
const uint64_t P25_SYNC_BITS_MASK = 0x0000FFFFFFFFFFFFU;
|
||||
|
||||
// 5 5 7 5 F 5 F F 7 7 F F
|
||||
// 01 01 01 01 01 11 01 01 11 11 01 01 11 11 11 11 01 11 01 11 11 11 11 11
|
||||
// +3 +3 +3 +3 +3 -3 +3 +3 -3 -3 +3 +3 -3 -3 -3 -3 +3 -3 +3 -3 -3 -3 -3 -3
|
||||
|
||||
const uint32_t P25_SYNC_SYMBOLS = 0x00FB30A0U;
|
||||
const uint32_t P25_SYNC_SYMBOLS_MASK = 0x00FFFFFFU;
|
||||
const uint8_t P25_DUID_HDU = 0x00U; // Header Data Unit
|
||||
const uint8_t P25_DUID_TDU = 0x03U; // Simple Terminator Data Unit
|
||||
const uint8_t P25_DUID_LDU1 = 0x05U; // Logical Link Data Unit 1
|
||||
const uint8_t P25_DUID_TSDU = 0x07U; // Trunking System Data Unit
|
||||
const uint8_t P25_DUID_LDU2 = 0x0AU; // Logical Link Data Unit 2
|
||||
const uint8_t P25_DUID_PDU = 0x0CU; // Packet Data Unit
|
||||
const uint8_t P25_DUID_TDULC = 0x0FU; // Terminator Data Unit with Link Control
|
||||
|
||||
#endif
|
||||
|
|
|
|||
129
P25RX.cpp
129
P25RX.cpp
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2016,2017 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -31,33 +31,44 @@ const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02
|
|||
|
||||
#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])
|
||||
|
||||
const uint16_t NOENDPTR = 9999U;
|
||||
|
||||
CP25RX::CP25RX() :
|
||||
m_prev(false),
|
||||
m_state(P25RXS_NONE),
|
||||
m_bitBuffer(0x00U),
|
||||
m_outBuffer(),
|
||||
m_buffer(NULL),
|
||||
m_bufferPtr(0U),
|
||||
m_lostCount(0U)
|
||||
m_endPtr(NOENDPTR),
|
||||
m_lostCount(0U),
|
||||
m_duid(0U)
|
||||
{
|
||||
m_buffer = m_outBuffer + 1U;
|
||||
}
|
||||
|
||||
void CP25RX::reset()
|
||||
{
|
||||
m_prev = false;
|
||||
m_state = P25RXS_NONE;
|
||||
m_bitBuffer = 0x00U;
|
||||
m_bufferPtr = 0U;
|
||||
m_endPtr = NOENDPTR;
|
||||
m_lostCount = 0U;
|
||||
m_duid = 0U;
|
||||
}
|
||||
|
||||
void CP25RX::databit(bool bit)
|
||||
{
|
||||
if (m_state == P25RXS_NONE)
|
||||
switch (m_state) {
|
||||
case P25RXS_HDR:
|
||||
processHdr(bit);
|
||||
break;
|
||||
case P25RXS_LDU:
|
||||
processLdu(bit);
|
||||
break;
|
||||
default:
|
||||
processNone(bit);
|
||||
else
|
||||
processData(bit);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CP25RX::processNone(bool bit)
|
||||
|
|
@ -74,69 +85,103 @@ void CP25RX::processNone(bool bit)
|
|||
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_bufferPtr = P25_SYNC_LENGTH_BITS;
|
||||
m_state = P25RXS_DATA;
|
||||
m_state = P25RXS_HDR;
|
||||
|
||||
io.setDecode(true);
|
||||
}
|
||||
}
|
||||
|
||||
void CP25RX::processData(bool bit)
|
||||
void CP25RX::processHdr(bool bit)
|
||||
{
|
||||
m_bitBuffer <<= 1;
|
||||
if (bit)
|
||||
m_bitBuffer |= 0x01U;
|
||||
|
||||
WRITE_BIT1(m_buffer, m_bufferPtr, bit);
|
||||
|
||||
m_bufferPtr++;
|
||||
if (m_bufferPtr > P25_LDU_FRAME_LENGTH_BITS)
|
||||
reset();
|
||||
|
||||
// Search for an early sync to indicate an LDU following a header
|
||||
if (m_bufferPtr >= (P25_HDR_FRAME_LENGTH_BITS + P25_SYNC_LENGTH_BITS - 1U) && m_bufferPtr <= (P25_HDR_FRAME_LENGTH_BITS + P25_SYNC_LENGTH_BITS + 1U)) {
|
||||
// Fuzzy matching of the data sync bit sequence
|
||||
if (countBits64((m_bitBuffer & P25_SYNC_BITS_MASK) ^ P25_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) {
|
||||
DEBUG2("P25RX: found LDU sync in Data, pos", m_bufferPtr - P25_SYNC_LENGTH_BITS);
|
||||
if (m_bufferPtr == P25_SYNC_LENGTH_BITS + 16U) {
|
||||
// FIXME: we should check and correct for errors in NID first!
|
||||
m_duid = m_buffer[7U] & 0x0F;
|
||||
|
||||
if (m_duid != P25_DUID_HDU && m_duid != P25_DUID_TSDU &&
|
||||
m_duid != P25_DUID_TDU && m_duid != P25_DUID_TDULC) {
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_state = P25RXS_LDU;
|
||||
return;
|
||||
}
|
||||
|
||||
setEndPtr();
|
||||
DEBUG2("P25RX: DUID", m_duid);
|
||||
}
|
||||
|
||||
// Search for end of header frame
|
||||
if (m_bufferPtr == m_endPtr) {
|
||||
m_outBuffer[0U] = 0x01U;
|
||||
serial.writeP25Hdr(m_outBuffer, P25_HDR_FRAME_LENGTH_BYTES + 1U);
|
||||
|
||||
// Restore the sync that's now in the wrong place
|
||||
for (uint8_t i = 0U; i < P25_SYNC_LENGTH_BYTES; i++)
|
||||
m_buffer[i] = P25_SYNC_BYTES[i];
|
||||
serial.writeP25Hdr(m_outBuffer, (m_endPtr / 8U) + 1U);
|
||||
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_bufferPtr = P25_SYNC_LENGTH_BITS;
|
||||
m_bufferPtr = 0U;
|
||||
m_state = P25RXS_LDU;
|
||||
}
|
||||
}
|
||||
|
||||
// Only search for a sync in the right place +-2 symbols
|
||||
void CP25RX::processLdu(bool bit)
|
||||
{
|
||||
m_bitBuffer <<= 1;
|
||||
if (bit)
|
||||
m_bitBuffer |= 0x01U;
|
||||
|
||||
WRITE_BIT1(m_buffer, m_bufferPtr, bit);
|
||||
|
||||
m_bufferPtr++;
|
||||
if (m_bufferPtr > P25_LDU_FRAME_LENGTH_BITS)
|
||||
reset();
|
||||
|
||||
// Only search for a sync in the right place +-2 bits
|
||||
if (m_bufferPtr >= (P25_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (P25_SYNC_LENGTH_BITS + 2U)) {
|
||||
// Fuzzy matching of the data sync bit sequence
|
||||
if (countBits64((m_bitBuffer & P25_SYNC_BITS_MASK) ^ P25_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) {
|
||||
DEBUG2("P25RX: found sync in Data, pos", m_bufferPtr - P25_SYNC_LENGTH_BITS);
|
||||
DEBUG1("P25RX: found sync in LDU");
|
||||
m_lostCount = MAX_SYNC_FRAMES;
|
||||
m_bufferPtr = P25_SYNC_LENGTH_BITS;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_bufferPtr == P25_SYNC_LENGTH_BITS + 16U) {
|
||||
// We use DUID here only to detect TDU for EOT
|
||||
// FIXME: we should check and correct for errors in NID first!
|
||||
m_duid = m_buffer[7U] & 0x0F;
|
||||
setEndPtr();
|
||||
DEBUG2("P25RX: DUID", m_duid);
|
||||
}
|
||||
|
||||
// Send a data frame to the host if the required number of bits have been received
|
||||
if (m_bufferPtr == P25_LDU_FRAME_LENGTH_BITS) {
|
||||
// We've not seen a data sync for too long, signal RXLOST and change to RX_NONE
|
||||
m_lostCount--;
|
||||
// We've not seen a data sync for too long, signal RXLOST and change to RX_NONE
|
||||
if (m_lostCount == 0U) {
|
||||
DEBUG1("P25RX: sync timed out, lost lock");
|
||||
io.setDecode(false);
|
||||
|
||||
serial.writeP25Lost();
|
||||
|
||||
m_state = P25RXS_NONE;
|
||||
reset();
|
||||
} else {
|
||||
// Write data to host
|
||||
m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
|
||||
|
||||
writeRSSILdu(m_outBuffer);
|
||||
|
||||
// Start the next frame
|
||||
::memset(m_outBuffer, 0x00U, P25_LDU_FRAME_LENGTH_BYTES + 3U);
|
||||
m_bufferPtr = 0U;
|
||||
}
|
||||
|
||||
// Check if we found a TDU to avoid a false "lost lock"
|
||||
if (m_duid == P25_DUID_TDU || m_duid == P25_DUID_TDULC) {
|
||||
reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,4 +199,32 @@ void CP25RX::writeRSSILdu(uint8_t* ldu)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
void CP25RX::setEndPtr()
|
||||
{
|
||||
switch (m_duid) {
|
||||
case P25_DUID_HDU:
|
||||
DEBUG1("P25RX: sync found in HDU");
|
||||
m_endPtr = P25_HDR_FRAME_LENGTH_BITS;
|
||||
break;
|
||||
case P25_DUID_TDU:
|
||||
DEBUG1("P25RX: sync found in TDU");
|
||||
m_endPtr = P25_TERM_FRAME_LENGTH_BITS;
|
||||
break;
|
||||
case P25_DUID_TSDU:
|
||||
DEBUG1("P25RX: sync found in TSDU");
|
||||
m_endPtr = P25_TSDU_FRAME_LENGTH_BITS;
|
||||
break;
|
||||
case P25_DUID_PDU:
|
||||
// FIXME: not sure about PDU lengths since they have arbitrary length...
|
||||
DEBUG1("P25RX: sync found in PDU");
|
||||
m_endPtr = P25_PDU_HDR_FRAME_LENGTH_BITS;
|
||||
break;
|
||||
case P25_DUID_TDULC:
|
||||
DEBUG1("P25RX: sync found in TDULC");
|
||||
m_endPtr = P25_TERMLC_FRAME_LENGTH_BITS;
|
||||
break;
|
||||
default:
|
||||
m_endPtr = P25_LDU_FRAME_LENGTH_BITS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
P25RX.h
12
P25RX.h
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016,2017 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
enum P25RX_STATE {
|
||||
P25RXS_NONE,
|
||||
P25RXS_DATA
|
||||
P25RXS_HDR,
|
||||
P25RXS_LDU
|
||||
};
|
||||
|
||||
class CP25RX {
|
||||
|
|
@ -36,17 +37,20 @@ public:
|
|||
void reset();
|
||||
|
||||
private:
|
||||
bool m_prev;
|
||||
P25RX_STATE m_state;
|
||||
uint64_t m_bitBuffer;
|
||||
uint8_t m_outBuffer[P25_LDU_FRAME_LENGTH_BYTES + 3U];
|
||||
uint8_t* m_buffer;
|
||||
uint16_t m_bufferPtr;
|
||||
uint16_t m_endPtr;
|
||||
uint16_t m_lostCount;
|
||||
uint8_t m_duid;
|
||||
|
||||
void processNone(bool bit);
|
||||
void processData(bool bit);
|
||||
void processHdr(bool bit);
|
||||
void processLdu(bool bit);
|
||||
void writeRSSILdu(uint8_t* data);
|
||||
void setEndPtr();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
36
POCSAGTX.cpp
36
POCSAGTX.cpp
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2018,2019 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2019 by Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -28,12 +29,18 @@ m_poBuffer(),
|
|||
m_poLen(0U),
|
||||
m_poPtr(0U),
|
||||
m_txDelay(POCSAG_PREAMBLE_LENGTH_BYTES),
|
||||
m_delay(false)
|
||||
m_delay(false),
|
||||
m_cal(false)
|
||||
{
|
||||
}
|
||||
|
||||
void CPOCSAGTX::process()
|
||||
{
|
||||
if (m_cal) {
|
||||
m_delay = false;
|
||||
createCal();
|
||||
}
|
||||
|
||||
if (m_poLen == 0U && m_buffer.getData() > 0U) {
|
||||
if (!m_tx) {
|
||||
m_delay = true;
|
||||
|
|
@ -120,3 +127,28 @@ uint8_t CPOCSAGTX::getSpace() const
|
|||
{
|
||||
return m_buffer.getSpace() / POCSAG_FRAME_LENGTH_BYTES;
|
||||
}
|
||||
|
||||
uint8_t CPOCSAGTX::setCal(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
if (length != 1U)
|
||||
return 4U;
|
||||
|
||||
m_cal = data[0U] == 1U;
|
||||
|
||||
if (m_cal)
|
||||
io.ifConf(STATE_POCSAG, true);
|
||||
|
||||
return 0U;
|
||||
}
|
||||
|
||||
void CPOCSAGTX::createCal()
|
||||
{
|
||||
// 600 Hz square wave generation
|
||||
for (unsigned int i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) {
|
||||
m_poBuffer[i] = 0xAAU;
|
||||
}
|
||||
|
||||
m_poLen = POCSAG_FRAME_LENGTH_BYTES;
|
||||
|
||||
m_poPtr = 0U;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2018,2019 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2019 by Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -28,6 +29,10 @@ public:
|
|||
|
||||
void setTXDelay(uint8_t delay);
|
||||
|
||||
uint8_t setCal(const uint8_t* data, uint8_t length);
|
||||
|
||||
void createCal();
|
||||
|
||||
uint8_t getSpace() const;
|
||||
|
||||
void process();
|
||||
|
|
@ -41,6 +46,7 @@ private:
|
|||
uint16_t m_poPtr;
|
||||
uint16_t m_txDelay;
|
||||
bool m_delay;
|
||||
bool m_cal;
|
||||
|
||||
void writeByte(uint8_t c);
|
||||
};
|
||||
|
|
|
|||
115
README.md
115
README.md
|
|
@ -23,9 +23,53 @@ This software is licenced under the GPL v2 and is intended for amateur and educa
|
|||
- CW ID support
|
||||
- Full duplex support with two ADF7021
|
||||
|
||||
# Known issues
|
||||
|
||||
## Common issues for simplex and duplex boards
|
||||
|
||||
- High RX BER or not RX, poor TX audio (4FSK modes): adjust frequency offset, specially RXOffset.
|
||||
- Not instantaneous mode detection (2 modes or more enabled): mode detection could be slow and sometimes you need to hold PTT several seconds, in order to activate the hotspot. There is no solution for that, since ADF7021 works only one mode at once. You can disable mode scanning, enabling just one mode.
|
||||
- Poor audio with MD380: increase DMR deviation to 55 % or 60 %.
|
||||
- Bad RX sensitivity: this is not a firmware issue, ADF7021 has a minimum signal detection around -109 dBm in DMR, but RX performance depends on RF board design, external RX noise, frequency, etc. At the moment only original ZUMspot RPi can reach the best RX sensitivity in 70 cm band.
|
||||
- Not working with RPi 3B+ (USB): be sure your firmware version is >= 1.4.8 and update to new USB bootloader with long reset pulse (make stlink-bl, for example).
|
||||
- Not working with USB (not RPi 3B+): compile with "LONG_USB_RESET" option disabled, and use old bootloader (make stlink-bl-old, for example).
|
||||
|
||||
## Duplex boards
|
||||
|
||||
- Very difficult DMR activation ("repeater fail" error): disable mode scanning, select just DMR mode.
|
||||
- Not DMR activation ("repeater fail" error) with MD380, Ailunce HD1 or some other radios: increase DMR deviation to 55 % or 60 %.
|
||||
- RX timeout: this is due to TX and RX clock differences, which does not have easy solution. Be sure your firmware version is >= 1.4.7, which minimizes this problem.
|
||||
|
||||
# Notes for previous users of MMDVM boards
|
||||
|
||||
MMDVM_HS boards do not need deviation calibration like MMDVM boards, but could be necessary some frequency offset calibration (ADF7021 does not have AFC for 4FSK modes).
|
||||
|
||||
The following options in MMDVM.ini ([Modem] section) have not any effect for MMDVM_HS boards:
|
||||
|
||||
TXInvert
|
||||
RXInvert
|
||||
PTTInvert
|
||||
RXLevel
|
||||
RXDCOffset
|
||||
TXDCOffset
|
||||
|
||||
The following options in MMDVM.ini ([Modem] section) are very important for MMDVM_HS boards:
|
||||
|
||||
RXOffset: RX frequency offset (HS RX BER improvement)
|
||||
TXOffset: TX frequency offset (radio RX improvement)
|
||||
TXLevel: default deviation setting (recommended value: 50)
|
||||
RFLevel: RF power output (recommended value: 100)
|
||||
CWIdTXLevel: CW ID deviation setting (recommended value: 50)
|
||||
D-StarTXLevel: D-Star deviation setting (recommended value: 50)
|
||||
DMRTXLevel: DMR deviation setting (recommended value: 50)
|
||||
YSFTXLevel: YSF deviation setting (recommended value: 50)
|
||||
P25TXLevel: P25 deviation setting (recommended value: 50)
|
||||
NXDNTXLevel: NXDN deviation setting (recommended value: 50)
|
||||
POCSAGTXLevel: POCSAG deviation setting (recommended value: 50)
|
||||
|
||||
# Important notes
|
||||
|
||||
The ADF7021 (or RF7021SE module) must operate with a 14.7456 MHz TCXO and with at least 2 ppm of frequency stability. You could use also 12.2880 MHz TCXO, but this frequency configuration has less testing. Any other TCXO frequency is not supported.
|
||||
The ADF7021 (or RF7021SE module) must operate with a 14.7456 MHz TCXO and with at least 2.5 ppm of frequency stability or better. For 800-900 MHz frequency band you will need even a better frequency stability TCXO. You could use also 12.2880 MHz TCXO. Any other TCXO frequency is not supported. Please note that a bad quality TCXO not only affects the frequency offset, also affects clock data rate, which is not possible to fix and will cause BER issues.
|
||||
|
||||
Please set TXLevel=50 in MMDVM.ini to configure default deviation levels for all modes. You could modify this value and other TXLevel paramenters to change deviation levels. Use [MMDVMCal](https://github.com/g4klx/MMDVMCal) to check DMR deviation level and TX frequency offset with calibrated test equipment.
|
||||
|
||||
|
|
@ -67,7 +111,7 @@ You could use some pi-star commands under SSH console:
|
|||
|
||||
### Windows
|
||||
|
||||
Download the ZUMspotFW firmware upgrade utility (ZUMspotFW_setup.exe) from the [releases section](https://github.com/juribeparada/MMDVM_HS/releases/download/v1.0.2/ZUMSpotFW_setup.exe).
|
||||
Download the ZUMspotFW firmware upgrade utility (ZUMspotFW_setup.exe) from the [releases section](https://github.com/juribeparada/MMDVM_HS/releases).
|
||||
|
||||
This utility includes firmwares binaries and USB drivers for Windows 7/8/10. If you have problems with the installer, you can download [ZUMspotFW.zip](https://github.com/juribeparada/MMDVM_HS/releases/download/v1.0.2/ZUMspotFW.zip) for a manual installation.
|
||||
|
||||
|
|
@ -75,18 +119,23 @@ This utility includes firmwares binaries and USB drivers for Windows 7/8/10. If
|
|||
|
||||
Download the script (*.sh) that matches with your ZUMspot/MMDVM_HS board:
|
||||
|
||||
- install_fw_librekit.sh: only for ZUMspot Libre Kit board (KI6ZUM & VE2GZI) or generic MMDVM_HS board with USB interface
|
||||
- install_fw_rpi.sh: only for ZUMspot RPi board (KI6ZUM & VE2GZI)
|
||||
- install_fw_usb.sh: only for ZUMspot USB dongle (KI6ZUM)
|
||||
- install_fw_duplex.sh: only for ZUMspot Duplex for RPi (KI6ZUM)
|
||||
- install_fw_dualband.sh: only for ZUMspot Dualband for RPi (KI6ZUM)
|
||||
- install_fw_hshat.sh: only for MMDVM_HS_Hat board (DB9MAT & DF2ET)
|
||||
- install_fw_hshat-12mhz.sh: only for MMDVM_HS_Hat board with 12.288 MHz TCXO (DB9MAT & DF2ET)
|
||||
- install_fw_hsdualhat.sh: only for MMDVM_HS_Dual_Hat board (DB9MAT & DF2ET & DO7EN)
|
||||
- install_fw_hsdualhat-12mhz.sh: only for MMDVM_HS_Dual_Hat board with 12.288 MHz TCXO (DB9MAT & DF2ET & DO7EN)
|
||||
- install_fw_nanohs.sh: only for Nano hotSPOT board (BI7JTA)
|
||||
- install_fw_nanodv_npi.sh: only for NanoDV NPi board 1.0 (BG4TGO & BG5HHP)
|
||||
- install_fw_nanodv_usb.sh: only for NanoDV USB board 1.0 (BG4TGO & BG5HHP)
|
||||
- install_fw_hsdualhat.sh: only for MMDVM_HS_Dual_Hat board (DB9MAT & DF2ET & DO7EN)
|
||||
- install_fw_librekit.sh: only for ZUMspot Libre Kit board (KI6ZUM & VE2GZI) or generic MMDVM_HS board with USB interface
|
||||
- install_fw_usb.sh: only for ZUMspot USB dongle (KI6ZUM & VE2GZI)
|
||||
- install_fw_duplex.sh: only for MMDVM_HS with dual ADF7021 (EA7GIB) or generic dual ADF7021 board with USB interface
|
||||
- install_fw_d2rg_mmdvmhs.sh: only for D2RG MMDVM_HS board (BG3MDO, VE2GZI, CA6JAU)
|
||||
- install_fw_gen_gpio.sh: only for generic MMDVM_HS board (EA7GIB) with GPIO serial interface
|
||||
- install_fw_duplex_gpio.sh: only for MMDVM_HS with dual ADF7021 (EA7GIB) or generic dual ADF7021 board with GPIO serial interface
|
||||
- install_fw_duplex_usb.sh: only for MMDVM_HS with dual ADF7021 (EA7GIB) or generic dual ADF7021 board with USB interface
|
||||
- install_fw_skybridge_rpi.sh: only for BridgeCom SkyBridge HotSpot
|
||||
|
||||
For example, download the ZUMspot RPi upgrade script:
|
||||
|
||||
|
|
@ -103,6 +152,10 @@ stop your MMDVMHost process and run (you will need the root password):
|
|||
|
||||
and wait to complete the upgrading process.
|
||||
|
||||
You could optionally install a beta firmware for testing:
|
||||
|
||||
./install_fw_rpi.sh beta
|
||||
|
||||
## Build from the sources
|
||||
|
||||
You could use example files from MMDVM_HS/configs folder and overwrite the Config.h file, in order to compile a firmware with default settings. There are a specific config file for each ZUMspot or any MMDVM_HS compatible boards. In general, there are two possible compilation ways:
|
||||
|
|
@ -115,6 +168,12 @@ Boards with STM32_USB_HOST option enabled in Config.h (ZUMspot Libre Kit, ZUMspo
|
|||
make bl
|
||||
make dfu
|
||||
|
||||
You can optionally install a firmware without bootloader, with USB support. Be aware you will need always a ST-Link or serial interface in order to install or update the firmware. For this reason, you should use USB bootloader, unless you have trouble with the bootloader.
|
||||
|
||||
make clean
|
||||
make nobl
|
||||
make stlink-nobl
|
||||
|
||||
- Boards with GPIO interface:
|
||||
|
||||
Boards with STM32_USART1_HOST option enabled in Config.h (ZUMspot RPi, MMDVM_HS_Hat, MMDVM_HS_Dual_Hat, Nano hotSPOT, etc). No USB bootloader needed. For example:
|
||||
|
|
@ -129,6 +188,10 @@ Some detailed examples as follows:
|
|||
|
||||
Please visit Mathis Schmieder GitHub [here](https://github.com/mathisschmieder/MMDVM_HS_Hat/blob/master/README.md) for detailed instructions.
|
||||
|
||||
### D2RG MMDVM_HS board
|
||||
|
||||
This hotspot needs Raspbian support for SPI-UART converter included in this board. If you don't see /dev/ttySC0, please visit Yuan BG3MDO GitHub [here](https://github.com/bg3mdo/D2RG_MMDVM_HS_ambe_uart_service) for driver installation instructions.
|
||||
|
||||
### ZUMspot Libre Kit (under Linux Raspbian)
|
||||
|
||||
If you are using Pi-Star, expand filesystem (if you haven't done before):
|
||||
|
|
@ -212,6 +275,8 @@ Install the necessary software tools:
|
|||
sudo apt-get update
|
||||
sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi
|
||||
|
||||
Note: The Pi-Star image contains an executable for stm32flash. The next five steps can be skipped!
|
||||
|
||||
cd ~
|
||||
git clone https://git.code.sf.net/p/stm32flash/code stm32flash
|
||||
cd stm32flash
|
||||
|
|
@ -255,3 +320,41 @@ Upload the firmware to ZUMspot RPi board:
|
|||
|
||||
sudo make zumspot-pi
|
||||
|
||||
### MMDVM_HS_Dual_Hat\MMDVM_HS_Hat gpio firmware update on OrangePI PC/PC2/PC Plus
|
||||
|
||||
Install the necessary software tools:
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi
|
||||
|
||||
Download the sources:
|
||||
|
||||
cd ~
|
||||
git clone https://github.com/juribeparada/MMDVM_HS
|
||||
cd MMDVM_HS/
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
Install the tools for building firmware
|
||||
|
||||
cd MMDVM_HS/scripts
|
||||
./install_buildtools.sh
|
||||
|
||||
Copy MMDVM_HS/configs/MMDVM_HS_Dual_Hat.h or MMDVM_HS/configs/MMDVM_HS_Hat.h (MMDVM_HS_Hat-12mhz.h) to MMDVM_HS/Config.h and build the firmware:
|
||||
|
||||
make
|
||||
|
||||
Stop the MMDVMHost services:
|
||||
|
||||
sudo systemctl stop mmdvmhost.timer
|
||||
sudo systemctl stop mmdvmhost.service
|
||||
|
||||
Upload the firmware to mmdvm_hs_dual_hat (mmdvm_hs_hat) on OrangePi PC\PC2\PC Plus:
|
||||
|
||||
sudo make mmdvm_hs_dual_hat_opi (sudo make mmdvm_hs_hat_opi)
|
||||
|
||||
or
|
||||
|
||||
sudo /usr/local/bin/stm32flash -v -w bin/mmdvm_f1.bin -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit f57ebc35af760675bd6d15e6667e6e66508f852b
|
||||
Subproject commit 1debc23063f3942608e2bd62d04d5e1249c47fa3
|
||||
295
SerialPort.cpp
295
SerialPort.cpp
|
|
@ -1,7 +1,8 @@
|
|||
/*
|
||||
* Copyright (C) 2013,2015,2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2013,2015,2016,2018,2020,2021 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016 by Colin Durbridge G4EML
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2019 by Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -59,6 +60,12 @@ const uint8_t MMDVM_P25_LOST = 0x32U;
|
|||
const uint8_t MMDVM_NXDN_DATA = 0x40U;
|
||||
const uint8_t MMDVM_NXDN_LOST = 0x41U;
|
||||
|
||||
const uint8_t MMDVM_M17_LINK_SETUP = 0x45U;
|
||||
const uint8_t MMDVM_M17_STREAM = 0x46U;
|
||||
const uint8_t MMDVM_M17_PACKET = 0x47U;
|
||||
const uint8_t MMDVM_M17_LOST = 0x48U;
|
||||
const uint8_t MMDVM_M17_EOT = 0x49U;
|
||||
|
||||
const uint8_t MMDVM_POCSAG_DATA = 0x50U;
|
||||
|
||||
const uint8_t MMDVM_ACK = 0x70U;
|
||||
|
|
@ -66,6 +73,9 @@ const uint8_t MMDVM_NAK = 0x7FU;
|
|||
|
||||
const uint8_t MMDVM_SERIAL = 0x80U;
|
||||
|
||||
const uint8_t MMDVM_TRANSPARENT = 0x90U;
|
||||
const uint8_t MMDVM_QSO_INFO = 0x91U;
|
||||
|
||||
const uint8_t MMDVM_DEBUG1 = 0xF1U;
|
||||
const uint8_t MMDVM_DEBUG2 = 0xF2U;
|
||||
const uint8_t MMDVM_DEBUG3 = 0xF3U;
|
||||
|
|
@ -74,10 +84,16 @@ const uint8_t MMDVM_DEBUG5 = 0xF5U;
|
|||
|
||||
const uint8_t PROTOCOL_VERSION = 1U;
|
||||
|
||||
#if defined(ENABLE_UDID)
|
||||
char UDID[] = "00000000000000000000000000000000";
|
||||
#endif
|
||||
|
||||
CSerialPort::CSerialPort() :
|
||||
m_buffer(),
|
||||
m_ptr(0U),
|
||||
m_len(0U),
|
||||
m_serial_buffer(),
|
||||
m_serial_len(0U),
|
||||
m_debug(false),
|
||||
m_firstCal(false)
|
||||
{
|
||||
|
|
@ -116,7 +132,7 @@ void CSerialPort::getStatus()
|
|||
|
||||
// Send all sorts of interesting internal values
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 13U;
|
||||
reply[1U] = 14U;
|
||||
reply[2U] = MMDVM_GET_STATUS;
|
||||
|
||||
reply[3U] = 0x00U;
|
||||
|
|
@ -132,6 +148,8 @@ void CSerialPort::getStatus()
|
|||
reply[3U] |= 0x10U;
|
||||
if (m_pocsagEnable)
|
||||
reply[3U] |= 0x20U;
|
||||
if (m_m17Enable)
|
||||
reply[3U] |= 0x80U;
|
||||
|
||||
reply[4U] = uint8_t(m_modemState);
|
||||
|
||||
|
|
@ -186,12 +204,17 @@ void CSerialPort::getStatus()
|
|||
else
|
||||
reply[12U] = 0U;
|
||||
|
||||
writeInt(1U, reply, 13);
|
||||
if (m_m17Enable)
|
||||
reply[13U] = m17TX.getSpace();
|
||||
else
|
||||
reply[13U] = 0U;
|
||||
|
||||
writeInt(1U, reply, 14);
|
||||
}
|
||||
|
||||
void CSerialPort::getVersion()
|
||||
{
|
||||
uint8_t reply[100U];
|
||||
uint8_t reply[132U];
|
||||
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 0U;
|
||||
|
|
@ -203,6 +226,12 @@ void CSerialPort::getVersion()
|
|||
for (uint8_t i = 0U; HARDWARE[i] != 0x00U; i++, count++)
|
||||
reply[count] = HARDWARE[i];
|
||||
|
||||
#if defined(ENABLE_UDID)
|
||||
reply[count++] = '\0';
|
||||
for (uint8_t i = 0U; UDID[i] != 0x00U; i++, count++)
|
||||
reply[count] = UDID[i];
|
||||
#endif
|
||||
|
||||
reply[1U] = count;
|
||||
|
||||
writeInt(1U, reply, count);
|
||||
|
|
@ -210,7 +239,7 @@ void CSerialPort::getVersion()
|
|||
|
||||
uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
if (length < 13U)
|
||||
if (length < 23U)
|
||||
return 4U;
|
||||
|
||||
bool ysfLoDev = (data[0U] & 0x08U) == 0x08U;
|
||||
|
|
@ -224,6 +253,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
bool p25Enable = (data[1U] & 0x08U) == 0x08U;
|
||||
bool nxdnEnable = (data[1U] & 0x10U) == 0x10U;
|
||||
bool pocsagEnable = (data[1U] & 0x20U) == 0x20U;
|
||||
bool m17Enable = (data[1U] & 0x40U) == 0x40U;
|
||||
|
||||
uint8_t txDelay = data[2U];
|
||||
if (txDelay > 50U)
|
||||
|
|
@ -231,7 +261,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
|
||||
MMDVM_STATE modemState = MMDVM_STATE(data[3U]);
|
||||
|
||||
if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL)
|
||||
if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_M17 && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_INTCAL && modemState != STATE_RSSICAL && modemState != STATE_POCSAGCAL)
|
||||
return 4U;
|
||||
if (modemState == STATE_DSTAR && !dstarEnable)
|
||||
return 4U;
|
||||
|
|
@ -245,6 +275,8 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
return 4U;
|
||||
if (modemState == STATE_POCSAG && !pocsagEnable)
|
||||
return 4U;
|
||||
if (modemState == STATE_M17 && !m17Enable)
|
||||
return 4U;
|
||||
|
||||
uint8_t colorCode = data[6U];
|
||||
if (colorCode > 15U)
|
||||
|
|
@ -260,25 +292,21 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
uint8_t dmrTXLevel = data[10U];
|
||||
uint8_t ysfTXLevel = data[11U];
|
||||
uint8_t p25TXLevel = data[12U];
|
||||
uint8_t nxdnTXLevel = 128U;
|
||||
uint8_t pocsagTXLevel = 128U;
|
||||
uint8_t nxdnTXLevel = data[15U];
|
||||
uint8_t pocsagTXLevel = data[17U];
|
||||
uint8_t m17TXLevel = data[21U];
|
||||
|
||||
if (length >= 16U)
|
||||
nxdnTXLevel = data[15U];
|
||||
|
||||
if (length >= 18U)
|
||||
pocsagTXLevel = data[17U];
|
||||
|
||||
io.setDeviations(dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, pocsagTXLevel, ysfLoDev);
|
||||
io.setDeviations(dstarTXLevel, dmrTXLevel, ysfTXLevel, p25TXLevel, nxdnTXLevel, m17TXLevel, pocsagTXLevel, ysfLoDev);
|
||||
|
||||
m_dstarEnable = dstarEnable;
|
||||
m_dmrEnable = dmrEnable;
|
||||
m_ysfEnable = ysfEnable;
|
||||
m_p25Enable = p25Enable;
|
||||
m_nxdnEnable = nxdnEnable;
|
||||
m_m17Enable = m17Enable;
|
||||
m_pocsagEnable = pocsagEnable;
|
||||
|
||||
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL) {
|
||||
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL || modemState == STATE_INTCAL) {
|
||||
m_dmrEnable = true;
|
||||
m_modemState = STATE_DMR;
|
||||
m_calState = modemState;
|
||||
|
|
@ -286,6 +314,12 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
io.updateCal();
|
||||
if (modemState == STATE_RSSICAL)
|
||||
io.ifConf(STATE_DMR, true);
|
||||
} else if (modemState == STATE_POCSAGCAL) {
|
||||
m_pocsagEnable = true;
|
||||
m_modemState = STATE_POCSAG;
|
||||
m_calState = modemState;
|
||||
if (m_firstCal)
|
||||
io.updateCal();
|
||||
}
|
||||
else {
|
||||
m_modemState = modemState;
|
||||
|
|
@ -299,12 +333,18 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
DEBUG1("Full duplex not supported with this firmware");
|
||||
return 6U;
|
||||
}
|
||||
#elif defined(DUPLEX) && (defined(ZUMSPOT_ADF7021) || defined(LONESTAR_USB) || defined(SKYBRIDGE_HS))
|
||||
if (io.isDualBand() && m_duplex && m_calState == STATE_IDLE && modemState != STATE_DSTARCAL) {
|
||||
DEBUG1("Full duplex is not supported on this board");
|
||||
return 6U;
|
||||
}
|
||||
#endif
|
||||
|
||||
dstarTX.setTXDelay(txDelay);
|
||||
ysfTX.setTXDelay(txDelay);
|
||||
p25TX.setTXDelay(txDelay);
|
||||
nxdnTX.setTXDelay(txDelay);
|
||||
m17TX.setTXDelay(txDelay);
|
||||
pocsagTX.setTXDelay(txDelay);
|
||||
dmrDMOTX.setTXDelay(txDelay);
|
||||
|
||||
|
|
@ -319,7 +359,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
|
||||
io.setLoDevYSF(ysfLoDev);
|
||||
|
||||
if (!m_firstCal || (modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL)) {
|
||||
if (!m_firstCal || (modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL && modemState != STATE_INTCAL && modemState != STATE_POCSAGCAL)) {
|
||||
if(m_dstarEnable)
|
||||
io.ifConf(STATE_DSTAR, true);
|
||||
else if(m_dmrEnable)
|
||||
|
|
@ -330,6 +370,8 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
io.ifConf(STATE_P25, true);
|
||||
else if(m_nxdnEnable)
|
||||
io.ifConf(STATE_NXDN, true);
|
||||
else if(m_m17Enable)
|
||||
io.ifConf(STATE_M17, true);
|
||||
else if(m_pocsagEnable)
|
||||
io.ifConf(STATE_POCSAG, true);
|
||||
}
|
||||
|
|
@ -339,7 +381,7 @@ uint8_t CSerialPort::setConfig(const uint8_t* data, uint8_t length)
|
|||
io.printConf();
|
||||
#endif
|
||||
|
||||
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL)
|
||||
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL || modemState == STATE_INTCAL || modemState == STATE_POCSAGCAL)
|
||||
m_firstCal = true;
|
||||
|
||||
return 0U;
|
||||
|
|
@ -356,7 +398,7 @@ uint8_t CSerialPort::setMode(const uint8_t* data, uint8_t length)
|
|||
if (modemState == m_modemState)
|
||||
return 0U;
|
||||
|
||||
if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL)
|
||||
if (modemState != STATE_IDLE && modemState != STATE_DSTAR && modemState != STATE_DMR && modemState != STATE_YSF && modemState != STATE_P25 && modemState != STATE_NXDN && modemState != STATE_M17 && modemState != STATE_POCSAG && modemState != STATE_DSTARCAL && modemState != STATE_DMRCAL && modemState != STATE_DMRDMO1K && modemState != STATE_RSSICAL && modemState != STATE_INTCAL && modemState != STATE_POCSAGCAL)
|
||||
return 4U;
|
||||
if (modemState == STATE_DSTAR && !m_dstarEnable)
|
||||
return 4U;
|
||||
|
|
@ -368,15 +410,23 @@ uint8_t CSerialPort::setMode(const uint8_t* data, uint8_t length)
|
|||
return 4U;
|
||||
if (modemState == STATE_NXDN && !m_nxdnEnable)
|
||||
return 4U;
|
||||
if (modemState == STATE_M17 && !m_m17Enable)
|
||||
return 4U;
|
||||
if (modemState == STATE_POCSAG && !m_pocsagEnable)
|
||||
return 4U;
|
||||
|
||||
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL) {
|
||||
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL || modemState == STATE_INTCAL) {
|
||||
m_dmrEnable = true;
|
||||
tmpState = STATE_DMR;
|
||||
m_calState = modemState;
|
||||
if (m_firstCal)
|
||||
io.updateCal();
|
||||
} else if (modemState == STATE_POCSAGCAL) {
|
||||
m_pocsagEnable = true;
|
||||
tmpState = STATE_POCSAG;
|
||||
m_calState = modemState;
|
||||
if (m_firstCal)
|
||||
io.updateCal();
|
||||
}
|
||||
else {
|
||||
tmpState = modemState;
|
||||
|
|
@ -436,6 +486,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_DSTAR:
|
||||
|
|
@ -448,6 +499,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_YSF:
|
||||
|
|
@ -460,6 +512,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
dstarRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_P25:
|
||||
|
|
@ -472,6 +525,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
dstarRX.reset();
|
||||
ysfRX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_NXDN:
|
||||
|
|
@ -484,6 +538,20 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
dstarRX.reset();
|
||||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_M17:
|
||||
DEBUG1("Mode set to M17");
|
||||
#if defined(DUPLEX)
|
||||
dmrIdleRX.reset();
|
||||
dmrRX.reset();
|
||||
#endif
|
||||
dmrDMORX.reset();
|
||||
dstarRX.reset();
|
||||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_POCSAG:
|
||||
|
|
@ -497,6 +565,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
default:
|
||||
|
|
@ -520,7 +589,7 @@ void CSerialPort::start()
|
|||
beginInt(1U, 115200);
|
||||
|
||||
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
|
||||
beginInt(3U, 9600);
|
||||
beginInt(3U, SERIAL_REPEATER_BAUD);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -589,7 +658,9 @@ void CSerialPort::process()
|
|||
case MMDVM_CAL_DATA:
|
||||
if (m_calState == STATE_DMRCAL || m_calState == STATE_DMRDMO1K) {
|
||||
err = calDMR.write(m_buffer + 3U, m_len - 3U);
|
||||
} else if (m_calState == STATE_RSSICAL) {
|
||||
} else if (m_calState == STATE_POCSAGCAL) {
|
||||
err = pocsagTX.setCal(m_buffer + 3U, m_len - 3U);
|
||||
} else if (m_calState == STATE_RSSICAL || m_calState == STATE_INTCAL) {
|
||||
err = 0U;
|
||||
}
|
||||
if (err == 0U) {
|
||||
|
|
@ -796,6 +867,48 @@ void CSerialPort::process()
|
|||
}
|
||||
break;
|
||||
|
||||
case MMDVM_M17_LINK_SETUP:
|
||||
if (m_m17Enable) {
|
||||
if (m_modemState == STATE_IDLE || m_modemState == STATE_M17)
|
||||
err = m17TX.writeData(m_buffer + 3U, m_len - 3U);
|
||||
}
|
||||
if (err == 0U) {
|
||||
if (m_modemState == STATE_IDLE)
|
||||
setMode(STATE_M17);
|
||||
} else {
|
||||
DEBUG2("Received invalid M17 link setup data", err);
|
||||
sendNAK(err);
|
||||
}
|
||||
break;
|
||||
|
||||
case MMDVM_M17_STREAM:
|
||||
if (m_m17Enable) {
|
||||
if (m_modemState == STATE_IDLE || m_modemState == STATE_M17)
|
||||
err = m17TX.writeData(m_buffer + 3U, m_len - 3U);
|
||||
}
|
||||
if (err == 0U) {
|
||||
if (m_modemState == STATE_IDLE)
|
||||
setMode(STATE_M17);
|
||||
} else {
|
||||
DEBUG2("Received invalid M17 stream data", err);
|
||||
sendNAK(err);
|
||||
}
|
||||
break;
|
||||
|
||||
case MMDVM_M17_EOT:
|
||||
if (m_m17Enable) {
|
||||
if (m_modemState == STATE_IDLE || m_modemState == STATE_M17)
|
||||
err = m17TX.writeData(m_buffer + 3U, m_len - 3U);
|
||||
}
|
||||
if (err == 0U) {
|
||||
if (m_modemState == STATE_IDLE)
|
||||
setMode(STATE_M17);
|
||||
} else {
|
||||
DEBUG2("Received invalid M17 EOT", err);
|
||||
sendNAK(err);
|
||||
}
|
||||
break;
|
||||
|
||||
case MMDVM_POCSAG_DATA:
|
||||
if (m_pocsagEnable) {
|
||||
if (m_modemState == STATE_IDLE || m_modemState == STATE_POCSAG) {
|
||||
|
|
@ -812,6 +925,11 @@ void CSerialPort::process()
|
|||
}
|
||||
break;
|
||||
|
||||
case MMDVM_TRANSPARENT:
|
||||
case MMDVM_QSO_INFO:
|
||||
// Do nothing on the MMDVM.
|
||||
break;
|
||||
|
||||
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
|
||||
case MMDVM_SERIAL:
|
||||
writeInt(3U, m_buffer + 3U, m_len - 3U);
|
||||
|
|
@ -836,12 +954,54 @@ void CSerialPort::process()
|
|||
}
|
||||
|
||||
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
|
||||
// Drain any incoming serial data
|
||||
// Check for any incoming serial data from a device/screen on UART2
|
||||
// !!Notice!! on powerup the Nextion screen dumps FF FF FF 88 FF FF FF to the serial port.
|
||||
while (availableInt(3U))
|
||||
readInt(3U);
|
||||
{
|
||||
// read UART2
|
||||
m_serial_buffer[m_serial_len++] = readInt(3U);
|
||||
|
||||
if (m_serial_len >=3 && (m_serial_buffer[m_serial_len - 3] == 0xFF) && (m_serial_buffer[m_serial_len - 2] == 0xFF) && (m_serial_buffer[m_serial_len - 1] == 0xFF))
|
||||
{
|
||||
if (m_serial_len > 3)
|
||||
serial.writeSerialRpt(m_serial_buffer, m_serial_len);
|
||||
|
||||
// if the last 3 bytes are FF's then the screen is done sending data so send the m_serial_buffer to serial.writeSerialRpt()
|
||||
//
|
||||
// TODO - BG5HHP
|
||||
// modem serial data repeat should be generic instead of coupling with the nextion protocol.
|
||||
//
|
||||
m_serial_len = 0U;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_serial_len == sizeof(m_serial_buffer))
|
||||
{
|
||||
// buffer overflow
|
||||
m_serial_len = 0U;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
|
||||
void CSerialPort::writeSerialRpt(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
if (length == 0)
|
||||
return;
|
||||
|
||||
uint8_t head[3];
|
||||
head[0U] = MMDVM_FRAME_START;
|
||||
head[1U] = length + 3;
|
||||
head[2U] = MMDVM_SERIAL;
|
||||
|
||||
writeInt(1U, head, 3U);
|
||||
writeInt(1U, data, length, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void CSerialPort::writeDStarHeader(const uint8_t* header, uint8_t length)
|
||||
{
|
||||
if (m_modemState != STATE_DSTAR && m_modemState != STATE_IDLE)
|
||||
|
|
@ -1104,6 +1264,86 @@ void CSerialPort::writeNXDNLost()
|
|||
writeInt(1U, reply, 3);
|
||||
}
|
||||
|
||||
void CSerialPort::writeM17LinkSetup(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
|
||||
return;
|
||||
|
||||
if (!m_m17Enable)
|
||||
return;
|
||||
|
||||
uint8_t reply[130U];
|
||||
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 0U;
|
||||
reply[2U] = MMDVM_M17_LINK_SETUP;
|
||||
|
||||
uint8_t count = 3U;
|
||||
for (uint8_t i = 0U; i < length; i++, count++)
|
||||
reply[count] = data[i];
|
||||
|
||||
reply[1U] = count;
|
||||
|
||||
writeInt(1U, reply, count);
|
||||
}
|
||||
|
||||
void CSerialPort::writeM17Stream(const uint8_t* data, uint8_t length)
|
||||
{
|
||||
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
|
||||
return;
|
||||
|
||||
if (!m_m17Enable)
|
||||
return;
|
||||
|
||||
uint8_t reply[130U];
|
||||
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 0U;
|
||||
reply[2U] = MMDVM_M17_STREAM;
|
||||
|
||||
uint8_t count = 3U;
|
||||
for (uint8_t i = 0U; i < length; i++, count++)
|
||||
reply[count] = data[i];
|
||||
|
||||
reply[1U] = count;
|
||||
|
||||
writeInt(1U, reply, count);
|
||||
}
|
||||
|
||||
void CSerialPort::writeM17EOT()
|
||||
{
|
||||
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
|
||||
return;
|
||||
|
||||
if (!m_m17Enable)
|
||||
return;
|
||||
|
||||
uint8_t reply[3U];
|
||||
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 3U;
|
||||
reply[2U] = MMDVM_M17_EOT;
|
||||
|
||||
writeInt(1U, reply, 3);
|
||||
}
|
||||
|
||||
void CSerialPort::writeM17Lost()
|
||||
{
|
||||
if (m_modemState != STATE_M17 && m_modemState != STATE_IDLE)
|
||||
return;
|
||||
|
||||
if (!m_m17Enable)
|
||||
return;
|
||||
|
||||
uint8_t reply[3U];
|
||||
|
||||
reply[0U] = MMDVM_FRAME_START;
|
||||
reply[1U] = 3U;
|
||||
reply[2U] = MMDVM_M17_LOST;
|
||||
|
||||
writeInt(1U, reply, 3);
|
||||
}
|
||||
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
|
||||
void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length)
|
||||
|
|
@ -1129,7 +1369,6 @@ void CSerialPort::writeRSSIData(const uint8_t* data, uint8_t length)
|
|||
#endif
|
||||
|
||||
#if defined(ENABLE_DEBUG)
|
||||
|
||||
void CSerialPort::writeDebug(const char* text)
|
||||
{
|
||||
if (!m_debug)
|
||||
|
|
@ -1198,6 +1437,7 @@ void CSerialPort::writeDebug(const char* text, int16_t n1)
|
|||
|
||||
writeInt(1U, reply, count, true);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2)
|
||||
{
|
||||
|
|
@ -1225,6 +1465,7 @@ void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2)
|
|||
writeInt(1U, reply, count, true);
|
||||
}
|
||||
|
||||
#if defined(ENABLE_DEBUG)
|
||||
void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3)
|
||||
{
|
||||
if (!m_debug)
|
||||
|
|
@ -1285,6 +1526,4 @@ void CSerialPort::writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n
|
|||
|
||||
writeInt(1U, reply, count, true);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
17
SerialPort.h
17
SerialPort.h
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2018,2020,2021 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -30,6 +30,10 @@ public:
|
|||
|
||||
void process();
|
||||
|
||||
#if defined(SERIAL_REPEATER) || defined(SERIAL_REPEATER_USART1)
|
||||
void writeSerialRpt(const uint8_t* data, uint8_t length);
|
||||
#endif
|
||||
|
||||
void writeDStarHeader(const uint8_t* header, uint8_t length);
|
||||
void writeDStarData(const uint8_t* data, uint8_t length);
|
||||
void writeDStarLost();
|
||||
|
|
@ -48,6 +52,11 @@ public:
|
|||
void writeNXDNData(const uint8_t* data, uint8_t length);
|
||||
void writeNXDNLost();
|
||||
|
||||
void writeM17LinkSetup(const uint8_t* data, uint8_t length);
|
||||
void writeM17Stream(const uint8_t* data, uint8_t length);
|
||||
void writeM17EOT();
|
||||
void writeM17Lost();
|
||||
|
||||
#if defined(SEND_RSSI_DATA)
|
||||
void writeRSSIData(const uint8_t* data, uint8_t length);
|
||||
#endif
|
||||
|
|
@ -56,15 +65,18 @@ public:
|
|||
void writeDebug(const char* text);
|
||||
void writeDebug(const char* text, int16_t n1);
|
||||
void writeDebugI(const char* text, int32_t n1);
|
||||
void writeDebug(const char* text, int16_t n1, int16_t n2);
|
||||
void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3);
|
||||
void writeDebug(const char* text, int16_t n1, int16_t n2, int16_t n3, int16_t n4);
|
||||
#endif
|
||||
void writeDebug(const char* text, int16_t n1, int16_t n2);
|
||||
|
||||
private:
|
||||
uint8_t m_buffer[256U];
|
||||
uint8_t m_ptr;
|
||||
uint8_t m_len;
|
||||
uint8_t m_serial_buffer[128U];
|
||||
uint8_t m_serial_len;
|
||||
|
||||
bool m_debug;
|
||||
bool m_firstCal;
|
||||
|
||||
|
|
@ -85,4 +97,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2016 by Jim McLaughlin KI6ZUM
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018,2019 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "Globals.h"
|
||||
#include "SerialPort.h"
|
||||
#include "I2CHost.h"
|
||||
|
||||
#if defined(STM32_USB_HOST)
|
||||
#include <usb_serial.h>
|
||||
|
|
@ -32,9 +33,9 @@
|
|||
Pin definitions:
|
||||
|
||||
- Host communication:
|
||||
USART1 - TXD PA9 - RXD PA10
|
||||
or
|
||||
USB VCOM
|
||||
1) USART1 - TXD PA9 - RXD PA10
|
||||
2) USB VCOM
|
||||
3) I2C - SCL PB10 - SDA PB11
|
||||
|
||||
- Serial repeater
|
||||
USART2 - TXD PA2 - RXD PA3
|
||||
|
|
@ -432,15 +433,45 @@ void WriteUSART2(const uint8_t* data, uint16_t length)
|
|||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
#if defined(ENABLE_UDID)
|
||||
extern char UDID[];
|
||||
extern "C" {
|
||||
#include <stdio.h>
|
||||
}
|
||||
#endif
|
||||
|
||||
void CSerialPort::beginInt(uint8_t n, int speed)
|
||||
{
|
||||
#if defined(ENABLE_UDID)
|
||||
#if defined(STM32F4XX)
|
||||
uint32_t *id0 = (uint32_t *) (0x1FFF7A10);
|
||||
uint32_t *id1 = (uint32_t *) (0x1FFF7A10 + 0x04);
|
||||
uint32_t *id2 = (uint32_t *) (0x1FFF7A10 + 0x08);
|
||||
::sprintf(UDID, "%08X%08X%08X", *(unsigned int *)id0, *(unsigned int *)id1, *(unsigned int *)id2);
|
||||
|
||||
#elif defined(STM32F7XX)
|
||||
uint32_t *id0 = (uint32_t *) (0x1FF0F420);
|
||||
uint32_t *id1 = (uint32_t *) (0x1FF0F420 + 0x04);
|
||||
uint32_t *id2 = (uint32_t *) (0x1FF0F420 + 0x08);
|
||||
::sprintf(UDID, "%08X%08X%08X", *(unsigned int *)id0, *(unsigned int *)id1, *(unsigned int *)id2);
|
||||
|
||||
#elif defined(STM32F10X_MD)
|
||||
uint16_t *id00 = (uint16_t *) (0x1FFFF7E8);
|
||||
uint16_t *id01 = (uint16_t *) (0x1FFFF7E8 + 0x02);
|
||||
uint32_t *id1 = (uint32_t *) (0x1FFFF7E8 + 0x04);
|
||||
uint32_t *id2 = (uint32_t *) (0x1FFFF7E8 + 0x08);
|
||||
::sprintf(UDID, "%04X%04X%08X%08X", *id00, *id01, *(unsigned int *)id1, *(unsigned int *)id2);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch (n) {
|
||||
case 1U:
|
||||
#if defined(STM32_USART1_HOST)
|
||||
InitUSART1(speed);
|
||||
#elif defined(STM32_USB_HOST)
|
||||
usbserial.begin();
|
||||
#elif defined(STM32_I2C_HOST)
|
||||
i2c.Init();
|
||||
#endif
|
||||
break;
|
||||
case 3U:
|
||||
|
|
@ -463,6 +494,8 @@ int CSerialPort::availableInt(uint8_t n)
|
|||
return AvailUSART1();
|
||||
#elif defined(STM32_USB_HOST)
|
||||
return usbserial.available();
|
||||
#elif defined(STM32_I2C_HOST)
|
||||
return i2c.AvailI2C();
|
||||
#endif
|
||||
case 3U:
|
||||
#if defined(SERIAL_REPEATER)
|
||||
|
|
@ -483,6 +516,8 @@ uint8_t CSerialPort::readInt(uint8_t n)
|
|||
return ReadUSART1();
|
||||
#elif defined(STM32_USB_HOST)
|
||||
return usbserial.read();
|
||||
#elif defined(STM32_I2C_HOST)
|
||||
return i2c.ReadI2C();
|
||||
#endif
|
||||
case 3U:
|
||||
#if defined(SERIAL_REPEATER)
|
||||
|
|
@ -507,6 +542,8 @@ void CSerialPort::writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool
|
|||
usbserial.write(data, length);
|
||||
if (flush)
|
||||
usbserial.flush();
|
||||
#elif defined(STM32_I2C_HOST)
|
||||
i2c.WriteI2C(data, length);
|
||||
#endif
|
||||
break;
|
||||
case 3U:
|
||||
|
|
|
|||
11
Utils.cpp
11
Utils.cpp
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2017 by Andy Uribe CA6JAU
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -31,6 +31,15 @@ uint8_t countBits8(uint8_t bits)
|
|||
return BITS_TABLE[bits];
|
||||
}
|
||||
|
||||
uint8_t countBits16(uint16_t bits)
|
||||
{
|
||||
uint8_t* p = (uint8_t*)&bits;
|
||||
uint8_t n = 0U;
|
||||
n += BITS_TABLE[p[0U]];
|
||||
n += BITS_TABLE[p[1U]];
|
||||
return n;
|
||||
}
|
||||
|
||||
uint8_t countBits32(uint32_t bits)
|
||||
{
|
||||
uint8_t* p = (uint8_t*)&bits;
|
||||
|
|
|
|||
4
Utils.h
4
Utils.h
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2015,2016 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2017 by Andy Uribe CA6JAU
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -34,6 +34,8 @@
|
|||
|
||||
uint8_t countBits8(uint8_t bits);
|
||||
|
||||
uint8_t countBits16(uint16_t bits);
|
||||
|
||||
uint8_t countBits32(uint32_t bits);
|
||||
|
||||
uint8_t countBits64(uint64_t bits);
|
||||
|
|
|
|||
10
YSFDefines.h
10
YSFDefines.h
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2015 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -21,14 +22,11 @@
|
|||
|
||||
const unsigned int YSF_FRAME_LENGTH_BYTES = 120U;
|
||||
const unsigned int YSF_FRAME_LENGTH_BITS = YSF_FRAME_LENGTH_BYTES * 8U;
|
||||
const unsigned int YSF_FRAME_LENGTH_SYMBOLS = YSF_FRAME_LENGTH_BYTES * 4U;
|
||||
|
||||
const unsigned int YSF_SYNC_LENGTH_BYTES = 5U;
|
||||
const unsigned int YSF_SYNC_LENGTH_BITS = YSF_SYNC_LENGTH_BYTES * 8U;
|
||||
const unsigned int YSF_SYNC_LENGTH_SYMBOLS = YSF_SYNC_LENGTH_BYTES * 4U;
|
||||
|
||||
const unsigned int YSF_FICH_LENGTH_BITS = 200U;
|
||||
const unsigned int YSF_FICH_LENGTH_SYMBOLS = 100U;
|
||||
|
||||
const uint8_t YSF_SYNC_BYTES[] = {0xD4U, 0x71U, 0xC9U, 0x63U, 0x4DU};
|
||||
const uint8_t YSF_SYNC_BYTES_LENGTH = 5U;
|
||||
|
|
@ -36,11 +34,5 @@ const uint8_t YSF_SYNC_BYTES_LENGTH = 5U;
|
|||
const uint64_t YSF_SYNC_BITS = 0x000000D471C9634DU;
|
||||
const uint64_t YSF_SYNC_BITS_MASK = 0x000000FFFFFFFFFFU;
|
||||
|
||||
// D 4 7 1 C 9 6 3 4 D
|
||||
// 11 01 01 00 01 11 00 01 11 00 10 01 01 10 00 11 01 00 11 01
|
||||
// -3 +3 +3 +1 +3 -3 +1 +3 -3 +1 -1 +3 +3 -1 +3 -3 +3 +1 -3 +3
|
||||
const uint32_t YSF_SYNC_SYMBOLS = 0x0007B5ADU;
|
||||
const uint32_t YSF_SYNC_SYMBOLS_MASK = 0x000FFFFFU;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
22
YSFRX.cpp
22
YSFRX.cpp
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2017 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2016,2017 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2016,2017,2018 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -25,14 +25,13 @@
|
|||
const uint8_t SYNC_BIT_START_ERRS = 2U;
|
||||
const uint8_t SYNC_BIT_RUN_ERRS = 4U;
|
||||
|
||||
const unsigned int MAX_SYNC_FRAMES = 4U + 1U;
|
||||
const unsigned int MAX_SYNC_FRAMES = 1U + 1U;
|
||||
|
||||
const uint8_t BIT_MASK_TABLE[] = {0x80U, 0x40U, 0x20U, 0x10U, 0x08U, 0x04U, 0x02U, 0x01U};
|
||||
|
||||
#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])
|
||||
|
||||
CYSFRX::CYSFRX() :
|
||||
m_prev(false),
|
||||
m_state(YSFRXS_NONE),
|
||||
m_bitBuffer(0x00U),
|
||||
m_outBuffer(),
|
||||
|
|
@ -45,7 +44,6 @@ m_lostCount(0U)
|
|||
|
||||
void CYSFRX::reset()
|
||||
{
|
||||
m_prev = false;
|
||||
m_state = YSFRXS_NONE;
|
||||
m_bitBuffer = 0x00U;
|
||||
m_bufferPtr = 0U;
|
||||
|
|
@ -77,7 +75,6 @@ void CYSFRX::processNone(bool bit)
|
|||
m_state = YSFRXS_DATA;
|
||||
|
||||
io.setDecode(true);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -89,9 +86,12 @@ void CYSFRX::processData(bool bit)
|
|||
m_bitBuffer |= 0x01U;
|
||||
|
||||
WRITE_BIT1(m_buffer, m_bufferPtr, bit);
|
||||
m_bufferPtr++;
|
||||
|
||||
// Only search for a sync in the right place +-2 symbols
|
||||
m_bufferPtr++;
|
||||
if (m_bufferPtr > YSF_FRAME_LENGTH_BITS)
|
||||
reset();
|
||||
|
||||
// Only search for a sync in the right place +-2 bits
|
||||
if (m_bufferPtr >= (YSF_SYNC_LENGTH_BITS - 2U) && m_bufferPtr <= (YSF_SYNC_LENGTH_BITS + 2U)) {
|
||||
// Fuzzy matching of the data sync bit sequence
|
||||
if (countBits64((m_bitBuffer & YSF_SYNC_BITS_MASK) ^ YSF_SYNC_BITS) <= SYNC_BIT_RUN_ERRS) {
|
||||
|
|
@ -103,18 +103,16 @@ void CYSFRX::processData(bool bit)
|
|||
|
||||
// Send a data frame to the host if the required number of bits have been received
|
||||
if (m_bufferPtr == YSF_FRAME_LENGTH_BITS) {
|
||||
// We've not seen a data sync for too long, signal RXLOST and change to RX_NONE
|
||||
m_lostCount--;
|
||||
// We've not seen a data sync for too long, signal RXLOST and change to RX_NONE
|
||||
if (m_lostCount == 0U) {
|
||||
DEBUG1("YSFRX: sync timed out, lost lock");
|
||||
io.setDecode(false);
|
||||
|
||||
serial.writeYSFLost();
|
||||
|
||||
m_state = YSFRXS_NONE;
|
||||
reset();
|
||||
} else {
|
||||
// Write data to host
|
||||
m_outBuffer[0U] = m_lostCount == (MAX_SYNC_FRAMES - 1U) ? 0x01U : 0x00U;
|
||||
|
||||
writeRSSIData(m_outBuffer);
|
||||
|
||||
// Start the next frame
|
||||
|
|
|
|||
2
YSFRX.h
2
YSFRX.h
|
|
@ -36,7 +36,6 @@ public:
|
|||
void reset();
|
||||
|
||||
private:
|
||||
bool m_prev;
|
||||
YSFRX_STATE m_state;
|
||||
uint64_t m_bitBuffer;
|
||||
uint8_t m_outBuffer[YSF_FRAME_LENGTH_BYTES + 3U];
|
||||
|
|
@ -51,4 +50,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
119
configs/D2RG_MMDVM_HS.h
Normal file
119
configs/D2RG_MMDVM_HS.h
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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(CONFIG_H)
|
||||
#define CONFIG_H
|
||||
|
||||
// Select one board (STM32F103 based boards)
|
||||
// 1) ZUMspot RPi or ZUMspot USB:
|
||||
// #define ZUMSPOT_ADF7021
|
||||
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
|
||||
// #define LIBRE_KIT_ADF7021
|
||||
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
|
||||
// #define MMDVM_HS_HAT_REV12
|
||||
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
|
||||
// #define MMDVM_HS_DUAL_HAT_REV10
|
||||
// 5) Nano hotSPOT (BI7JTA)
|
||||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
#define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
||||
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
|
||||
// #define DUPLEX
|
||||
|
||||
// TCXO of the ADF7021
|
||||
// For 14.7456 MHz:
|
||||
#define ADF7021_14_7456
|
||||
// For 12.2880 MHz:
|
||||
// #define ADF7021_12_2880
|
||||
|
||||
// Configure receiver gain for ADF7021
|
||||
// AGC automatic, default settings:
|
||||
#define AD7021_GAIN_AUTO
|
||||
// AGC automatic with high LNA linearity:
|
||||
// #define AD7021_GAIN_AUTO_LIN
|
||||
// AGC OFF, lowest gain:
|
||||
// #define AD7021_GAIN_LOW
|
||||
// AGC OFF, highest gain:
|
||||
// #define AD7021_GAIN_HIGH
|
||||
|
||||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
||||
// Send RSSI value:
|
||||
#define SEND_RSSI_DATA
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
||||
// Enable P25 Wide modulation:
|
||||
// #define ENABLE_P25_WIDE
|
||||
|
||||
// Disable mode LEDs blink during scan mode:
|
||||
// #define QUIET_MODE_LEDS
|
||||
|
||||
// Engage a constant or descreet Service LED mode once repeater is running
|
||||
// #define CONSTANT_SRV_LED
|
||||
// #define CONSTANT_SRV_LED_INVERTED
|
||||
// #define DISCREET_SRV_LED
|
||||
// #define DISCREET_SRV_LED_INVERTED
|
||||
|
||||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
120
configs/LoneStar_USB.h
Normal file
120
configs/LoneStar_USB.h
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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(CONFIG_H)
|
||||
#define CONFIG_H
|
||||
|
||||
// Select one board (STM32F103 based boards)
|
||||
// 1) ZUMspot RPi or ZUMspot USB:
|
||||
// #define ZUMSPOT_ADF7021
|
||||
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
|
||||
// #define LIBRE_KIT_ADF7021
|
||||
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
|
||||
// #define MMDVM_HS_HAT_REV12
|
||||
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
|
||||
// #define MMDVM_HS_DUAL_HAT_REV10
|
||||
// 5) Nano hotSPOT (BI7JTA)
|
||||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
// 9) LoneStar USB Stick ADF7071
|
||||
#define LONESTAR_USB
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
||||
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
|
||||
// #define DUPLEX
|
||||
|
||||
// TCXO of the ADF7021
|
||||
// For 14.7456 MHz:
|
||||
#define ADF7021_14_7456
|
||||
// For 12.2880 MHz:
|
||||
// #define ADF7021_12_2880
|
||||
|
||||
// Configure receiver gain for ADF7021
|
||||
// AGC automatic, default settings:
|
||||
#define AD7021_GAIN_AUTO
|
||||
// AGC automatic with high LNA linearity:
|
||||
// #define AD7021_GAIN_AUTO_LIN
|
||||
// AGC OFF, lowest gain:
|
||||
// #define AD7021_GAIN_LOW
|
||||
// AGC OFF, highest gain:
|
||||
// #define AD7021_GAIN_HIGH
|
||||
|
||||
// Host communication selection:
|
||||
// #define STM32_USART1_HOST
|
||||
#define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
||||
// Send RSSI value:
|
||||
#define SEND_RSSI_DATA
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
// #define SERIAL_REPEATER
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
||||
// Enable P25 Wide modulation:
|
||||
// #define ENABLE_P25_WIDE
|
||||
|
||||
// Disable mode LEDs blink during scan mode:
|
||||
// #define QUIET_MODE_LEDS
|
||||
|
||||
// Engage a constant or descreet Service LED mode once repeater is running
|
||||
// #define CONSTANT_SRV_LED
|
||||
// #define CONSTANT_SRV_LED_INVERTED
|
||||
// #define DISCREET_SRV_LED
|
||||
// #define DISCREET_SRV_LED_INVERTED
|
||||
|
||||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
#define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
#define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
#define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
#define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
#define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -30,8 +30,12 @@
|
|||
// #define MMDVM_HS_DUAL_HAT_REV10
|
||||
// 5) Nano hotSPOT (BI7JTA)
|
||||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
#define NANO_DV_REV10
|
||||
// 6) NanoDV NPi or USB revisions 1.1 (BG4TGO & BG5HHP)
|
||||
#define NANO_DV_REV11
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
#define USE_ALTERNATE_POCSAG_LEDS
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -30,8 +30,12 @@
|
|||
// #define MMDVM_HS_DUAL_HAT_REV10
|
||||
// 5) Nano hotSPOT (BI7JTA)
|
||||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
#define NANO_DV_REV10
|
||||
// 6) NanoDV NPi or USB revisions 1.1 (BG4TGO & BG5HHP)
|
||||
#define NANO_DV_REV11
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
// #define STM32_USART1_HOST
|
||||
#define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
#define USE_ALTERNATE_POCSAG_LEDS
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
#define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
#define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
116
configs/SkyBridge_RPi.h
Normal file
116
configs/SkyBridge_RPi.h
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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(CONFIG_H)
|
||||
#define CONFIG_H
|
||||
|
||||
// Select one board (STM32F103 based boards)
|
||||
// 1) ZUMspot RPi or ZUMspot USB:
|
||||
// #define ZUMSPOT_ADF7021
|
||||
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
|
||||
// #define LIBRE_KIT_ADF7021
|
||||
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
|
||||
// #define MMDVM_HS_HAT_REV12
|
||||
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
|
||||
// #define MMDVM_HS_DUAL_HAT_REV10
|
||||
// 5) Nano hotSPOT (BI7JTA)
|
||||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
#define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
||||
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
|
||||
// #define DUPLEX
|
||||
|
||||
// TCXO of the ADF7021
|
||||
// For 14.7456 MHz:
|
||||
#define ADF7021_14_7456
|
||||
// For 12.2880 MHz:
|
||||
// #define ADF7021_12_2880
|
||||
|
||||
// Configure receiver gain for ADF7021
|
||||
// AGC automatic, default settings:
|
||||
#define AD7021_GAIN_AUTO
|
||||
// AGC automatic with high LNA linearity:
|
||||
// #define AD7021_GAIN_AUTO_LIN
|
||||
// AGC OFF, lowest gain:
|
||||
// #define AD7021_GAIN_LOW
|
||||
// AGC OFF, highest gain:
|
||||
// #define AD7021_GAIN_HIGH
|
||||
|
||||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
||||
// Send RSSI value:
|
||||
#define SEND_RSSI_DATA
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
||||
// Enable P25 Wide modulation:
|
||||
// #define ENABLE_P25_WIDE
|
||||
|
||||
// Disable mode LEDs blink during scan mode:
|
||||
// #define QUIET_MODE_LEDS
|
||||
|
||||
// Engage a constant or descreet Service LED mode once repeater is running
|
||||
// #define CONSTANT_SRV_LED
|
||||
// #define CONSTANT_SRV_LED_INVERTED
|
||||
// #define DISCREET_SRV_LED
|
||||
// #define DISCREET_SRV_LED_INVERTED
|
||||
|
||||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
// #define STM32_USART1_HOST
|
||||
#define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
#define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
// #define STM32_USART1_HOST
|
||||
#define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -86,10 +94,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
#define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
119
configs/ZUMspot_dualband.h
Normal file
119
configs/ZUMspot_dualband.h
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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(CONFIG_H)
|
||||
#define CONFIG_H
|
||||
|
||||
// Select one board (STM32F103 based boards)
|
||||
// 1) ZUMspot RPi or ZUMspot USB:
|
||||
#define ZUMSPOT_ADF7021
|
||||
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
|
||||
// #define LIBRE_KIT_ADF7021
|
||||
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
|
||||
// #define MMDVM_HS_HAT_REV12
|
||||
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
|
||||
// #define MMDVM_HS_DUAL_HAT_REV10
|
||||
// 5) Nano hotSPOT (BI7JTA)
|
||||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
||||
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
|
||||
// #define DUPLEX
|
||||
|
||||
// TCXO of the ADF7021
|
||||
// For 14.7456 MHz:
|
||||
#define ADF7021_14_7456
|
||||
// For 12.2880 MHz:
|
||||
// #define ADF7021_12_2880
|
||||
|
||||
// Configure receiver gain for ADF7021
|
||||
// AGC automatic, default settings:
|
||||
#define AD7021_GAIN_AUTO
|
||||
// AGC automatic with high LNA linearity:
|
||||
// #define AD7021_GAIN_AUTO_LIN
|
||||
// AGC OFF, lowest gain:
|
||||
// #define AD7021_GAIN_LOW
|
||||
// AGC OFF, highest gain:
|
||||
// #define AD7021_GAIN_HIGH
|
||||
|
||||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
||||
// Send RSSI value:
|
||||
#define SEND_RSSI_DATA
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
||||
// Enable P25 Wide modulation:
|
||||
// #define ENABLE_P25_WIDE
|
||||
|
||||
// Disable mode LEDs blink during scan mode:
|
||||
// #define QUIET_MODE_LEDS
|
||||
|
||||
// Engage a constant or descreet Service LED mode once repeater is running
|
||||
// #define CONSTANT_SRV_LED
|
||||
// #define CONSTANT_SRV_LED_INVERTED
|
||||
// #define DISCREET_SRV_LED
|
||||
// #define DISCREET_SRV_LED_INVERTED
|
||||
|
||||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -21,9 +21,9 @@
|
|||
|
||||
// Select one board (STM32F103 based boards)
|
||||
// 1) ZUMspot RPi or ZUMspot USB:
|
||||
// #define ZUMSPOT_ADF7021
|
||||
#define ZUMSPOT_ADF7021
|
||||
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
|
||||
#define LIBRE_KIT_ADF7021
|
||||
// #define LIBRE_KIT_ADF7021
|
||||
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
|
||||
// #define MMDVM_HS_HAT_REV12
|
||||
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -56,17 +60,22 @@
|
|||
// #define AD7021_GAIN_HIGH
|
||||
|
||||
// Host communication selection:
|
||||
// #define STM32_USART1_HOST
|
||||
#define STM32_USB_HOST
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
||||
// Send RSSI value:
|
||||
// #define SEND_RSSI_DATA
|
||||
#define SEND_RSSI_DATA
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
119
configs/generic_duplex_usb.h
Normal file
119
configs/generic_duplex_usb.h
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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(CONFIG_H)
|
||||
#define CONFIG_H
|
||||
|
||||
// Select one board (STM32F103 based boards)
|
||||
// 1) ZUMspot RPi or ZUMspot USB:
|
||||
// #define ZUMSPOT_ADF7021
|
||||
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
|
||||
#define LIBRE_KIT_ADF7021
|
||||
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
|
||||
// #define MMDVM_HS_HAT_REV12
|
||||
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
|
||||
// #define MMDVM_HS_DUAL_HAT_REV10
|
||||
// 5) Nano hotSPOT (BI7JTA)
|
||||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
||||
// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
|
||||
#define DUPLEX
|
||||
|
||||
// TCXO of the ADF7021
|
||||
// For 14.7456 MHz:
|
||||
#define ADF7021_14_7456
|
||||
// For 12.2880 MHz:
|
||||
// #define ADF7021_12_2880
|
||||
|
||||
// Configure receiver gain for ADF7021
|
||||
// AGC automatic, default settings:
|
||||
#define AD7021_GAIN_AUTO
|
||||
// AGC automatic with high LNA linearity:
|
||||
// #define AD7021_GAIN_AUTO_LIN
|
||||
// AGC OFF, lowest gain:
|
||||
// #define AD7021_GAIN_LOW
|
||||
// AGC OFF, highest gain:
|
||||
// #define AD7021_GAIN_HIGH
|
||||
|
||||
// Host communication selection:
|
||||
// #define STM32_USART1_HOST
|
||||
#define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
||||
// Send RSSI value:
|
||||
// #define SEND_RSSI_DATA
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
||||
// Enable P25 Wide modulation:
|
||||
// #define ENABLE_P25_WIDE
|
||||
|
||||
// Disable mode LEDs blink during scan mode:
|
||||
// #define QUIET_MODE_LEDS
|
||||
|
||||
// Engage a constant or descreet Service LED mode once repeater is running
|
||||
// #define CONSTANT_SRV_LED
|
||||
// #define CONSTANT_SRV_LED_INVERTED
|
||||
// #define DISCREET_SRV_LED
|
||||
// #define DISCREET_SRV_LED_INVERTED
|
||||
|
||||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
#define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,6 +32,10 @@
|
|||
// #define NANO_HOTSPOT
|
||||
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
|
||||
// #define NANO_DV_REV10
|
||||
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
|
||||
// #define D2RG_MMDVM_HS
|
||||
// 8) BridgeCom SkyBridge HotSpot
|
||||
// #define SKYBRIDGE_HS
|
||||
|
||||
// Enable ADF7021 support:
|
||||
#define ENABLE_ADF7021
|
||||
|
|
@ -58,6 +62,10 @@
|
|||
// Host communication selection:
|
||||
#define STM32_USART1_HOST
|
||||
// #define STM32_USB_HOST
|
||||
// #define STM32_I2C_HOST
|
||||
|
||||
// I2C host address:
|
||||
#define I2C_ADDR 0x22
|
||||
|
||||
// Enable mode detection:
|
||||
#define ENABLE_SCAN_MODE
|
||||
|
|
@ -67,6 +75,7 @@
|
|||
|
||||
// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
|
||||
#define SERIAL_REPEATER
|
||||
#define SERIAL_REPEATER_BAUD 9600
|
||||
|
||||
// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
|
||||
// #define SERIAL_REPEATER_USART1
|
||||
|
|
@ -86,10 +95,25 @@
|
|||
// Use the YSF and P25 LEDs for NXDN
|
||||
// #define USE_ALTERNATE_NXDN_LEDS
|
||||
|
||||
// Use the D-Star and P25 LEDs for M17
|
||||
// #define USE_ALTERNATE_M17_LEDS
|
||||
|
||||
// Use the D-Star and DMR LEDs for POCSAG
|
||||
// #define USE_ALTERNATE_POCSAG_LEDS
|
||||
|
||||
// Enable for RPi 3B+, USB mode
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
||||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
#define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
|
||||
# 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,86 +16,173 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
echo "******************************************************"
|
||||
echo "********* Cleaning objects and updating code *********"
|
||||
echo "******************************************************"
|
||||
cd ~/MMDVM_HS/
|
||||
make clean
|
||||
git pull
|
||||
|
||||
# Building ZUMspot Libre Kit
|
||||
echo "*******************************************************"
|
||||
echo "********* Building ZUMspot Libre Kit firmware *********"
|
||||
echo "*******************************************************"
|
||||
cp ~/MMDVM_HS/configs/ZUMspot_Libre.h ~/MMDVM_HS/Config.h
|
||||
make bl
|
||||
make -j4 bl
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_libre_fw.bin
|
||||
make clean
|
||||
|
||||
# Building ZUMspot RPi
|
||||
echo "*************************************************"
|
||||
echo "********* Building ZUMspot RPi firmware *********"
|
||||
echo "*************************************************"
|
||||
cp ~/MMDVM_HS/configs/ZUMspot_RPi.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/zumspot_rpi_fw.bin
|
||||
make clean
|
||||
|
||||
# Building ZUMspot USB
|
||||
echo "*************************************************"
|
||||
echo "********* Building ZUMspot USB firmware *********"
|
||||
echo "*************************************************"
|
||||
cp ~/MMDVM_HS/configs/ZUMspot_USB.h ~/MMDVM_HS/Config.h
|
||||
make bl
|
||||
make -j4 bl
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_usb_fw.bin
|
||||
make clean
|
||||
|
||||
# Building ZUMspot Duplex
|
||||
echo "****************************************************"
|
||||
echo "********* Building ZUMspot Duplex firmware *********"
|
||||
echo "****************************************************"
|
||||
cp ~/MMDVM_HS/configs/ZUMspot_duplex.h ~/MMDVM_HS/Config.h
|
||||
make bl
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/zumspot_duplex_fw.bin
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/zumspot_duplex_fw.bin
|
||||
make clean
|
||||
|
||||
# Building ZUMspot Dualband
|
||||
echo "******************************************************"
|
||||
echo "********* Building ZUMspot Dualband firmware *********"
|
||||
echo "******************************************************"
|
||||
cp ~/MMDVM_HS/configs/ZUMspot_dualband.h ~/MMDVM_HS/Config.h
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/zumspot_dualband_fw.bin
|
||||
make clean
|
||||
|
||||
# Building MMDVM_HS_Hat
|
||||
echo "**************************************************"
|
||||
echo "********* Building MMDVM_HS_Hat firmware *********"
|
||||
echo "**************************************************"
|
||||
cp ~/MMDVM_HS/configs/MMDVM_HS_Hat.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_hat_fw.bin
|
||||
make clean
|
||||
|
||||
# Building MMDVM_HS_Hat (12.288 MHz TCXO)
|
||||
echo "********************************************************************"
|
||||
echo "********* Building MMDVM_HS_Hat (12.288 MHz TCXO) firmware *********"
|
||||
echo "********************************************************************"
|
||||
cp ~/MMDVM_HS/configs/MMDVM_HS_Hat-12mhz.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_hat_fw-12mhz.bin
|
||||
make clean
|
||||
|
||||
# Building MMDVM_HS_Dual_Hat
|
||||
echo "*******************************************************"
|
||||
echo "********* Building MMDVM_HS_Dual_Hat firmware *********"
|
||||
echo "*******************************************************"
|
||||
cp ~/MMDVM_HS/configs/MMDVM_HS_Dual_Hat.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_dual_hat_fw.bin
|
||||
make clean
|
||||
|
||||
# Building MMDVM_HS_Dual_Hat (12.288 MHz TCXO)
|
||||
echo "*************************************************************************"
|
||||
echo "********* Building MMDVM_HS_Dual_Hat (12.288 MHz TCXO) firmware *********"
|
||||
echo "*************************************************************************"
|
||||
cp ~/MMDVM_HS/configs/MMDVM_HS_Dual_Hat-12mhz.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/mmdvm_hs_dual_hat_fw-12mhz.bin
|
||||
make clean
|
||||
|
||||
# Building Nano hotSPOT
|
||||
echo "**************************************************"
|
||||
echo "********* Building Nano hotSPOT firmware *********"
|
||||
echo "**************************************************"
|
||||
cp ~/MMDVM_HS/configs/Nano_hotSPOT.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/nano_hotspot_fw.bin
|
||||
make clean
|
||||
|
||||
# Building NanoDV NPi
|
||||
echo "************************************************"
|
||||
echo "********* Building NanoDV NPi firmware *********"
|
||||
echo "************************************************"
|
||||
cp ~/MMDVM_HS/configs/NanoDV_NPi.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/nanodv_npi_fw.bin
|
||||
make clean
|
||||
|
||||
# Building NanoDV USB
|
||||
echo "************************************************"
|
||||
echo "********* Building NanoDV USB firmware *********"
|
||||
echo "************************************************"
|
||||
cp ~/MMDVM_HS/configs/NanoDV_USB.h ~/MMDVM_HS/Config.h
|
||||
make bl
|
||||
make -j4 bl
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/nanodv_usb_fw.bin
|
||||
make clean
|
||||
|
||||
# Building D2RG MMDVM_HS
|
||||
echo "***************************************************"
|
||||
echo "********* Building D2RG MMDVM_HS firmware *********"
|
||||
echo "***************************************************"
|
||||
cp ~/MMDVM_HS/configs/D2RG_MMDVM_HS.h ~/MMDVM_HS/Config.h
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/d2rg_mmdvm_hs.bin
|
||||
make clean
|
||||
|
||||
# Building Generic Simplex GPIO
|
||||
echo "**********************************************************"
|
||||
echo "********* Building Generic Simplex GPIO firmware *********"
|
||||
echo "**********************************************************"
|
||||
cp ~/MMDVM_HS/configs/generic_gpio.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/generic_gpio_fw.bin
|
||||
make clean
|
||||
|
||||
# Building Generic Duplex GPIO
|
||||
echo "*********************************************************"
|
||||
echo "********* Building Generic Duplex GPIO firmware *********"
|
||||
echo "*********************************************************"
|
||||
cp ~/MMDVM_HS/configs/generic_duplex_gpio.h ~/MMDVM_HS/Config.h
|
||||
make
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/generic_duplex_gpio_fw.bin
|
||||
make clean
|
||||
|
||||
# Building Generic Duplex USB
|
||||
echo "********************************************************"
|
||||
echo "********* Building Generic Duplex USB firmware *********"
|
||||
echo "********************************************************"
|
||||
cp ~/MMDVM_HS/configs/generic_duplex_usb.h ~/MMDVM_HS/Config.h
|
||||
make -j4 bl
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/generic_duplex_usb_fw.bin
|
||||
make clean
|
||||
|
||||
# Building SkyBridge RPi HS
|
||||
echo "******************************************************"
|
||||
echo "********* Building SkyBridge RPi HS firmware *********"
|
||||
echo "******************************************************"
|
||||
cp ~/MMDVM_HS/configs/SkyBridge_RPi.h ~/MMDVM_HS/Config.h
|
||||
make -j4
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1.bin ~/MMDVM_HS/bin/skybridge_rpi_fw.bin
|
||||
make clean
|
||||
|
||||
# Building LoneStar USB
|
||||
echo "*************************************************"
|
||||
echo "********* Building LoneStar USB firmware *********"
|
||||
echo "*************************************************"
|
||||
cp ~/MMDVM_HS/configs/LoneStar_USB.h ~/MMDVM_HS/Config.h
|
||||
make -j4 bl
|
||||
mv ~/MMDVM_HS/bin/mmdvm_f1bl.bin ~/MMDVM_HS/bin/lonestar_usb_fw.bin
|
||||
make clean
|
||||
|
||||
cp ~/MMDVM_HS/configs/ZUMspot_Libre.h ~/MMDVM_HS/Config.h
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@ if [ $(uname -s) == "Linux" ]; then
|
|||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
|
|||
91
scripts/install_fw_d2rg_mmdvmhs.sh
Executable file
91
scripts/install_fw_d2rg_mmdvmhs.sh
Executable file
|
|
@ -0,0 +1,91 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="d2rg_mmdvm_hs.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
git clone https://github.com/juribeparada/STM32F10X_Lib
|
||||
fi
|
||||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv6l" ]; then
|
||||
echo "Raspberry Pi 2 or Pi Zero W detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
else
|
||||
echo "Linux 32-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
|
||||
fi
|
||||
|
||||
# Stop MMDVMHost process to free serial port
|
||||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
# Note: /dev/ttySC0 should be enabled, see: https://github.com/bg3mdo/D2RG_MMDVM_HS_ambe_uart_service
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 23,-22,22:-23,22 /dev/ttySC0
|
||||
|
||||
90
scripts/install_fw_dualband.sh
Executable file
90
scripts/install_fw_dualband.sh
Executable file
|
|
@ -0,0 +1,90 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="zumspot_dualband_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
git clone https://github.com/juribeparada/STM32F10X_Lib
|
||||
fi
|
||||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv6l" ]; then
|
||||
echo "Raspberry Pi 2 or Pi Zero W detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
else
|
||||
echo "Linux 32-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
|
||||
fi
|
||||
|
||||
# Stop MMDVMHost process to free serial port
|
||||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for ZUMspot Libre Kit
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_duplex_fw.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="zumspot_duplex_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -72,12 +85,6 @@ fi
|
|||
# Stop MMDVMHost process to free serial port
|
||||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Reset ZUMspot to enter bootloader mode
|
||||
eval sudo $DFU_RST $DEV_USB_SER 750
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $DFU_UTIL -D zumspot_duplex_fw.bin -d 1eaf:0003 -a 2 -R -R
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
echo
|
||||
echo "Please RESET your ZUMspot !"
|
||||
echo
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,25 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="generic_duplex_gpio_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download latest firmware for Generic Duplex GPIO
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/generic_duplex_gpio_fw.bin
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +44,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +79,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +89,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w generic_duplex_gpio_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
92
scripts/install_fw_duplex_gpio_opi.sh
Normal file
92
scripts/install_fw_duplex_gpio_opi.sh
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="generic_duplex_gpio_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download latest firmware for Generic Duplex GPIO
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
git clone https://github.com/juribeparada/STM32F10X_Lib
|
||||
fi
|
||||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv6l" ]; then
|
||||
echo "Raspberry Pi 2 or Pi Zero W detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
else
|
||||
echo "Linux 32-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
|
||||
fi
|
||||
|
||||
# Stop MMDVMHost process to free serial port
|
||||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 198,-199,199:-198,199 /dev/ttyS3
|
||||
101
scripts/install_fw_duplex_usb.sh
Executable file
101
scripts/install_fw_duplex_usb.sh
Executable file
|
|
@ -0,0 +1,101 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem14401"
|
||||
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="generic_duplex_usb_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
git clone https://github.com/juribeparada/STM32F10X_Lib
|
||||
fi
|
||||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv6l" ]; then
|
||||
echo "Raspberry Pi 2 or Pi Zero W detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
else
|
||||
echo "Linux 32-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
|
||||
fi
|
||||
|
||||
# Stop MMDVMHost process to free serial port
|
||||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Reset ZUMspot to enter bootloader mode
|
||||
eval sudo $DFU_RST $DEV_USB_SER 750
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R
|
||||
|
||||
echo
|
||||
echo "Please RESET your MMDVM_HS board !"
|
||||
echo
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for Generic Simplex GPIO
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/generic_gpio_fw.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="generic_gpio_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +86,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w generic_gpio_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for MMDVM_HS_Hat
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_dual_hat_fw-12mhz.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="mmdvm_hs_dual_hat_fw-12mhz.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +86,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w mmdvm_hs_dual_hat_fw-12mhz.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for MMDVM_HS_Hat
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_dual_hat_fw.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="mmdvm_hs_dual_hat_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +86,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w mmdvm_hs_dual_hat_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU, Florian Wolters DF2ET
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for MMDVM_HS_Hat with 12.288 MHz TCXO
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_hat_fw-12mhz.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="mmdvm_hs_hat_fw-12mhz.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +86,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w mmdvm_hs_hat_fw-12mhz.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for MMDVM_HS_Hat
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/mmdvm_hs_hat_fw.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="mmdvm_hs_hat_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +86,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w mmdvm_hs_hat_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
|
|
@ -17,13 +17,25 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem14401"
|
||||
|
||||
# Download latest firmware for ZUMspot Libre Kit
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_libre_fw.bin
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="zumspot_libre_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -39,6 +51,12 @@ if [ $(uname -s) == "Linux" ]; then
|
|||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -76,8 +94,8 @@ sudo killall MMDVMHost >/dev/null 2>&1
|
|||
eval sudo $DFU_RST $DEV_USB_SER 750
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $DFU_UTIL -D zumspot_libre_fw.bin -d 1eaf:0003 -a 2 -R -R
|
||||
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R
|
||||
|
||||
echo
|
||||
echo "Please RESET your ZUMspot !"
|
||||
echo "Please RESET your ZUMspot Libre Kit !"
|
||||
echo
|
||||
|
|
|
|||
101
scripts/install_fw_lonestar_usb.sh
Executable file
101
scripts/install_fw_lonestar_usb.sh
Executable file
|
|
@ -0,0 +1,101 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
|
||||
# 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.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.6.0"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem14401"
|
||||
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.6.0b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="lonestar_usb_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
git clone https://github.com/juribeparada/STM32F10X_Lib
|
||||
fi
|
||||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv6l" ]; then
|
||||
echo "Raspberry Pi 2 or Pi Zero W detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
else
|
||||
echo "Linux 32-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
|
||||
fi
|
||||
|
||||
# Stop MMDVMHost process to free serial port
|
||||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Reset ZUMspot to enter bootloader mode
|
||||
eval sudo $DFU_RST $DEV_USB_SER 750
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R
|
||||
|
||||
echo
|
||||
echo "Please RESET your LoneStar device !"
|
||||
echo
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for Nano DV
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/nanodv_npi_fw.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="nanodv_npi_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +86,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w nanodv_npi_fw.bin -g 0x0 -R -i 67,-66,66:-67,66 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 66,-67,67:-66,67 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
28
scripts/install_fw_nanodv_usb.sh
Normal file → Executable file
28
scripts/install_fw_nanodv_usb.sh
Normal file → Executable file
|
|
@ -17,13 +17,25 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem14401"
|
||||
|
||||
# Download latest firmware for ZUMspot USB
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/nanodv_usb_fw.bin
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="nanodv_usb_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -39,6 +51,12 @@ if [ $(uname -s) == "Linux" ]; then
|
|||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -76,7 +94,7 @@ sudo killall MMDVMHost >/dev/null 2>&1
|
|||
eval sudo $DFU_RST $DEV_USB_SER 750
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $DFU_UTIL -D nanodv_usb_fw.bin -d 1eaf:0003 -a 2 -R -R
|
||||
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R
|
||||
|
||||
echo
|
||||
echo "Please RESET your Nano DV !"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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,14 +16,34 @@
|
|||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# If we run this on a NanoPi board set the GPIO pins
|
||||
if [ -f /etc/pistar-release ]; then
|
||||
hardware=$(grep -i hardware /etc/pistar-release | awk -F "= " '{print $2}')
|
||||
if [[ ${hardware} == "NanoPi" ]]; then
|
||||
echo 3 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio3/direction
|
||||
echo 1 > /sys/class/gpio/gpio3/value
|
||||
echo 3 > /sys/class/gpio/unexport
|
||||
fi
|
||||
fi
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for Nano hotSPOT
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/nano_hotspot_fw.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="nano_hotspot_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +52,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +87,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +97,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w nano_hotspot_fw.bin -g 0x0 -R -i 200,-3,3:-200,3 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 200,-3,3:-200,3 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
# Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
|
||||
|
||||
# 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
|
||||
|
|
@ -17,13 +17,22 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Download latest firmware for ZUMspot RPi (GPIO)
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_rpi_fw.bin
|
||||
# Firmware filename
|
||||
FW_FILENAME="zumspot_rpi_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -32,13 +41,18 @@ fi
|
|||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
DEV_USB_SER="/dev/ttyACM0"
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -62,7 +76,6 @@ fi
|
|||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DEV_USB_SER=$MAC_DEV_USB_SER
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
|
|
@ -73,5 +86,5 @@ fi
|
|||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w zumspot_rpi_fw.bin -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
|
|||
90
scripts/install_fw_skybridge_rpi.sh
Executable file
90
scripts/install_fw_skybridge_rpi.sh
Executable file
|
|
@ -0,0 +1,90 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
|
||||
# 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.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="skybridge_rpi_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
git clone https://github.com/juribeparada/STM32F10X_Lib
|
||||
fi
|
||||
|
||||
# Configure vars depending on OS
|
||||
if [ $(uname -s) == "Linux" ]; then
|
||||
if [ $(uname -m) == "x86_64" ]; then
|
||||
echo "Linux 64-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux64/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv6l" ]; then
|
||||
echo "Raspberry Pi 2 or Pi Zero W detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
else
|
||||
echo "Linux 32-bit detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/linux/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/linux/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux/stm32flash"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(uname -s) == "Darwin" ]; then
|
||||
echo "macOS detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/macosx/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/macosx/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/macosx/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/macosx/stm32flash"
|
||||
fi
|
||||
|
||||
# Stop MMDVMHost process to free serial port
|
||||
sudo killall MMDVMHost >/dev/null 2>&1
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $STM32FLASH -v -w $FW_FILENAME -g 0x0 -R -i 20,-21,21:-20,21 /dev/ttyAMA0
|
||||
|
||||
|
|
@ -17,13 +17,25 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.7"
|
||||
FW_VERSION="v1.5.2"
|
||||
|
||||
# Change USB-serial port name ONLY in macOS
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem1441"
|
||||
MAC_DEV_USB_SER="/dev/cu.usbmodem14401"
|
||||
|
||||
# Download latest firmware for ZUMspot USB
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/zumspot_usb_fw.bin
|
||||
# Configure beta version
|
||||
FW_VERSION_BETA="v1.5.1b"
|
||||
|
||||
# Firmware filename
|
||||
FW_FILENAME="zumspot_usb_fw.bin"
|
||||
|
||||
# Download latest firmware
|
||||
if [ $1 = "beta" ]; then
|
||||
echo "Downloading beta firmware..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION_BETA/$FW_FILENAME
|
||||
else
|
||||
echo "Downloading latest firmware (stable)..."
|
||||
curl -OL https://github.com/juribeparada/MMDVM_HS/releases/download/$FW_VERSION/$FW_FILENAME
|
||||
fi
|
||||
|
||||
# Download STM32F10X_Lib (only for binary tools)
|
||||
if [ ! -d "./STM32F10X_Lib/utils" ]; then
|
||||
|
|
@ -39,6 +51,12 @@ if [ $(uname -s) == "Linux" ]; then
|
|||
DFU_UTIL="./STM32F10X_Lib/utils/linux64/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/linux64/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/linux64/stm32flash"
|
||||
elif [ $(uname -m) == "aarch64" ] ; then
|
||||
echo "Raspberry Pi 4 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
DFU_UTIL="./STM32F10X_Lib/utils/rpi32/dfu-util"
|
||||
ST_FLASH="./STM32F10X_Lib/utils/rpi32/st-flash"
|
||||
STM32FLASH="./STM32F10X_Lib/utils/rpi32/stm32flash"
|
||||
elif [ $(uname -m) == "armv7l" ]; then
|
||||
echo "Raspberry Pi 3 detected"
|
||||
DFU_RST="./STM32F10X_Lib/utils/rpi32/upload-reset"
|
||||
|
|
@ -76,7 +94,7 @@ sudo killall MMDVMHost >/dev/null 2>&1
|
|||
eval sudo $DFU_RST $DEV_USB_SER 750
|
||||
|
||||
# Upload the firmware
|
||||
eval sudo $DFU_UTIL -D zumspot_usb_fw.bin -d 1eaf:0003 -a 2 -R -R
|
||||
eval sudo $DFU_UTIL -D $FW_FILENAME -d 1eaf:0003 -a 2 -R -R
|
||||
|
||||
echo
|
||||
echo "Please RESET your ZUMspot !"
|
||||
|
|
|
|||
17
version.h
17
version.h
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (C) 2017,2018 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2017,2018,2019,2020 by Andy Uribe CA6JAU
|
||||
* Copyright (C) 2020,2021 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
|
||||
|
|
@ -23,9 +24,9 @@
|
|||
#include "ADF7021.h"
|
||||
|
||||
#define VER_MAJOR "1"
|
||||
#define VER_MINOR "4"
|
||||
#define VER_REV "7"
|
||||
#define VERSION_DATE "20180821"
|
||||
#define VER_MINOR "6"
|
||||
#define VER_REV "0"
|
||||
#define VERSION_DATE "20210919"
|
||||
|
||||
#if defined(ZUMSPOT_ADF7021)
|
||||
#define BOARD_INFO "ZUMspot"
|
||||
|
|
@ -35,8 +36,14 @@
|
|||
#define BOARD_INFO "MMDVM_HS_Dual_Hat"
|
||||
#elif defined(NANO_HOTSPOT)
|
||||
#define BOARD_INFO "Nano_hotSPOT"
|
||||
#elif defined(NANO_DV_REV10)
|
||||
#elif defined(NANO_DV_REV11)
|
||||
#define BOARD_INFO "Nano_DV"
|
||||
#elif defined(D2RG_MMDVM_HS)
|
||||
#define BOARD_INFO "D2RG_MMDVM_HS"
|
||||
#elif defined(SKYBRIDGE_HS)
|
||||
#define BOARD_INFO "SkyBridge"
|
||||
#elif defined(LONESTAR_USB)
|
||||
#define BOARD_INFO "LS_USB_STICK"
|
||||
#else
|
||||
#define BOARD_INFO "MMDVM_HS"
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in a new issue