Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Renamed remaining BK4819 GPIOs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dual Tachyon authored and Dual Tachyon committed Oct 17, 2023
1 parent 0908821 commit 41f1e84
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/aircopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
8 changes: 4 additions & 4 deletions driver/bk4819-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
14 changes: 7 additions & 7 deletions driver/bk4819.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 41f1e84

Please sign in to comment.