2021-08-08 18:03:25 +00:00
|
|
|
#include <furi-hal-ibutton.h>
|
|
|
|
#include <furi-hal-resources.h>
|
2021-05-18 09:23:14 +00:00
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_ibutton_start() {
|
|
|
|
furi_hal_ibutton_pin_high();
|
2021-09-21 09:34:16 +00:00
|
|
|
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioPullNo, GpioSpeedLow);
|
2021-05-18 09:23:14 +00:00
|
|
|
}
|
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_ibutton_stop() {
|
|
|
|
furi_hal_ibutton_pin_high();
|
2021-09-21 09:34:16 +00:00
|
|
|
hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioPullNo, GpioSpeedLow);
|
2021-05-18 09:23:14 +00:00
|
|
|
}
|
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_ibutton_pin_low() {
|
2021-05-18 09:23:14 +00:00
|
|
|
hal_gpio_write(&ibutton_gpio, false);
|
|
|
|
}
|
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
void furi_hal_ibutton_pin_high() {
|
2021-05-18 09:23:14 +00:00
|
|
|
hal_gpio_write(&ibutton_gpio, true);
|
|
|
|
}
|
|
|
|
|
2021-08-08 18:03:25 +00:00
|
|
|
bool furi_hal_ibutton_pin_get_level() {
|
2021-05-18 09:23:14 +00:00
|
|
|
return hal_gpio_read(&ibutton_gpio);
|
|
|
|
}
|