mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-05-07 13:37:48 +00:00
Handle the M17 mode LED pins(-ish)
This commit is contained in:
parent
a62fd814ae
commit
0334b5a791
7 changed files with 142 additions and 40 deletions
37
IOSTM.cpp
37
IOSTM.cpp
|
|
@ -106,6 +106,14 @@ void CIO::initInt()
|
|||
GPIO_Init(PORT_NXDN, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_M17_LEDS)
|
||||
// M17 pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_M17, ENABLE);
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_M17;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_Init(PORT_M17, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||
// POCSAG pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_POCSAG, ENABLE);
|
||||
|
|
@ -157,6 +165,14 @@ void CIO::initInt()
|
|||
GPIO_Init(PORT_MNXDN, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_M17_LEDS)
|
||||
// M17 mode pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_MM17, ENABLE);
|
||||
GPIO_InitStruct.GPIO_Pin = PIN_MM17;
|
||||
GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
|
||||
GPIO_Init(PORT_MM17, &GPIO_InitStruct);
|
||||
#endif
|
||||
|
||||
#if !defined(USE_ALTERNATE_POCSAG_LEDS)
|
||||
// POCSAG mode pin
|
||||
RCC_AHB1PeriphClockCmd(RCC_Per_MPOCSAG, ENABLE);
|
||||
|
|
@ -441,6 +457,27 @@ void CIO::setNXDNInt(bool on)
|
|||
#endif
|
||||
}
|
||||
|
||||
void CIO::setM17Int(bool on)
|
||||
{
|
||||
#if defined(MODE_LEDS)
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
GPIO_WriteBit(PORT_DSTAR, PIN_DSTAR, on ? Bit_SET : Bit_RESET);
|
||||
GPIO_WriteBit(PORT_P25, PIN_P25, on ? Bit_SET : Bit_RESET);
|
||||
#else
|
||||
GPIO_WriteBit(PORT_M17, PIN_M17, on ? Bit_SET : Bit_RESET);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MODE_PINS) && defined(STM32F4_NUCLEO_MORPHO_HEADER) && (defined(STM32F4_NUCLEO) || defined(STM32F722_RPT_HAT))
|
||||
#if defined(USE_ALTERNATE_M17_LEDS)
|
||||
GPIO_WriteBit(PORT_MDSTAR, PIN_MDSTAR, on ? Bit_SET : Bit_RESET);
|
||||
GPIO_WriteBit(PORT_MP25, PIN_MP25, on ? Bit_SET : Bit_RESET);
|
||||
#else
|
||||
GPIO_WriteBit(PORT_MM17, PIN_MM17, on ? Bit_SET : Bit_RESET);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void CIO::setPOCSAGInt(bool on)
|
||||
{
|
||||
#if defined(MODE_LEDS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue