Switch sub-1GHz band (#349)
* switch band * extract subghz api to files
This commit is contained in:
19
firmware/targets/f5/api-hal/api-hal-subghz.c
Normal file
19
firmware/targets/f5/api-hal/api-hal-subghz.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "api-hal-subghz.h"
|
||||
#include <stm32wbxx_ll_gpio.h>
|
||||
#include "main.h"
|
||||
|
||||
void api_hal_rf_band_set(RfBand band) {
|
||||
if (band == RfBand1) {
|
||||
LL_GPIO_ResetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin);
|
||||
LL_GPIO_SetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin);
|
||||
} else if (band == RfBand2) {
|
||||
LL_GPIO_SetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin);
|
||||
LL_GPIO_ResetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin);
|
||||
} else if (band == RfBand3) {
|
||||
LL_GPIO_SetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin);
|
||||
LL_GPIO_SetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin);
|
||||
} else if (band == RfBandIsolation) {
|
||||
LL_GPIO_ResetOutputPin(PA_SW_0_GPIO_Port, PA_SW_0_Pin);
|
||||
LL_GPIO_ResetOutputPin(PA_SW_1_GPIO_Port, PA_SW_1_Pin);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user