0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-05-19 00:11:18 +03:00

Got some names :)

This commit is contained in:
OneOfEleven 2023-10-16 11:32:01 +01:00
parent f69a997ac1
commit fffdfa64e1
10 changed files with 40 additions and 43 deletions

View File

@ -203,9 +203,9 @@ void AIRCOPY_stop_fsk_tx(void)
g_fsk_tx_timeout_10ms = 0;
// disable the TX
BK4819_SetupPowerAmplifier(0, 0); //
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1, false); // ???
BK4819_set_GPIO_pin(BK4819_GPIO1_PIN29_RED, false); // LED off
BK4819_SetupPowerAmplifier(0, 0); //
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1_UNKNOWN, false); // ???
BK4819_set_GPIO_pin(BK4819_GPIO1_PIN29_RED, false); // LED off
BK4819_reset_fsk();

View File

@ -1325,7 +1325,7 @@ void APP_process(void)
BK4819_DisableVox();
BK4819_Sleep();
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2, false);
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, false);
// Authentic device checked removed
@ -1699,7 +1699,7 @@ void APP_time_slice_10ms(void)
RADIO_EnableCxCSS();
BK4819_SetupPowerAmplifier(0, 0);
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1, false); // ???
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1_UNKNOWN, false); // ???
BK4819_Enable_AfDac_DiscMode_TxDsp();
BK4819_set_GPIO_pin(BK4819_GPIO1_PIN29_RED, false); // LED off

View File

@ -434,8 +434,8 @@ static void ToggleTX(bool on) {
SetF(fMeasure);
}
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2, !on);
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1, on);
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, !on);
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1_UNKNOWN, on);
}
// Scan info

View File

@ -17,7 +17,7 @@
#ifndef BK4819_REGS_H
#define BK4819_REGS_H
enum BK4819_REGISTER_t {
enum bk4819_register_e {
BK4819_REG_00 = 0x00U,
BK4819_REG_02 = 0x02U,
BK4819_REG_06 = 0x06U,
@ -89,22 +89,20 @@ enum BK4819_REGISTER_t {
BK4819_REG_7B = 0x7BU,
BK4819_REG_7C = 0x7CU,
BK4819_REG_7D = 0x7DU,
BK4819_REG_7E = 0x7EU,
BK4819_REG_7E = 0x7EU
};
typedef enum bk4819_register_e bk4819_register_t;
typedef enum BK4819_REGISTER_t BK4819_REGISTER_t;
enum BK4819_GPIO_PIN_t {
BK4819_GPIO6_PIN2 = 0,
BK4819_GPIO5_PIN1 = 1,
BK4819_GPIO4_PIN32 = 2,
BK4819_GPIO3_PIN31 = 3,
BK4819_GPIO2_PIN30 = 4,
BK4819_GPIO1_PIN29_RED = 5,
BK4819_GPIO0_PIN28_GREEN = 6,
enum bk4819_gpio_pin_e {
BK4819_GPIO6_PIN2_UNKNOWN = 0, // please let us know if you know what this pin does
BK4819_GPIO5_PIN1_UNKNOWN = 1, // " "
BK4819_GPIO4_PIN32_UNUSED = 2,
BK4819_GPIO3_PIN31_UHF = 3,
BK4819_GPIO2_PIN30_VHF = 4,
BK4819_GPIO1_PIN29_RED = 5,
BK4819_GPIO0_PIN28_GREEN = 6
};
typedef enum BK4819_GPIO_PIN_t BK4819_GPIO_PIN_t;
typedef enum bk4819_gpio_pin_e bk4819_gpio_pin_t;
// REG 02
@ -350,4 +348,3 @@ enum {
};
#endif

View File

@ -138,7 +138,7 @@ static uint16_t BK4819_ReadU16(void)
return Value;
}
uint16_t BK4819_ReadRegister(BK4819_REGISTER_t Register)
uint16_t BK4819_ReadRegister(bk4819_register_t Register)
{
uint16_t Value;
@ -160,7 +160,7 @@ uint16_t BK4819_ReadRegister(BK4819_REGISTER_t Register)
return Value;
}
void BK4819_WriteRegister(BK4819_REGISTER_t Register, uint16_t Data)
void BK4819_WriteRegister(bk4819_register_t Register, uint16_t Data)
{
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_BK4819_SCN);
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_BK4819_SCL);
@ -345,7 +345,7 @@ void BK4819_SetAGC(uint8_t Value)
}
}
void BK4819_set_GPIO_pin(BK4819_GPIO_PIN_t Pin, bool bSet)
void BK4819_set_GPIO_pin(bk4819_gpio_pin_t Pin, bool bSet)
{
if (bSet)
gBK4819_GpioOutState |= (0x40u >> Pin);
@ -862,20 +862,20 @@ void BK4819_RX_TurnOn(void)
void BK4819_PickRXFilterPathBasedOnFrequency(uint32_t Frequency)
{
if (Frequency < 28000000)
{
BK4819_set_GPIO_pin(BK4819_GPIO2_PIN30, true);
BK4819_set_GPIO_pin(BK4819_GPIO3_PIN31, false);
{ // VHF
BK4819_set_GPIO_pin(BK4819_GPIO2_PIN30_VHF, true);
BK4819_set_GPIO_pin(BK4819_GPIO3_PIN31_UHF, false);
}
else
if (Frequency == 0xFFFFFFFF)
{
BK4819_set_GPIO_pin(BK4819_GPIO2_PIN30, false);
BK4819_set_GPIO_pin(BK4819_GPIO3_PIN31, false);
{ // OFF
BK4819_set_GPIO_pin(BK4819_GPIO2_PIN30_VHF, false);
BK4819_set_GPIO_pin(BK4819_GPIO3_PIN31_UHF, false);
}
else
{
BK4819_set_GPIO_pin(BK4819_GPIO2_PIN30, false);
BK4819_set_GPIO_pin(BK4819_GPIO3_PIN31, true);
{ // UHF
BK4819_set_GPIO_pin(BK4819_GPIO2_PIN30_VHF, false);
BK4819_set_GPIO_pin(BK4819_GPIO3_PIN31_UHF, true);
}
}
@ -1199,7 +1199,7 @@ void BK4819_Conditional_RX_TurnOn_and_GPIO6_Enable(void)
{
if (g_rx_idle_mode)
{
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2, true);
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, true);
BK4819_RX_TurnOn();
}
}

View File

@ -62,14 +62,14 @@ typedef enum BK4819_CSS_scan_result_e BK4819_CSS_scan_result_t;
extern bool g_rx_idle_mode;
void BK4819_Init(void);
uint16_t BK4819_ReadRegister(BK4819_REGISTER_t Register);
void BK4819_WriteRegister(BK4819_REGISTER_t Register, uint16_t Data);
uint16_t BK4819_ReadRegister(bk4819_register_t Register);
void BK4819_WriteRegister(bk4819_register_t Register, uint16_t Data);
void BK4819_WriteU8(uint8_t Data);
void BK4819_WriteU16(uint16_t Data);
void BK4819_SetAGC(uint8_t Value);
void BK4819_set_GPIO_pin(BK4819_GPIO_PIN_t Pin, bool bSet);
void BK4819_set_GPIO_pin(bk4819_gpio_pin_t Pin, bool bSet);
void BK4819_SetCDCSSCodeWord(uint32_t CodeWord);
void BK4819_SetCTCSSFrequency(uint32_t BaudRate);

Binary file not shown.

Binary file not shown.

View File

@ -163,7 +163,7 @@ void FUNCTION_Select(function_type_t Function)
BK4819_DisableVox();
BK4819_Sleep();
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2, false);
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, false);
g_update_status = true;

