mirror of https://github.com/g4klx/MMDVM.git
Add an mode output pin on the STM32-F7M board as suggested by Tom BG4TGO.
This commit is contained in:
parent
a4af04fae2
commit
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()
|
||||||
|
|
30
IOSTM.cpp
30
IOSTM.cpp
|
@ -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()
|
||||||
|
@ -1139,6 +1164,11 @@ void CIO::setPOCSAGInt(bool on)
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,8 +222,12 @@ 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)
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue