Loading...
Searching...
No Matches
one_wire_host.h
Go to the documentation of this file.
1
7#pragma once
8#include <stdint.h>
9#include <stdbool.h>
10#include <furi_hal_gpio.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
20
21typedef struct OneWireHost OneWireHost;
22
28OneWireHost* onewire_host_alloc(const GpioPin* gpio_pin);
29
35
42
49
55uint8_t onewire_host_read(OneWireHost* host);
56
63void onewire_host_read_bytes(OneWireHost* host, uint8_t* buffer, uint16_t count);
64
70void onewire_host_write_bit(OneWireHost* host, bool value);
71
77void onewire_host_write(OneWireHost* host, uint8_t value);
78
85void onewire_host_write_bytes(OneWireHost* host, const uint8_t* buffer, uint16_t count);
86
92
98
104
110void onewire_host_target_search(OneWireHost* host, uint8_t family_code);
111
119bool onewire_host_search(OneWireHost* host, uint8_t* new_addr, OneWireHostSearchMode mode);
120
126void onewire_host_set_overdrive(OneWireHost* host, bool set);
127
128#ifdef __cplusplus
129}
130#endif
OneWireHost * onewire_host_alloc(const GpioPin *gpio_pin)
Allocate OneWireHost instance.
Definition one_wire_host.c:58
uint8_t onewire_host_read(OneWireHost *host)
Read one byte.
Definition one_wire_host.c:131
void onewire_host_reset_search(OneWireHost *host)
Reset previous search results.
Definition one_wire_host.c:211
void onewire_host_target_search(OneWireHost *host, uint8_t family_code)
Set the family code to search for.
Definition one_wire_host.c:223
OneWireHostSearchMode
Definition one_wire_host.h:16
@ OneWireHostSearchModeConditional
Search for alarmed device.
Definition one_wire_host.h:17
@ OneWireHostSearchModeNormal
Search for all devices.
Definition one_wire_host.h:18
void onewire_host_set_overdrive(OneWireHost *host, bool set)
Enable overdrive mode.
Definition one_wire_host.c:352
void onewire_host_write_bytes(OneWireHost *host, const uint8_t *buffer, uint16_t count)
Write one or more bytes.
Definition one_wire_host.c:188
void onewire_host_write_bit(OneWireHost *host, bool value)
Write one bit.
Definition one_wire_host.c:154
bool onewire_host_search(OneWireHost *host, uint8_t *new_addr, OneWireHostSearchMode mode)
Search for devices on the 1-Wire bus.
Definition one_wire_host.c:234
void onewire_host_write(OneWireHost *host, uint8_t value)
Write one byte.
Definition one_wire_host.c:178
void onewire_host_free(OneWireHost *host)
Destroy OneWireHost instance, free resources.
Definition one_wire_host.c:69
void onewire_host_stop(OneWireHost *host)
Stop working with the bus.
Definition one_wire_host.c:204
bool onewire_host_reset(OneWireHost *host)
Reset the 1-Wire bus.
Definition one_wire_host.c:76
void onewire_host_read_bytes(OneWireHost *host, uint8_t *buffer, uint16_t count)
Read one or more bytes.
Definition one_wire_host.c:145
bool onewire_host_read_bit(OneWireHost *host)
Read one bit.
Definition one_wire_host.c:109
void onewire_host_start(OneWireHost *host)
Start working with the bus.
Definition one_wire_host.c:197
Gpio structure.
Definition furi_hal_gpio.h:161
Definition one_wire_host.c:49