diff --git a/app/aircopy.c b/app/aircopy.c index fbf71f9..deca40e 100644 --- a/app/aircopy.c +++ b/app/aircopy.c @@ -51,7 +51,7 @@ void AIRCOPY_SendMessage(void) RADIO_SetTxParameters(); BK4819_SendFSKData(g_FSK_Buffer); BK4819_SetupPowerAmplifier(0, 0); - BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29, false); + BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false); gAircopySendCountdown = 30; } diff --git a/app/app.c b/app/app.c index 28ff781..478f4fd 100644 --- a/app/app.c +++ b/app/app.c @@ -777,7 +777,7 @@ void APP_Update(void) gRxIdleMode = true; BK4819_DisableVox(); BK4819_Sleep(); - BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28, false); + BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, false); // Authentic device checked removed } else { DUALWATCH_Alternate(); @@ -930,7 +930,7 @@ void APP_TimeSlice10ms(void) gAlarmState = ALARM_STATE_ALARM; RADIO_EnableCxCSS(); BK4819_SetupPowerAmplifier(0, 0); - BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29, false); + BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false); BK4819_Enable_AfDac_DiscMode_TxDsp(); BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false); GUI_DisplayScreen(); diff --git a/driver/bk4819-regs.h b/driver/bk4819-regs.h index dde6c42..769ba8c 100644 --- a/driver/bk4819-regs.h +++ b/driver/bk4819-regs.h @@ -95,10 +95,10 @@ enum BK4819_REGISTER_t { typedef enum BK4819_REGISTER_t BK4819_REGISTER_t; enum BK4819_GPIO_PIN_t { - BK4819_GPIO0_PIN28 = 0, - BK4819_GPIO1_PIN29 = 1, - BK4819_GPIO3_PIN31 = 3, - BK4819_GPIO4_PIN32 = 4, + BK4819_GPIO0_PIN28_RX_ENABLE = 0, + BK4819_GPIO1_PIN29_PA_ENABLE = 1, + BK4819_GPIO3_PIN31_UHF_LNA = 3, + BK4819_GPIO4_PIN32_VHF_LNA = 4, BK4819_GPIO5_PIN1_RED = 5, BK4819_GPIO6_PIN2_GREEN = 6, }; diff --git a/driver/bk4819.c b/driver/bk4819.c index ac1c2fb..2812e4c 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -377,14 +377,14 @@ void BK4819_RX_TurnOn(void) void BK4819_SelectFilter(uint32_t Frequency) { if (Frequency < 28000000) { - BK4819_ToggleGpioOut(BK4819_GPIO4_PIN32, true); - BK4819_ToggleGpioOut(BK4819_GPIO3_PIN31, false); + BK4819_ToggleGpioOut(BK4819_GPIO4_PIN32_VHF_LNA, true); + BK4819_ToggleGpioOut(BK4819_GPIO3_PIN31_UHF_LNA, false); } else if (Frequency == 0xFFFFFFFF) { - BK4819_ToggleGpioOut(BK4819_GPIO4_PIN32, false); - BK4819_ToggleGpioOut(BK4819_GPIO3_PIN31, false); + BK4819_ToggleGpioOut(BK4819_GPIO4_PIN32_VHF_LNA, false); + BK4819_ToggleGpioOut(BK4819_GPIO3_PIN31_UHF_LNA, false); } else { - BK4819_ToggleGpioOut(BK4819_GPIO4_PIN32, false); - BK4819_ToggleGpioOut(BK4819_GPIO3_PIN31, true); + BK4819_ToggleGpioOut(BK4819_GPIO4_PIN32_VHF_LNA, false); + BK4819_ToggleGpioOut(BK4819_GPIO3_PIN31_UHF_LNA, true); } } @@ -545,7 +545,7 @@ void BK4819_ExitSubAu(void) void BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable(void) { if (gRxIdleMode) { - BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28, true); + BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, true); BK4819_RX_TurnOn(); } } diff --git a/functions.c b/functions.c index f1e6ad9..7787f41 100644 --- a/functions.c +++ b/functions.c @@ -117,7 +117,7 @@ void FUNCTION_Select(FUNCTION_Type_t Function) gRxIdleMode = true; BK4819_DisableVox(); BK4819_Sleep(); - BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28, false); + BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, false); gBatterySaveCountdownExpired = false; gUpdateStatus = true; GUI_SelectNextDisplay(DISPLAY_MAIN); diff --git a/radio.c b/radio.c index b37b5f3..4c98fff 100644 --- a/radio.c +++ b/radio.c @@ -495,7 +495,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0) BK4819_ToggleGpioOut(BK4819_GPIO5_PIN1_RED, false); BK4819_SetupPowerAmplifier(0, 0); - BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29, false); + BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, false); while (1) { Status = BK4819_ReadRegister(BK4819_REG_0C); @@ -522,7 +522,7 @@ void RADIO_SetupRegisters(bool bSwitchToFunction0) gRxVfo->SquelchOpenNoise, gRxVfo->SquelchCloseNoise, gRxVfo->SquelchCloseGlitch, gRxVfo->SquelchOpenGlitch); BK4819_SelectFilter(Frequency); - BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28, true); + BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, true); BK4819_WriteRegister(BK4819_REG_48, 0xB3A8); InterruptMask = 0 @@ -663,7 +663,7 @@ void RADIO_SetTxParameters(void) gEnableSpeaker = false; - BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28, false); + BK4819_ToggleGpioOut(BK4819_GPIO0_PIN28_RX_ENABLE, false); Bandwidth = gCurrentVfo->CHANNEL_BANDWIDTH; if (Bandwidth != BK4819_FILTER_BW_WIDE) { Bandwidth = BK4819_FILTER_BW_NARROW; @@ -674,7 +674,7 @@ void RADIO_SetTxParameters(void) SYSTEM_DelayMs(10); BK4819_SelectFilter(gCurrentVfo->pTX->Frequency); - BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29, true); + BK4819_ToggleGpioOut(BK4819_GPIO1_PIN29_PA_ENABLE, true); SYSTEM_DelayMs(5); BK4819_SetupPowerAmplifier(gCurrentVfo->TXP_CalculatedSetting, gCurrentVfo->pTX->Frequency);