2020-11-25 10:25:13 +03:00
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "maxim_crc.h"
|
2021-01-28 15:30:31 +03:00
|
|
|
#include "one_wire_slave.h"
|
2020-11-25 10:25:13 +03: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 15:30:31 +03:00
|
|
|
~OneWireDevice();
|
2020-11-25 10:25:13 +03:00
|
|
|
|
|
|
|
uint8_t id_storage[8];
|
|
|
|
|
2021-01-28 15:30:31 +03:00
|
|
|
void send_id() const;
|
2020-11-25 10:25:13 +03:00
|
|
|
|
2021-01-28 15:30:31 +03:00
|
|
|
OneWireSlave* bus = nullptr;
|
|
|
|
void attach(OneWireSlave* _bus);
|
|
|
|
void deattach(void);
|
2020-11-25 10:25:13 +03:00
|
|
|
};
|