[FL-1167] Rework GPIO and EXTI with LL lib (#424)

* api-hal-gpio: rework gpio on ll
* one_wire_slave: rework gpio initialization
* interrupts: add attribute weak to hal exti interrupts handlers
* api-hal-gpio: add exti interrupt handlers
* input: rework with api-hal-gpio interrupts
* one_wire_slave: rework with api-hal-gpio interrupts
* api-hal-gpio: fix incorrect exti line config
* api-hal-gpio: add doxygen documentation
* api-hal-gpio: add enable / disable interrupts
* api-hal-gpio: add get_rfid_level
* core: remove api-gpio
* applications: rework gpio with api-hal-gpio
* lib: rework gpio with api-hal-gpio
* rfal: disable exti interrupt when rfal is inactive
* rfal: add interrupt gpio reinitialization
* api-hal-gpio: hide setting speed and pull mode LL implementation
* stm32wbxx_it: remove unused EXTI handlers
* api-hal-gpio: guard set, enable, disable and remove interrupt
* Drop F4 target
* Accessor: update gpio api usage

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-04-29 11:51:48 +03:00
committed by GitHub
parent c3350990c2
commit b405a22cd1
147 changed files with 482 additions and 18140 deletions

View File

@@ -116,13 +116,13 @@ void KeyReader::start_comaparator(void) {
// pulldown lf-rfid pins to prevent interference
// TODO open record
GpioPin rfid_pull_pin = {.port = RFID_PULL_GPIO_Port, .pin = RFID_PULL_Pin};
gpio_init(&rfid_pull_pin, GpioModeOutputOpenDrain);
gpio_write(&rfid_pull_pin, false);
hal_gpio_init(&rfid_pull_pin, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&rfid_pull_pin, false);
// TODO open record
GpioPin rfid_out_pin = {.port = RFID_OUT_GPIO_Port, .pin = RFID_OUT_Pin};
gpio_init(&rfid_out_pin, GpioModeOutputOpenDrain);
gpio_write(&rfid_out_pin, false);
hal_gpio_init(&rfid_out_pin, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
hal_gpio_write(&rfid_out_pin, false);
comparator_callback_pointer =
cbc::obtain_connector(this, &KeyReader::comparator_trigger_callback);
@@ -140,9 +140,11 @@ void KeyReader::comparator_trigger_callback(void* hcomp, void* comp_ctx) {
KeyReader* _this = static_cast<KeyReader*>(comp_ctx);
if(hcomp == &hcomp1) {
_this->cyfral_decoder.process_front(get_rfid_in_level(), DWT->CYCCNT - last_dwt_value);
_this->cyfral_decoder.process_front(
hal_gpio_get_rfid_in_level(), DWT->CYCCNT - last_dwt_value);
_this->metakom_decoder.process_front(get_rfid_in_level(), DWT->CYCCNT - last_dwt_value);
_this->metakom_decoder.process_front(
hal_gpio_get_rfid_in_level(), DWT->CYCCNT - last_dwt_value);
last_dwt_value = DWT->CYCCNT;
}

View File

@@ -18,7 +18,7 @@ void PulseSequencer::start() {
init_timer(periods[period_index]);
pin_state = pin_start_state;
gpio_write(&ibutton_gpio, pin_state);
hal_gpio_write(&ibutton_gpio, pin_state);
pin_state = !pin_state;
period_index = 1;
@@ -57,7 +57,7 @@ void PulseSequencer::init_timer(uint32_t period) {
HAL_NVIC_SetPriority(TIM1_UP_TIM16_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(TIM1_UP_TIM16_IRQn);
gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain);
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
}
void PulseSequencer::deinit_timer() {
@@ -76,7 +76,7 @@ void PulseSequencer::timer_elapsed_callback(void* hw, void* context) {
_this->pin_state = !_this->pin_state;
}
gpio_write(&ibutton_gpio, _this->pin_state);
hal_gpio_write(&ibutton_gpio, _this->pin_state);
_this->period_index++;