6 changed files with 100 additions and 17 deletions
@ -0,0 +1,29 @@ |
|||
// Expose structure for stack-based (static) allocation.
|
|||
|
|||
#ifndef DS18B20_STATIC_H |
|||
#define DS18B20_STATIC_H |
|||
|
|||
#include <stdbool.h> |
|||
#include <stdint.h> |
|||
|
|||
#include "ds18b20.h" |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
struct _DS18B20_Info |
|||
{ |
|||
bool init; |
|||
bool use_crc; |
|||
OneWireBus * bus; |
|||
uint64_t rom_code; |
|||
}; |
|||
|
|||
typedef struct _DS18B20_Info DS18B20_Info_Static; |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif // DS18B20_STATIC_H
|
|||
@ -0,0 +1,28 @@ |
|||
// Expose structure for stack-based (static) allocation.
|
|||
|
|||
#ifndef ONE_WIRE_BUS_STATIC_H |
|||
#define ONE_WIRE_BUS_STATIC_H |
|||
|
|||
#include <stdbool.h> |
|||
|
|||
#include "owb.h" |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
struct _OneWireBus |
|||
{ |
|||
bool init; |
|||
int gpio; |
|||
const struct _OneWireBus_Timing * timing; |
|||
bool use_crc; |
|||
}; |
|||
|
|||
typedef struct _OneWireBus OneWireBus_Static; |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif // ONE_WIRE_BUS_STATIC_H
|
|||
Loading…
Reference in new issue