mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-14 07:16:04 +03:00
25 lines
600 B
C
25 lines
600 B
C
|
#include <furi-hal-ibutton.h>
|
||
|
#include <furi-hal-resources.h>
|
||
|
|
||
|
void furi_hal_ibutton_start() {
|
||
|
furi_hal_ibutton_pin_high();
|
||
|
hal_gpio_init(&ibutton_gpio, GpioModeOutputOpenDrain, GpioSpeedLow, GpioPullNo);
|
||
|
}
|
||
|
|
||
|
void furi_hal_ibutton_stop() {
|
||
|
furi_hal_ibutton_pin_high();
|
||
|
hal_gpio_init(&ibutton_gpio, GpioModeAnalog, GpioSpeedLow, GpioPullNo);
|
||
|
}
|
||
|
|
||
|
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);
|
||
|
}
|