[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

@@ -8,7 +8,7 @@ int32_t application_uart_write(void* p) {
// TODO open record
GpioPin* led_record = &led;
gpio_init(led_record, GpioModeOutputOpenDrain);
hal_gpio_init(led_record, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
// create buffer
const char test_string[] = "test\n";
@@ -23,9 +23,9 @@ int32_t application_uart_write(void* p) {
counter++;
// flash at every send
gpio_write(led_record, false);
hal_gpio_write(led_record, false);
delay(50);
gpio_write(led_record, true);
hal_gpio_write(led_record, true);
// delay with overall perion of 1s
delay(950);

View File

@@ -40,14 +40,14 @@ int32_t application_vibro(void* p) {
Gui* gui = furi_record_open("gui");
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
gpio_init(gpio, GpioModeOutputPushPull);
gpio_write(gpio, false);
hal_gpio_init(gpio, GpioModeOutputPushPull, GpioPullNo, GpioSpeedLow);
hal_gpio_write(gpio, false);
VibroEvent event;
while(1) {
furi_check(osMessageQueueGet(event_queue, &event, NULL, osWaitForever) == osOK);
if(event.input.type == InputTypeShort && event.input.key == InputKeyBack) {
gpio_write(gpio, false);
hal_gpio_write(gpio, false);
api_hal_light_set(LightGreen, 0);
view_port_enabled_set(view_port, false);
gui_remove_view_port(gui, view_port);
@@ -58,10 +58,10 @@ int32_t application_vibro(void* p) {
}
if(event.input.key == InputKeyOk) {
if(event.input.type == InputTypePress) {
gpio_write(gpio, true);
hal_gpio_write(gpio, true);
api_hal_light_set(LightGreen, 255);
} else if(event.input.type == InputTypeRelease) {
gpio_write(gpio, false);
hal_gpio_write(gpio, false);
api_hal_light_set(LightGreen, 0);
}
}