mirror of
https://github.com/DualTachyon/uv-k5-firmware.git
synced 2025-02-17 17:50:43 +08:00
Added BK1080_SetFrequency.
This commit is contained in:
parent
ea3d795697
commit
511a2351dc
@ -36,7 +36,7 @@ static const uint16_t BK1080_RegisterTable[] = {
|
||||
|
||||
static bool gIsInitBK1080;
|
||||
|
||||
void BK1080_Init(uint16_t Channel, bool bDoScan)
|
||||
void BK1080_Init(uint16_t Frequency, bool bDoScan)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
@ -56,9 +56,9 @@ void BK1080_Init(uint16_t Channel, bool bDoScan)
|
||||
BK1080_WriteRegister(BK1080_REG_02_POWER_CONFIGURATION, 0x0201);
|
||||
}
|
||||
BK1080_WriteRegister(BK1080_REG_05_SYSTEM_CONFIGURATION2, 0x0A5F);
|
||||
BK1080_WriteRegister(BK1080_REG_03_CHANNEL, Channel - 760);
|
||||
BK1080_WriteRegister(BK1080_REG_03_CHANNEL, Frequency - 760);
|
||||
SYSTEM_DelayMs(10);
|
||||
BK1080_WriteRegister(BK1080_REG_03_CHANNEL, (Channel - 760) | 0x8000);
|
||||
BK1080_WriteRegister(BK1080_REG_03_CHANNEL, (Frequency - 760) | 0x8000);
|
||||
} else {
|
||||
BK1080_WriteRegister(BK1080_REG_02_POWER_CONFIGURATION, 0x0241);
|
||||
GPIO_SetBit(&GPIOB->DATA, GPIOB_PIN_BK1080);
|
||||
@ -83,3 +83,10 @@ void BK1080_Mute(bool Mute)
|
||||
}
|
||||
}
|
||||
|
||||
void BK1080_SetFrequency(uint16_t Frequency)
|
||||
{
|
||||
BK1080_WriteRegister(BK1080_REG_03_CHANNEL, Frequency - 760);
|
||||
SYSTEM_DelayMs(10);
|
||||
BK1080_WriteRegister(BK1080_REG_03_CHANNEL, (Frequency - 760) | 0x8000);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
void BK1080_Init(uint16_t Frequency, bool bDoScan);
|
||||
void BK1080_WriteRegister(BK1080_REGISTER_t Register, uint16_t Value);
|
||||
void BK1080_Mute(bool Mute);
|
||||
void BK1080_SetFrequency(uint16_t Frequency);
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user