-
Notifications
You must be signed in to change notification settings - Fork 2
/
onewire_platform.h
64 lines (46 loc) · 1.78 KB
/
onewire_platform.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// onewire_platform.h
#pragma once
#include "endpoints.h"
#include "priv/onewire.h"
#include "priv/ds248x.h"
#include "priv/ds1990x.h"
#include "priv/ds18x20.h"
#include "priv/esp_rmt.h"
#ifdef __cplusplus
extern "C" {
#endif
// ############################################# Macros ############################################
// ######################################## Enumerations ###########################################
// ######################################### Structures ############################################
/* Bus related info, ie last device read (ROM & timestamp)
* Used to avoid re-reading a device (primarily DS1990X type) too regularly.
*/
typedef struct __attribute__((packed)) owbi_t {
seconds_t LastRead; // size=4
ow_rom_t LastROM; // size=8
union __attribute__((packed)) {
struct { u8_t ds18b20:4, ds18s20:4; };
u8_t ds18any;
};
} owbi_t;
DUMB_STATIC_ASSERT(sizeof(owbi_t) == 13);
// #################################### Public Data structures #####################################
// ###################################### Public functions #########################################
owbi_t * psOWP_BusGetPointer(u8_t);
void OWP_BusL2P(owdi_t *, u8_t);
int OWP_BusP2L(owdi_t *);
int OWP_BusSelect(owdi_t *);
void OWP_BusRelease(owdi_t *);
// Common callback handlers
int OWP_PrintROM_CB(struct report_t * psR, ow_rom_t * psROM);
int OWP_Print1W_CB(struct report_t * psR, owdi_t * psOW);
int OWP_PrintChan_CB(struct report_t * psR, owbi_t * psCI);
int OWP_Count_CB(struct report_t * psR, owdi_t *);
int OWP_Scan(u8_t, int (*)(struct report_t *, owdi_t *));
int OWP_Scan2(u8_t, int (*)(struct report_t *, void *, owdi_t *), void *);
int OWP_ScanAlarmsFamily(u8_t Family);
int OWP_Config(void);
int OWP_Report(struct report_t * psR);
#ifdef __cplusplus
}
#endif