View File

@ -630,7 +630,7 @@ void RADIO_setup_registers(bool switch_to_function_0)
BK4819_set_GPIO_pin(BK4819_GPIO1_PIN29_RED, false); // LED off
BK4819_SetupPowerAmplifier(0, 0);
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1, false); // ???
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1_UNKNOWN, false); // ???
while (1)
{ // wait for the interrupt to clear ?
@ -662,7 +662,7 @@ void RADIO_setup_registers(bool switch_to_function_0)
BK4819_PickRXFilterPathBasedOnFrequency(Frequency);
// what does this in do ?
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2, true);
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, true);
// AF RX Gain and DAC
BK4819_WriteRegister(BK4819_REG_48, 0xB3A8); // 1011 00 111010 1000
@ -850,7 +850,7 @@ void RADIO_enableTX(const bool fsk_tx)
g_enable_speaker = false;
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2, false); // ???
BK4819_set_GPIO_pin(BK4819_GPIO6_PIN2_UNKNOWN, false); // ???
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
@ -876,7 +876,7 @@ void RADIO_enableTX(const bool fsk_tx)
BK4819_SetCompander((!fsk_tx && g_rx_vfo->am_mode == 0 && (g_rx_vfo->compander == 1 || g_rx_vfo->compander >= 3)) ? g_rx_vfo->compander : 0);
BK4819_PrepareTransmit();
BK4819_PickRXFilterPathBasedOnFrequency(g_current_vfo->p_tx->frequency);
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1, true); // ???
BK4819_set_GPIO_pin(BK4819_GPIO5_PIN1_UNKNOWN, true); // ???
if (g_screen_to_display != DISPLAY_AIRCOPY)
BK4819_SetupPowerAmplifier(g_current_vfo->txp_calculated_setting, g_current_vfo->p_tx->frequency);
else