Loading...
Searching...
No Matches
one_wire_slave.h
Go to the documentation of this file.
1
7#pragma once
8#include <stddef.h>
9#include <stdint.h>
10#include <stdbool.h>
11
12#include <furi_hal_gpio.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18typedef struct OneWireDevice OneWireDevice;
19typedef struct OneWireSlave OneWireSlave;
20
21typedef bool (*OneWireSlaveResetCallback)(bool is_short, void* context);
22typedef bool (*OneWireSlaveCommandCallback)(uint8_t command, void* context);
23typedef void (*OneWireSlaveResultCallback)(void* context);
24
31
37
43
49
56
63bool onewire_slave_send_bit(OneWireSlave* bus, bool value);
64
72bool onewire_slave_send(OneWireSlave* bus, const uint8_t* data, size_t data_size);
73
81bool onewire_slave_receive(OneWireSlave* bus, uint8_t* data, size_t data_size);
82
88void onewire_slave_set_overdrive(OneWireSlave* bus, bool set);
89
102 OneWireSlave* bus,
103 OneWireSlaveResetCallback callback,
104 void* context);
105
116 OneWireSlave* bus,
117 OneWireSlaveCommandCallback callback,
118 void* context);
119
127 OneWireSlave* bus,
128 OneWireSlaveResultCallback result_cb,
129 void* context);
130
131#ifdef __cplusplus
132}
133#endif
void onewire_slave_set_reset_callback(OneWireSlave *bus, OneWireSlaveResetCallback callback, void *context)
Set a callback function to be called on each reset.
Definition one_wire_slave.c:245
void onewire_slave_start(OneWireSlave *bus)
Start working with the bus.
Definition one_wire_slave.c:229
void onewire_slave_set_result_callback(OneWireSlave *bus, OneWireSlaveResultCallback result_cb, void *context)
Set a callback to report emulation success.
Definition one_wire_slave.c:264
OneWireSlave * onewire_slave_alloc(const GpioPin *gpio_pin)
Allocate OneWireSlave instance.
Definition one_wire_slave.c:211
void onewire_slave_stop(OneWireSlave *bus)
Stop working with the bus.
Definition one_wire_slave.c:237
void onewire_slave_free(OneWireSlave *bus)
Destroy OneWireSlave instance, free resources.
Definition one_wire_slave.c:222
void onewire_slave_set_overdrive(OneWireSlave *bus, bool set)
Enable overdrive mode.
Definition one_wire_slave.c:372
void onewire_slave_set_command_callback(OneWireSlave *bus, OneWireSlaveCommandCallback callback, void *context)
Set a callback function to be called on each command.
Definition one_wire_slave.c:254
bool onewire_slave_send(OneWireSlave *bus, const uint8_t *data, size_t data_size)
Send one or more bytes of data.
Definition one_wire_slave.c:326
bool onewire_slave_receive_bit(OneWireSlave *bus)
Receive one bit.
Definition one_wire_slave.c:273
bool onewire_slave_receive(OneWireSlave *bus, uint8_t *data, size_t data_size)
Receive one or more bytes of data.
Definition one_wire_slave.c:347
bool onewire_slave_send_bit(OneWireSlave *bus, bool value)
Send one bit.
Definition one_wire_slave.c:293
Gpio structure.
Definition furi_hal_gpio.h:161
Definition one_wire_slave.c:31