mirror of
https://github.com/juribeparada/MMDVM_HS.git
synced 2025-12-06 07:12:08 +01:00
Compare commits
126 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 |
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,3 +5,4 @@ bin/
|
|||
|
||||
GitVersion\.h
|
||||
|
||||
.vscode/
|
||||
|
|
|
|||
178
ADF7021.cpp
178
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,14 +49,13 @@ 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--) {
|
||||
if(bitRead(AD7021_control_word, AD7021_counter) == HIGH)
|
||||
for (int AD7021_counter = 31; AD7021_counter >= 0; AD7021_counter--) {
|
||||
if (bitRead(AD7021_control_word, AD7021_counter) == HIGH)
|
||||
io.SDATA_pin(HIGH);
|
||||
else
|
||||
io.SDATA_pin(LOW);
|
||||
|
|
@ -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,9 +81,8 @@ void Send_AD7021_control(bool doSle)
|
|||
{
|
||||
Send_AD7021_control_shift();
|
||||
|
||||
if (doSle) {
|
||||
if (doSle)
|
||||
Send_AD7021_control_slePulse();
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DUPLEX)
|
||||
|
|
@ -97,9 +97,8 @@ void Send_AD7021_control2(bool doSle)
|
|||
{
|
||||
Send_AD7021_control_shift();
|
||||
|
||||
if (doSle) {
|
||||
if (doSle)
|
||||
Send_AD7021_control_sle2Pulse();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -108,15 +107,14 @@ 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--) {
|
||||
if(bitRead(AD7021_RB, AD7021_counter) == HIGH)
|
||||
for (int AD7021_counter = 8; AD7021_counter >= 0; AD7021_counter--) {
|
||||
if (bitRead(AD7021_RB, AD7021_counter) == HIGH)
|
||||
SDATA_pin(HIGH);
|
||||
else
|
||||
SDATA_pin(LOW);
|
||||
|
|
@ -141,16 +139,15 @@ uint16_t CIO::readRSSI()
|
|||
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();
|
||||
|
||||
if( (AD7021_counter != 17) && (AD7021_counter != 0) )
|
||||
RB_word |= ( (SREAD_pin() & 0x01) << (AD7021_counter-1) );
|
||||
if ((AD7021_counter != 17) && (AD7021_counter != 0))
|
||||
RB_word |= ((SREAD_pin() & 0x01) << (AD7021_counter - 1));
|
||||
|
||||
SCLK_pin(LOW);
|
||||
dlybit();
|
||||
|
||||
}
|
||||
|
||||
#if defined(DUPLEX)
|
||||
|
|
@ -216,8 +213,12 @@ 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) {
|
||||
if (reset) {
|
||||
CE_pin(LOW);
|
||||
delay_reset();
|
||||
CE_pin(HIGH);
|
||||
|
|
@ -225,28 +226,24 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
}
|
||||
|
||||
// Check frequency band
|
||||
if( (m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX) ) {
|
||||
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;
|
||||
}
|
||||
|
||||
if(div2 == 1U)
|
||||
if (div2 == 1U)
|
||||
f_div = 2U;
|
||||
else
|
||||
f_div = 1U;
|
||||
|
|
@ -269,14 +266,17 @@ 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;
|
||||
}
|
||||
|
||||
if( div2 == 1U )
|
||||
if (div2 == 1U)
|
||||
divider = (m_frequency_rx - 100000 + AFC_OFFSET) / (ADF7021_PFD / 2U);
|
||||
else
|
||||
divider = (m_frequency_rx - 100000 + (2*AFC_OFFSET)) / ADF7021_PFD;
|
||||
divider = (m_frequency_rx - 100000 + (2 * AFC_OFFSET)) / ADF7021_PFD;
|
||||
|
||||
m_RX_N_divider = floor(divider);
|
||||
divider = (divider - m_RX_N_divider) * 32768;
|
||||
|
|
@ -293,7 +293,7 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
ADF7021_RX_REG0 |= (uint32_t) m_RX_N_divider << 19; // frequency;
|
||||
ADF7021_RX_REG0 |= (uint32_t) m_RX_F_divider << 4; // frequency;
|
||||
|
||||
if( div2 == 1U )
|
||||
if (div2 == 1U)
|
||||
divider = m_frequency_tx / (ADF7021_PFD / 2U);
|
||||
else
|
||||
divider = m_frequency_tx / ADF7021_PFD;
|
||||
|
|
@ -415,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;
|
||||
|
|
@ -495,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;
|
||||
}
|
||||
|
|
@ -587,7 +614,7 @@ void CIO::ifConf(MMDVM_STATE modemState, bool reset)
|
|||
}
|
||||
|
||||
#if defined(DUPLEX)
|
||||
if(m_duplex && (modemState != STATE_CWID && modemState != STATE_POCSAG))
|
||||
if (m_duplex && (modemState != STATE_CWID && modemState != STATE_POCSAG))
|
||||
ifConf2(modemState);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -649,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;
|
||||
|
|
@ -717,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;
|
||||
}
|
||||
|
|
@ -803,25 +853,23 @@ 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;
|
||||
|
||||
#if defined(BIDIR_DATA_PIN)
|
||||
if(bit)
|
||||
if (bit)
|
||||
RXD_pin_write(HIGH);
|
||||
else
|
||||
RXD_pin_write(LOW);
|
||||
#else
|
||||
if(bit)
|
||||
if (bit)
|
||||
TXD_pin(HIGH);
|
||||
else
|
||||
TXD_pin(LOW);
|
||||
|
|
@ -853,7 +901,7 @@ void CIO::interrupt()
|
|||
|
||||
// we sample the RX bit at rising TXD clock edge, so TXD must be 1 and we are not in tx mode
|
||||
if (!m_tx && clk == 1U && !m_duplex) {
|
||||
if(RXD_pin())
|
||||
if (RXD_pin())
|
||||
bit = 1U;
|
||||
else
|
||||
bit = 0U;
|
||||
|
|
@ -861,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);
|
||||
|
|
@ -887,10 +935,10 @@ void CIO::interrupt()
|
|||
m_modeTimerCnt++;
|
||||
m_int1counter++;
|
||||
|
||||
if(m_scanPauseCnt >= SCAN_PAUSE)
|
||||
if (m_scanPauseCnt >= SCAN_PAUSE)
|
||||
m_scanPauseCnt = 0U;
|
||||
|
||||
if(m_scanPauseCnt != 0U)
|
||||
if (m_scanPauseCnt != 0U)
|
||||
m_scanPauseCnt++;
|
||||
}
|
||||
|
||||
|
|
@ -899,8 +947,8 @@ void CIO::interrupt2()
|
|||
{
|
||||
uint8_t bit = 0U;
|
||||
|
||||
if(m_duplex) {
|
||||
if(RXD2_pin())
|
||||
if (m_duplex) {
|
||||
if (RXD2_pin())
|
||||
bit = 1U;
|
||||
else
|
||||
bit = 0U;
|
||||
|
|
@ -944,7 +992,7 @@ void CIO::setRX(bool doSle)
|
|||
Data_dir_out(false); // Data pin input mode
|
||||
#endif
|
||||
|
||||
if(!doSle) {
|
||||
if (!doSle) {
|
||||
torx_request = true;
|
||||
while(torx_request) { asm volatile ("nop"); }
|
||||
}
|
||||
|
|
@ -955,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);
|
||||
|
|
@ -967,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);
|
||||
}
|
||||
|
||||
|
|
@ -976,28 +1025,24 @@ void CIO::updateCal()
|
|||
float divider;
|
||||
|
||||
// Check frequency band
|
||||
if( (m_frequency_tx >= VHF1_MIN) && (m_frequency_tx < VHF1_MAX) ) {
|
||||
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;
|
||||
}
|
||||
|
||||
if(div2 == 1U)
|
||||
if (div2 == 1U)
|
||||
f_div = 2U;
|
||||
else
|
||||
f_div = 1U;
|
||||
|
|
@ -1007,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
|
||||
ADF7021_REG2 |= (uint32_t) 0b111 << 4; // modulation (RC 4FSK)
|
||||
|
||||
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
|
||||
|
|
@ -1016,7 +1068,7 @@ void CIO::updateCal()
|
|||
AD7021_control_word = ADF7021_REG2;
|
||||
Send_AD7021_control();
|
||||
|
||||
if( div2 == 1U )
|
||||
if (div2 == 1U)
|
||||
divider = m_frequency_tx / (ADF7021_PFD / 2U);
|
||||
else
|
||||
divider = m_frequency_tx / ADF7021_PFD;
|
||||
|
|
@ -1079,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));
|
||||
|
|
@ -1095,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
|
||||
|
||||
|
|
|
|||
8
BUILD.md
8
BUILD.md
|
|
@ -483,6 +483,14 @@ Please check here for detailed instructions:
|
|||
|
||||
- make mmdvm_hs_hat: upload the firmware to MMDVM_HS_Hat board (using internal RPi serial port)
|
||||
|
||||
- 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.
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ const struct {
|
|||
{',', 0xEEAEE000U, 22U},
|
||||
{'-', 0xEAAE0000U, 18U},
|
||||
{'=', 0xEAB80000U, 16U},
|
||||
{'.', 0xBAEB8000U, 20U},
|
||||
{' ', 0x00000000U, 4U},
|
||||
{0U, 0x00000000U, 0U}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -144,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;
|
||||
|
|
|
|||
19
Config.h
19
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,6 +97,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +115,7 @@
|
|||
// Disable frequency restrictions (satellite, ISS, etc)
|
||||
// #define DISABLE_FREQ_BAN
|
||||
|
||||
// Enable UDID feature
|
||||
// #define ENABLE_UDID
|
||||
|
||||
#endif
|
||||
|
|
|
|||
34
DStarRX.cpp
34
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);
|
||||
|
|
@ -370,7 +370,7 @@ void CDStarRX::processData(bool bit)
|
|||
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);
|
||||
|
||||
|
|
@ -383,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;
|
||||
|
|
@ -393,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
|
||||
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
private:
|
||||
DSRX_STATE m_rxState;
|
||||
uint32_t m_patternBuffer;
|
||||
uint64_t m_patternBuffer;
|
||||
uint8_t m_rxBuffer[DSTAR_BUFFER_LENGTH_BITS / 8U];
|
||||
unsigned int m_rxBufferBits;
|
||||
unsigned int m_dataBits;
|
||||
|
|
|
|||
20
Globals.h
20
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,6 +42,7 @@ enum MMDVM_STATE {
|
|||
STATE_P25 = 4,
|
||||
STATE_NXDN = 5,
|
||||
STATE_POCSAG = 6,
|
||||
STATE_M17 = 7,
|
||||
|
||||
// Dummy states start at 90
|
||||
STATE_DMRDMO1K = 92,
|
||||
|
|
@ -48,7 +50,8 @@ enum MMDVM_STATE {
|
|||
STATE_CWID = 97,
|
||||
STATE_DMRCAL = 98,
|
||||
STATE_DSTARCAL = 99,
|
||||
STATE_INTCAL = 100
|
||||
STATE_INTCAL = 100,
|
||||
STATE_POCSAGCAL = 101
|
||||
};
|
||||
|
||||
const uint8_t MARK_SLOT1 = 0x08U;
|
||||
|
|
@ -75,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"
|
||||
|
|
@ -83,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;
|
||||
|
|
@ -100,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;
|
||||
|
|
@ -130,6 +137,9 @@ extern CYSFTX ysfTX;
|
|||
extern CP25RX p25RX;
|
||||
extern CP25TX p25TX;
|
||||
|
||||
extern CM17RX m17RX;
|
||||
extern CM17TX m17TX;
|
||||
|
||||
extern CNXDNRX nxdnRX;
|
||||
extern CNXDNTX nxdnTX;
|
||||
|
||||
|
|
@ -143,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
|
||||
82
IO.cpp
82
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
|
||||
|
|
@ -51,6 +51,7 @@ m_int2counter(0U)
|
|||
YSF_pin(LOW);
|
||||
P25_pin(LOW);
|
||||
NXDN_pin(LOW);
|
||||
M17_pin(LOW);
|
||||
POCSAG_pin(LOW);
|
||||
COS_pin(LOW);
|
||||
DEB_pin(LOW);
|
||||
|
|
@ -89,6 +90,7 @@ void CIO::selfTest()
|
|||
YSF_pin(ledValue);
|
||||
P25_pin(ledValue);
|
||||
NXDN_pin(ledValue);
|
||||
M17_pin(ledValue);
|
||||
POCSAG_pin(ledValue);
|
||||
COS_pin(ledValue);
|
||||
|
||||
|
|
@ -111,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);
|
||||
}
|
||||
|
|
@ -178,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;
|
||||
|
||||
|
|
@ -221,6 +225,9 @@ void CIO::process()
|
|||
case STATE_NXDN:
|
||||
nxdnRX.databit(bit);
|
||||
break;
|
||||
case STATE_M17:
|
||||
m17RX.databit(bit);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -252,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)
|
||||
|
|
@ -307,6 +318,47 @@ 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
|
||||
|
|
@ -338,6 +390,13 @@ uint8_t CIO::setFreq(uint32_t frequency_rx, uint32_t frequency_tx, uint8_t rf_po
|
|||
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;
|
||||
m_frequency_tx = frequency_tx;
|
||||
|
|
@ -364,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
|
||||
|
|
@ -378,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)
|
||||
|
|
|
|||
19
IO.h
19
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
|
||||
|
|
@ -98,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);
|
||||
|
|
@ -124,6 +125,13 @@ public:
|
|||
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);
|
||||
|
|
@ -134,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)
|
||||
|
|
@ -155,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
|
||||
|
|
@ -174,7 +183,7 @@ 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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -81,7 +81,7 @@
|
|||
#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__)
|
||||
|
|
@ -156,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
|
||||
|
||||
|
|
|
|||
114
IOSTM.cpp
114
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,6 +84,10 @@
|
|||
#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
|
||||
|
||||
|
|
@ -92,7 +97,7 @@
|
|||
#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
|
||||
|
|
@ -115,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
|
||||
|
|
@ -122,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
|
||||
|
|
@ -153,6 +178,14 @@
|
|||
#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
|
||||
|
||||
|
|
@ -162,7 +195,7 @@
|
|||
#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
|
||||
|
|
@ -228,6 +261,10 @@
|
|||
#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
|
||||
|
||||
|
|
@ -238,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" {
|
||||
|
|
@ -260,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) {
|
||||
|
|
@ -280,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
|
||||
|
||||
|
|
@ -304,10 +348,34 @@ void CIO::Init()
|
|||
|
||||
#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)
|
||||
#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 = 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;
|
||||
|
|
@ -316,6 +384,8 @@ void CIO::Init()
|
|||
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);
|
||||
|
|
@ -393,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
|
||||
|
||||
|
|
@ -478,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
|
||||
|
|
@ -496,7 +567,11 @@ 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
|
||||
|
|
@ -526,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
|
||||
|
|
@ -676,6 +751,16 @@ 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)
|
||||
|
|
@ -696,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
|
||||
|
||||
16
MMDVM_HS.cpp
16
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,6 +129,9 @@ 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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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,6 +119,9 @@ 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();
|
||||
|
||||
|
|
|
|||
66
Makefile
66
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
|
||||
|
|
@ -110,10 +110,20 @@ else
|
|||
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
|
||||
ST_FLASH=./$(F1_LIB_PATH)/utils/linux64/st-flash
|
||||
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
|
||||
|
|
@ -128,7 +138,13 @@ else
|
|||
else
|
||||
DFU_RST=./$(F1_LIB_PATH)/utils/linux/upload-reset
|
||||
DFU_UTIL=./$(F1_LIB_PATH)/utils/linux/dfu-util
|
||||
ST_FLASH=./$(F1_LIB_PATH)/utils/linux/st-flash
|
||||
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
|
||||
|
|
@ -405,18 +421,20 @@ 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) write bin/$(BINBIN_F1NOBL) 0x8000000
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1NOBL) 0x8000000
|
||||
|
||||
stlink-bl:
|
||||
$(ST_FLASH) write $(F1_LIB_PATH)/utils/bootloader/generic_boot20_pc13_long_rst.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) 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.bin 0x8000000
|
||||
sleep 3
|
||||
$(ST_FLASH) $(ST_FLASH_OPTS) write bin/$(BINBIN_F1BL) 0x8002000
|
||||
|
||||
serial:
|
||||
$(STM32FLASH) -v -w bin/$(BINBIN_F1) -g 0x0 $(devser)
|
||||
|
|
@ -426,10 +444,12 @@ serial-nobl:
|
|||
|
||||
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:
|
||||
|
|
@ -443,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:
|
||||
|
|
@ -463,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
|
||||
|
|
|
|||
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);
|
||||
};
|
||||
|
|
|
|||
61
README.md
61
README.md
|
|
@ -119,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:
|
||||
|
||||
|
|
@ -147,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:
|
||||
|
|
@ -179,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):
|
||||
|
|
@ -262,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
|
||||
|
|
@ -305,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 74ff93791264faef4c2d8e871b2877d24e0bd1c1
|
||||
Subproject commit 1debc23063f3942608e2bd62d04d5e1249c47fa3
|
||||
276
SerialPort.cpp
276
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;
|
||||
|
|
@ -77,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)
|
||||
{
|
||||
|
|
@ -119,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;
|
||||
|
|
@ -135,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);
|
||||
|
||||
|
|
@ -189,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;
|
||||
|
|
@ -206,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);
|
||||
|
|
@ -213,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;
|
||||
|
|
@ -227,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)
|
||||
|
|
@ -234,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_INTCAL && 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;
|
||||
|
|
@ -248,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)
|
||||
|
|
@ -263,22 +292,18 @@ 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 || modemState == STATE_INTCAL) {
|
||||
|
|
@ -289,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;
|
||||
|
|
@ -302,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);
|
||||
|
||||
|
|
@ -322,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 && modemState != STATE_INTCAL)) {
|
||||
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)
|
||||
|
|
@ -333,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);
|
||||
}
|
||||
|
|
@ -342,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 || modemState == STATE_INTCAL)
|
||||
if (modemState == STATE_DMRCAL || modemState == STATE_DMRDMO1K || modemState == STATE_RSSICAL || modemState == STATE_INTCAL || modemState == STATE_POCSAGCAL)
|
||||
m_firstCal = true;
|
||||
|
||||
return 0U;
|
||||
|
|
@ -359,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 && modemState != STATE_INTCAL)
|
||||
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;
|
||||
|
|
@ -371,6 +410,8 @@ 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;
|
||||
|
||||
|
|
@ -380,6 +421,12 @@ uint8_t CSerialPort::setMode(const uint8_t* data, uint8_t length)
|
|||
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;
|
||||
|
|
@ -439,6 +486,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_DSTAR:
|
||||
|
|
@ -451,6 +499,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_YSF:
|
||||
|
|
@ -463,6 +512,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
dstarRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_P25:
|
||||
|
|
@ -475,6 +525,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
dstarRX.reset();
|
||||
ysfRX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
case STATE_NXDN:
|
||||
|
|
@ -487,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:
|
||||
|
|
@ -500,6 +565,7 @@ void CSerialPort::setMode(MMDVM_STATE modemState)
|
|||
ysfRX.reset();
|
||||
p25RX.reset();
|
||||
nxdnRX.reset();
|
||||
m17RX.reset();
|
||||
cwIdTX.reset();
|
||||
break;
|
||||
default:
|
||||
|
|
@ -523,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
|
||||
}
|
||||
|
||||
|
|
@ -592,6 +658,8 @@ 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_POCSAGCAL) {
|
||||
err = pocsagTX.setCal(m_buffer + 3U, m_len - 3U);
|
||||
} else if (m_calState == STATE_RSSICAL || m_calState == STATE_INTCAL) {
|
||||
err = 0U;
|
||||
}
|
||||
|
|
@ -799,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) {
|
||||
|
|
@ -844,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)
|
||||
|
|
@ -1112,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)
|
||||
|
|
|
|||
14
SerialPort.h
14
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
|
||||
|
|
@ -65,6 +74,9 @@ 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -501,12 +536,14 @@ void CSerialPort::writeInt(uint8_t n, const uint8_t* data, uint16_t length, bool
|
|||
case 1U:
|
||||
#if defined(STM32_USART1_HOST)
|
||||
WriteUSART1(data, length);
|
||||
if (flush)
|
||||
TXSerialFlush1();
|
||||
if (flush)
|
||||
TXSerialFlush1();
|
||||
#elif defined(STM32_USB_HOST)
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
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};
|
||||
|
||||
|
|
|
|||
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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,8 +95,11 @@
|
|||
// 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
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,8 +95,11 @@
|
|||
// 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
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +94,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +112,7 @@
|
|||
// 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,14 +95,17 @@
|
|||
// 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
|
||||
// #define LONG_USB_RESET
|
||||
|
||||
// Enable modem debug messages
|
||||
// #define ENABLE_DEBUG
|
||||
#define ENABLE_DEBUG
|
||||
|
||||
// Disable frequency bands check
|
||||
// #define DISABLE_FREQ_CHECK
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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,6 +95,9 @@
|
|||
// 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
|
||||
|
||||
|
|
@ -101,4 +113,7 @@
|
|||
// 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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -17,13 +17,25 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
# Configure latest version
|
||||
FW_VERSION="v1.4.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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.14"
|
||||
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 "14"
|
||||
#define VERSION_DATE "20181209"
|
||||
#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