stm32-async-1wire 3.2.0
Non-blocking 1-Wire master for STM32 with DS18B20 temperature and DS2431 EEPROM drivers
Loading...
Searching...
No Matches
ds2413.h
Go to the documentation of this file.
1
34
35#ifndef DS2413_H
36#define DS2413_H
37
38#include "ow_config.h"
39#include "ow_version.h"
40#include <stdint.h>
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
50
52#define DS2413_FAMILY_CODE 0x3Au
53
55#define DS2413_ROM_BYTES 8u
56
58#define DS2413_BITS_PER_BYTE 8u
59
61#define DS2413_PIOA 0x01u
62
64#define DS2413_PIOB 0x02u
65
67#define DS2413_PIO_MASK 0x03u
68
70#define DS2413_CMD_READ 0xF5u
71
73#define DS2413_CMD_WRITE 0x5Au
74
76#define DS2413_ACK 0xAAu
77
79#define DS2413_NO_RESPONSE 0xFFu
80
82
87
98void ds2413_init(void);
99
108void ds2413_select(const uint8_t* rom);
109
122uint8_t ds2413_read_pio(uint8_t* out);
123
129
142uint8_t ds2413_write_pio(uint8_t states);
143
149
157
163uint8_t ds2413_last_pio(void);
164
172
179uint8_t ds2413_last_reply(void);
180
182
183#ifdef __cplusplus
184}
185#endif
186
187#endif /* DS2413_H */
uint8_t ds2413_last_command_ok(void)
Result of the last completed operation.
uint8_t ds2413_write_pio_poll(void)
Advance the non-blocking PIO write.
uint8_t ds2413_read_pio_poll(void)
Advance the non-blocking PIO read.
void ds2413_init(void)
Initialize the DS2413 driver hardware.
uint8_t ds2413_last_latches(void)
Last valid PIO latch states read by ds2413_read_pio().
uint8_t ds2413_last_pio(void)
Last valid PIO pin levels read by ds2413_read_pio().
void ds2413_select(const uint8_t *rom)
Select the DS2413 to address.
uint8_t ds2413_write_pio(uint8_t states)
Write the PIO output latches (non-blocking).
uint8_t ds2413_read_pio(uint8_t *out)
Read the PIO pin levels (non-blocking).
uint8_t ds2413_last_reply(void)
Raw reply byte of the last read or write operation.
Central compile-time configuration for the 1-Wire stack.
Library version (semantic versioning).