2022-01-05 19:10:18 +03:00
|
|
|
#include <furi_hal_ibutton.h>
|
|
|
|
#include <furi_hal_resources.h>
|
2021-09-10 12:19:02 +10:00
|
|
|
|
|
|
|
void furi_hal_ibutton_start() {
|
|
|
|
furi_hal_ibutton_pin_high();
|
2021-09-21 12:34:16 +03:00
|
|
|
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
|
2021-09-10 12:19:02 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
void furi_hal_ibutton_stop() {
|
|
|
|
furi_hal_ibutton_pin_high();
|
2021-09-21 12:34:16 +03:00
|
|
|
hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
2021-09-10 12:19:02 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
void furi_hal_ibutton_pin_low() {
|
|
|
|
hal_gpio_write(&ibutton_gpio, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
void furi_hal_ibutton_pin_high() {
|
|
|
|
hal_gpio_write(&ibutton_gpio, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool furi_hal_ibutton_pin_get_level() {
|
|
|
|
return hal_gpio_read(&ibutton_gpio);
|
|
|
|
}
|