[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:
@@ -47,16 +47,16 @@ void CyfralEmulator::send_byte(uint8_t data) {
|
||||
|
||||
void CyfralEmulator::send_bit(bool bit) {
|
||||
if(!bit) {
|
||||
gpio_write(&ibutton_gpio, false);
|
||||
hal_gpio_write(&ibutton_gpio, false);
|
||||
delay_us(CyfralTiming::ZERO_LOW);
|
||||
gpio_write(&ibutton_gpio, true);
|
||||
hal_gpio_write(&ibutton_gpio, true);
|
||||
delay_us(CyfralTiming::ZERO_HIGH);
|
||||
gpio_write(&ibutton_gpio, false);
|
||||
hal_gpio_write(&ibutton_gpio, false);
|
||||
delay_us(CyfralTiming::ZERO_LOW);
|
||||
} else {
|
||||
gpio_write(&ibutton_gpio, true);
|
||||
hal_gpio_write(&ibutton_gpio, true);
|
||||
delay_us(CyfralTiming::ONE_HIGH);
|
||||
gpio_write(&ibutton_gpio, false);
|
||||
hal_gpio_write(&ibutton_gpio, false);
|
||||
delay_us(CyfralTiming::ONE_LOW);
|
||||
}
|
||||
}
|
||||
@@ -87,10 +87,10 @@ void CyfralEmulator::send(uint8_t* data, uint8_t count, uint8_t repeat) {
|
||||
}
|
||||
|
||||
void CyfralEmulator::start(void) {
|
||||
gpio_init(emulate_pin_record, GpioModeOutputOpenDrain);
|
||||
gpio_write(emulate_pin_record, false);
|
||||
hal_gpio_init(emulate_pin_record, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write(emulate_pin_record, false);
|
||||
}
|
||||
|
||||
void CyfralEmulator::stop(void) {
|
||||
gpio_init(emulate_pin_record, GpioModeAnalog);
|
||||
hal_gpio_init(emulate_pin_record, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
||||
}
|
@@ -231,13 +231,13 @@ void CyfralReaderComp::start(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((GpioPin*)&rfid_pull_pin, GpioModeOutputOpenDrain);
|
||||
gpio_write((GpioPin*)&rfid_pull_pin, false);
|
||||
hal_gpio_init((GpioPin*)&rfid_pull_pin, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write((GpioPin*)&rfid_pull_pin, false);
|
||||
|
||||
// TODO open record
|
||||
GpioPin rfid_out_pin = {.port = RFID_OUT_GPIO_Port, .pin = RFID_OUT_Pin};
|
||||
gpio_init((GpioPin*)&rfid_out_pin, GpioModeOutputOpenDrain);
|
||||
gpio_write((GpioPin*)&rfid_out_pin, false);
|
||||
hal_gpio_init((GpioPin*)&rfid_out_pin, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
|
||||
hal_gpio_write((GpioPin*)&rfid_out_pin, false);
|
||||
|
||||
// connect comparator callback
|
||||
void* comp_ctx = this;
|
||||
|
Reference in New Issue
Block a user