2021-02-25 10:29:00 +00:00
|
|
|
#include "api-hal-subghz.h"
|
|
|
|
#include <stm32wbxx_ll_gpio.h>
|
|
|
|
#include "main.h"
|
|
|
|
|
|
|
|
void api_hal_rf_band_set(RfBand band) {
|
|
|
|
if (band == RfBand1) {
|
2021-03-01 18:44:46 +00:00
|
|
|
LL_GPIO_ResetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin);
|
|
|
|
LL_GPIO_SetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin);
|
2021-02-25 10:29:00 +00:00
|
|
|
} else if (band == RfBand2) {
|
2021-03-01 18:44:46 +00:00
|
|
|
LL_GPIO_SetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin);
|
|
|
|
LL_GPIO_ResetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin);
|
2021-02-25 10:29:00 +00:00
|
|
|
} else if (band == RfBand3) {
|
2021-03-01 18:44:46 +00:00
|
|
|
LL_GPIO_SetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin);
|
|
|
|
LL_GPIO_SetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin);
|
2021-02-25 10:29:00 +00:00
|
|
|
} else if (band == RfBandIsolation) {
|
2021-03-01 18:44:46 +00:00
|
|
|
LL_GPIO_ResetOutputPin(RF_SW_0_GPIO_Port, RF_SW_0_Pin);
|
|
|
|
LL_GPIO_ResetOutputPin(RF_SW_1_GPIO_Port, RF_SW_1_Pin);
|
2021-02-25 10:29:00 +00:00
|
|
|
}
|
|
|
|
}
|