1-Wire host (master) library More...
#include <stdint.h>
#include <stdbool.h>
#include <furi_hal_gpio.h>
Go to the source code of this file.
Typedefs | |
typedef struct OneWireHost | OneWireHost |
Enumerations | |
enum | OneWireHostSearchMode { OneWireHostSearchModeConditional = 0 , OneWireHostSearchModeNormal = 1 } |
Functions | |
OneWireHost * | onewire_host_alloc (const GpioPin *gpio_pin) |
Allocate OneWireHost instance. | |
void | onewire_host_free (OneWireHost *host) |
Destroy OneWireHost instance, free resources. | |
bool | onewire_host_reset (OneWireHost *host) |
Reset the 1-Wire bus. | |
bool | onewire_host_read_bit (OneWireHost *host) |
Read one bit. | |
uint8_t | onewire_host_read (OneWireHost *host) |
Read one byte. | |
void | onewire_host_read_bytes (OneWireHost *host, uint8_t *buffer, uint16_t count) |
Read one or more bytes. | |
void | onewire_host_write_bit (OneWireHost *host, bool value) |
Write one bit. | |
void | onewire_host_write (OneWireHost *host, uint8_t value) |
Write one byte. | |
void | onewire_host_write_bytes (OneWireHost *host, const uint8_t *buffer, uint16_t count) |
Write one or more bytes. | |
void | onewire_host_start (OneWireHost *host) |
Start working with the bus. | |
void | onewire_host_stop (OneWireHost *host) |
Stop working with the bus. | |
void | onewire_host_reset_search (OneWireHost *host) |
Reset previous search results. | |
void | onewire_host_target_search (OneWireHost *host, uint8_t family_code) |
Set the family code to search for. | |
bool | onewire_host_search (OneWireHost *host, uint8_t *new_addr, OneWireHostSearchMode mode) |
Search for devices on the 1-Wire bus. | |
void | onewire_host_set_overdrive (OneWireHost *host, bool set) |
Enable overdrive mode. | |
1-Wire host (master) library
OneWireHost * onewire_host_alloc | ( | const GpioPin * | gpio_pin | ) |
Allocate OneWireHost instance.
[in] | gpio_pin | connection pin |
void onewire_host_free | ( | OneWireHost * | host | ) |
Destroy OneWireHost instance, free resources.
[in] | host | pointer to OneWireHost instance |
uint8_t onewire_host_read | ( | OneWireHost * | host | ) |
Read one byte.
[in] | host | pointer to OneWireHost instance |
bool onewire_host_read_bit | ( | OneWireHost * | host | ) |
Read one bit.
[in] | host | pointer to OneWireHost instance |
void onewire_host_read_bytes | ( | OneWireHost * | host, |
uint8_t * | buffer, | ||
uint16_t | count ) |
Read one or more bytes.
[in] | host | pointer to OneWireHost instance |
[out] | buffer | received data buffer |
[in] | count | number of bytes to read |
bool onewire_host_reset | ( | OneWireHost * | host | ) |
Reset the 1-Wire bus.
[in] | host | pointer to OneWireHost instance |
void onewire_host_reset_search | ( | OneWireHost * | host | ) |
Reset previous search results.
[in] | host | pointer to OneWireHost instance |
bool onewire_host_search | ( | OneWireHost * | host, |
uint8_t * | new_addr, | ||
OneWireHostSearchMode | mode ) |
Search for devices on the 1-Wire bus.
[in] | host | pointer to OneWireHost instance |
[out] | new_addr | pointer to the buffer to contain the unique ROM of the found device |
[in] | mode | search mode |
void onewire_host_set_overdrive | ( | OneWireHost * | host, |
bool | set ) |
Enable overdrive mode.
[in] | host | pointer to OneWireHost instance |
[in] | set | true to turn overdrive on, false to turn it off |
void onewire_host_start | ( | OneWireHost * | host | ) |
Start working with the bus.
[in] | host | pointer to OneWireHost instance |
void onewire_host_stop | ( | OneWireHost * | host | ) |
Stop working with the bus.
[in] | host | pointer to OneWireHost instance |
void onewire_host_target_search | ( | OneWireHost * | host, |
uint8_t | family_code ) |
Set the family code to search for.
[in] | host | pointer to OneWireHost instance |
[in] | family_code | device family code |
void onewire_host_write | ( | OneWireHost * | host, |
uint8_t | value ) |
Write one byte.
[in] | host | pointer to OneWireHost instance |
value | byte value to write |
void onewire_host_write_bit | ( | OneWireHost * | host, |
bool | value ) |
Write one bit.
[in] | host | pointer to OneWireHost instance |
value | bit value to write |
void onewire_host_write_bytes | ( | OneWireHost * | host, |
const uint8_t * | buffer, | ||
uint16_t | count ) |
Write one or more bytes.
[in] | host | pointer to OneWireHost instance |
[in] | buffer | pointer to the data to write |
[in] | count | size of the data to write |