2020-11-25 07:25:13 +00:00
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "maxim_crc.h"
|
2021-01-28 12:30:31 +00:00
|
|
|
#include "one_wire_slave.h"
|
2020-11-25 07:25:13 +00:00
|
|
|
|
|
|
|
class OneWireDevice {
|
|
|
|
public:
|
|
|
|
OneWireDevice(
|
|
|
|
uint8_t id_1,
|
|
|
|
uint8_t id_2,
|
|
|
|
uint8_t id_3,
|
|
|
|
uint8_t id_4,
|
|
|
|
uint8_t id_5,
|
|
|
|
uint8_t id_6,
|
|
|
|
uint8_t id_7);
|
|
|
|
|
2021-01-28 12:30:31 +00:00
|
|
|
~OneWireDevice();
|
2020-11-25 07:25:13 +00:00
|
|
|
|
|
|
|
uint8_t id_storage[8];
|
|
|
|
|
2021-01-28 12:30:31 +00:00
|
|
|
void send_id() const;
|
2020-11-25 07:25:13 +00:00
|
|
|
|
2021-01-28 12:30:31 +00:00
|
|
|
OneWireSlave* bus = nullptr;
|
|
|
|
void attach(OneWireSlave* _bus);
|
|
|
|
void deattach(void);
|
2020-11-25 07:25:13 +00:00
|
|
|
};
|