[FL-1058] Low frequency RFID app [Indala 40134 Encoder] (#447)

* App Lfrfid: Rename encoder to match extact protocol.
* Api-hal-gpio: fix alt fn config
* Api-hal-gpio: fixed fix
* App Lfrfid: indala 40134 timer stage
This commit is contained in:
SG
2021-05-06 18:45:52 +10:00
committed by GitHub
parent c880f90eb5
commit ffd4948ae2
10 changed files with 64 additions and 97 deletions

View File

@@ -33,6 +33,14 @@
static volatile GpioInterrupt gpio_interrupt[GPIO_NUMBER];
static uint8_t hal_gpio_get_pin_num(const GpioPin* gpio) {
uint8_t pin_num = 0;
for(pin_num = 0; pin_num < GPIO_NUMBER; pin_num++) {
if(gpio->pin & (1 << pin_num)) break;
}
return pin_num;
}
void hal_gpio_init(
const GpioPin* gpio,
const GpioMode mode,
@@ -120,7 +128,7 @@ void hal_gpio_init_alt(
LL_GPIO_SetPinMode(gpio->port, gpio->pin, LL_GPIO_MODE_ALTERNATE);
// set alternate function
if(gpio->pin < 8) {
if(hal_gpio_get_pin_num(gpio) < 8) {
LL_GPIO_SetAFPin_0_7(gpio->port, gpio->pin, alt_fn);
} else {
LL_GPIO_SetAFPin_8_15(gpio->port, gpio->pin, alt_fn);
@@ -128,14 +136,6 @@ void hal_gpio_init_alt(
__enable_irq();
}
static uint8_t hal_gpio_get_pin_num(const GpioPin* gpio) {
uint8_t pin_num = 0;
for(pin_num = 0; pin_num < GPIO_NUMBER; pin_num++) {
if(gpio->pin & (1 << pin_num)) break;
}
return pin_num;
}
void hal_gpio_add_int_callback(const GpioPin* gpio, GpioExtiCallback cb, void* ctx) {
furi_assert(gpio);
furi_assert(cb);