mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-10-16 08:44:11 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c61ee6be8 |
@@ -101,9 +101,13 @@ void CIO::initInt()
|
|||||||
pinMode(PIN_DMR, OUTPUT);
|
pinMode(PIN_DMR, OUTPUT);
|
||||||
pinMode(PIN_YSF, OUTPUT);
|
pinMode(PIN_YSF, OUTPUT);
|
||||||
pinMode(PIN_P25, OUTPUT);
|
pinMode(PIN_P25, OUTPUT);
|
||||||
|
#if !defined(USE_ALTERNATE_NXDN_LEDS)
|
||||||
pinMode(PIN_NXDN, OUTPUT);
|
pinMode(PIN_NXDN, OUTPUT);
|
||||||
|
#endif
|
||||||
|
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||||
pinMode(PIN_POCSAG, OUTPUT);
|
pinMode(PIN_POCSAG, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIO::startInt()
|
void CIO::startInt()
|
||||||
|
|||||||
@@ -338,6 +338,7 @@ DMR PC8 output
|
|||||||
YSF PA8 output
|
YSF PA8 output
|
||||||
P25 PC9 output
|
P25 PC9 output
|
||||||
NXDN PB1 output
|
NXDN PB1 output
|
||||||
|
POCSAG PB12 output
|
||||||
|
|
||||||
RX PA0 analog input
|
RX PA0 analog input
|
||||||
RSSI PA7 analog input
|
RSSI PA7 analog input
|
||||||
@@ -370,6 +371,10 @@ EXT_CLK PA15 input
|
|||||||
#define PORT_NXDN GPIOB
|
#define PORT_NXDN GPIOB
|
||||||
#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB
|
#define RCC_Per_NXDN RCC_AHB1Periph_GPIOB
|
||||||
|
|
||||||
|
#define PIN_POCSAG GPIO_Pin_12
|
||||||
|
#define PORT_NXDN GPIOB
|
||||||
|
#define RCC_Per_POCSAG RCC_AHB1Periph_GPIOB
|
||||||
|
|
||||||
#define PIN_DSTAR GPIO_Pin_7
|
#define PIN_DSTAR GPIO_Pin_7
|
||||||
#define PORT_DSTAR GPIOC
|
#define PORT_DSTAR GPIOC
|
||||||
#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOC
|
#define RCC_Per_DSTAR RCC_AHB1Periph_GPIOC
|
||||||
@@ -837,6 +842,7 @@ void CIO::initInt()
|
|||||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
GPIO_Init(PORT_P25, &GPIO_InitStruct);
|
GPIO_Init(PORT_P25, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
#if !defined(USE_ALTERNATE_NXDN_LEDS)
|
||||||
// NXDN pin
|
// NXDN pin
|
||||||
RCC_AHB1PeriphClockCmd(RCC_Per_NXDN, ENABLE);
|
RCC_AHB1PeriphClockCmd(RCC_Per_NXDN, ENABLE);
|
||||||
GPIO_InitStruct.GPIO_Pin = PIN_NXDN;
|
GPIO_InitStruct.GPIO_Pin = PIN_NXDN;
|
||||||
@@ -844,6 +850,15 @@ void CIO::initInt()
|
|||||||
GPIO_Init(PORT_NXDN, &GPIO_InitStruct);
|
GPIO_Init(PORT_NXDN, &GPIO_InitStruct);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||||
|
// POCSAG pin
|
||||||
|
RCC_AHB1PeriphClockCmd(RCC_Per_POCSAG, ENABLE);
|
||||||
|
GPIO_InitStruct.GPIO_Pin = PIN_POCSAG;
|
||||||
|
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
|
GPIO_Init(PORT_POCSAG, &GPIO_InitStruct);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(STM32F4_NUCLEO_MODE_PINS) && defined(STM32F4_NUCLEO_MORPHO_HEADER) && defined(STM32F4_NUCLEO)
|
#if defined(STM32F4_NUCLEO_MODE_PINS) && defined(STM32F4_NUCLEO_MORPHO_HEADER) && defined(STM32F4_NUCLEO)
|
||||||
// DSTAR mode pin
|
// DSTAR mode pin
|
||||||
RCC_AHB1PeriphClockCmd(RCC_Per_MDSTAR, ENABLE);
|
RCC_AHB1PeriphClockCmd(RCC_Per_MDSTAR, ENABLE);
|
||||||
@@ -869,12 +884,22 @@ void CIO::initInt()
|
|||||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
GPIO_Init(PORT_MP25, &GPIO_InitStruct);
|
GPIO_Init(PORT_MP25, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
#if !defined(USE_ALTERNATE_NXDN_LEDS)
|
||||||
// NXDN mode pin
|
// NXDN mode pin
|
||||||
RCC_AHB1PeriphClockCmd(RCC_Per_MNXDN, ENABLE);
|
RCC_AHB1PeriphClockCmd(RCC_Per_MNXDN, ENABLE);
|
||||||
GPIO_InitStruct.GPIO_Pin = PIN_MNXDN;
|
GPIO_InitStruct.GPIO_Pin = PIN_MNXDN;
|
||||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
GPIO_Init(PORT_MNXDN, &GPIO_InitStruct);
|
GPIO_Init(PORT_MNXDN, &GPIO_InitStruct);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||||
|
// POCSAG mode pin
|
||||||
|
RCC_AHB1PeriphClockCmd(RCC_Per_MPOCSAG, ENABLE);
|
||||||
|
GPIO_InitStruct.GPIO_Pin = PIN_MPOCSAG;
|
||||||
|
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||||
|
GPIO_Init(PORT_MPOCSAG, &GPIO_InitStruct);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIO::startInt()
|
void CIO::startInt()
|
||||||
@@ -1134,11 +1159,16 @@ void CIO::setPOCSAGInt(bool on)
|
|||||||
{
|
{
|
||||||
#if defined(USE_ALTERNATE_POCSAG_LEDS)
|
#if defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||||
GPIO_WriteBit(PORT_DSTAR, PIN_DSTAR, on ? Bit_SET : Bit_RESET);
|
GPIO_WriteBit(PORT_DSTAR, PIN_DSTAR, on ? Bit_SET : Bit_RESET);
|
||||||
GPIO_WriteBit(PORT_DMR, PIN_DMR, on ? Bit_SET : Bit_RESET);
|
GPIO_WriteBit(PORT_DMR, PIN_DMR, on ? Bit_SET : Bit_RESET);
|
||||||
#if defined(STM32F4_NUCLEO_MODE_PINS) && defined(STM32F4_NUCLEO_MORPHO_HEADER) && defined(STM32F4_NUCLEO)
|
#if defined(STM32F4_NUCLEO_MODE_PINS) && defined(STM32F4_NUCLEO_MORPHO_HEADER) && defined(STM32F4_NUCLEO)
|
||||||
GPIO_WriteBit(PORT_MDSTAR, PIN_MDSTAR, on ? Bit_SET : Bit_RESET);
|
GPIO_WriteBit(PORT_MDSTAR, PIN_MDSTAR, on ? Bit_SET : Bit_RESET);
|
||||||
GPIO_WriteBit(PORT_MDMR, PIN_MDMR, on ? Bit_SET : Bit_RESET);
|
GPIO_WriteBit(PORT_MDMR, PIN_MDMR, on ? Bit_SET : Bit_RESET);
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
GPIO_WriteBit(PORT_POCSAG, PIN_POCSAG, on ? Bit_SET : Bit_RESET);
|
||||||
|
#if defined(STM32F4_NUCLEO_MODE_PINS) && defined(STM32F4_NUCLEO_MORPHO_HEADER) && defined(STM32F4_NUCLEO)
|
||||||
|
GPIO_WriteBit(PORT_MPOCSAG, PIN_MPOCSAG, on ? Bit_SET : Bit_RESET);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -222,9 +222,13 @@ static inline void GPIOInit()
|
|||||||
GPIOConfigPin(PORT_DMR, PIN_DMR, GPIO_CRL_MODE0_1);
|
GPIOConfigPin(PORT_DMR, PIN_DMR, GPIO_CRL_MODE0_1);
|
||||||
GPIOConfigPin(PORT_YSF, PIN_YSF, GPIO_CRL_MODE0_1);
|
GPIOConfigPin(PORT_YSF, PIN_YSF, GPIO_CRL_MODE0_1);
|
||||||
GPIOConfigPin(PORT_P25, PIN_P25, GPIO_CRL_MODE0_1);
|
GPIOConfigPin(PORT_P25, PIN_P25, GPIO_CRL_MODE0_1);
|
||||||
|
#if !defined(USE_ALTERNATE_NXDN_LEDS)
|
||||||
GPIOConfigPin(PORT_NXDN, PIN_NXDN, GPIO_CRL_MODE0_1);
|
GPIOConfigPin(PORT_NXDN, PIN_NXDN, GPIO_CRL_MODE0_1);
|
||||||
|
#endif
|
||||||
|
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||||
GPIOConfigPin(PORT_POCSAG, PIN_POCSAG, GPIO_CRL_MODE0_1);
|
GPIOConfigPin(PORT_POCSAG, PIN_POCSAG, GPIO_CRL_MODE0_1);
|
||||||
|
#endif
|
||||||
|
|
||||||
GPIOConfigPin(PORT_RX, PIN_RX, 0);
|
GPIOConfigPin(PORT_RX, PIN_RX, 0);
|
||||||
#if defined(SEND_RSSI_DATA)
|
#if defined(SEND_RSSI_DATA)
|
||||||
GPIOConfigPin(PORT_RSSI, PIN_RSSI, 0);
|
GPIOConfigPin(PORT_RSSI, PIN_RSSI, 0);
|
||||||
|
|||||||
@@ -70,9 +70,13 @@ void CIO::initInt()
|
|||||||
pinMode(PIN_DMR, OUTPUT);
|
pinMode(PIN_DMR, OUTPUT);
|
||||||
pinMode(PIN_YSF, OUTPUT);
|
pinMode(PIN_YSF, OUTPUT);
|
||||||
pinMode(PIN_P25, OUTPUT);
|
pinMode(PIN_P25, OUTPUT);
|
||||||
|
#if !defined(USE_ALTERNATE_NXDN_LEDS)
|
||||||
pinMode(PIN_NXDN, OUTPUT);
|
pinMode(PIN_NXDN, OUTPUT);
|
||||||
|
#endif
|
||||||
|
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||||
pinMode(PIN_POCSAG, OUTPUT);
|
pinMode(PIN_POCSAG, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CIO::startInt()
|
void CIO::startInt()
|
||||||
|
|||||||
+3
-7
@@ -57,11 +57,9 @@ void CPOCSAGTX::process()
|
|||||||
|
|
||||||
if (m_poLen == 0U) {
|
if (m_poLen == 0U) {
|
||||||
if (!m_tx) {
|
if (!m_tx) {
|
||||||
DEBUG1("MMDVM, sending preamble");
|
|
||||||
for (uint16_t i = 0U; i < m_txDelay; i++)
|
for (uint16_t i = 0U; i < m_txDelay; i++)
|
||||||
m_poBuffer[m_poLen++] = POCSAG_SYNC;
|
m_poBuffer[m_poLen++] = POCSAG_SYNC;
|
||||||
} else {
|
} else {
|
||||||
DEBUG2("MMDVM, sending", m_buffer.get());
|
|
||||||
for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) {
|
for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++) {
|
||||||
uint8_t c = m_buffer.get();
|
uint8_t c = m_buffer.get();
|
||||||
m_poBuffer[m_poLen++] = c;
|
m_poBuffer[m_poLen++] = c;
|
||||||
@@ -91,16 +89,14 @@ void CPOCSAGTX::process()
|
|||||||
|
|
||||||
uint8_t CPOCSAGTX::writeData(const uint8_t* data, uint8_t length)
|
uint8_t CPOCSAGTX::writeData(const uint8_t* data, uint8_t length)
|
||||||
{
|
{
|
||||||
if (length != (POCSAG_FRAME_LENGTH_BYTES + 1U))
|
if (length != POCSAG_FRAME_LENGTH_BYTES)
|
||||||
return 4U;
|
return 4U;
|
||||||
|
|
||||||
uint16_t space = m_buffer.getSpace();
|
uint16_t space = m_buffer.getSpace();
|
||||||
if (space < (POCSAG_FRAME_LENGTH_BYTES + 1U))
|
if (space < POCSAG_FRAME_LENGTH_BYTES)
|
||||||
return 5U;
|
return 5U;
|
||||||
|
|
||||||
DEBUG2("MMDVM, queueing", data[0U]);
|
for (uint8_t i = 0U; i < POCSAG_FRAME_LENGTH_BYTES; i++)
|
||||||
|
|
||||||
for (uint8_t i = 0U; i < (POCSAG_FRAME_LENGTH_BYTES + 1U); i++)
|
|
||||||
m_buffer.put(data[i]);
|
m_buffer.put(data[i]);
|
||||||
|
|
||||||
return 0U;
|
return 0U;
|
||||||
|
|||||||
Reference in New Issue
Block a user