mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-24 05:23:06 +00:00
1f761d7fbb
* maxim crc function * one wire template device and ds1990 classes * 3 fields for addr * cyfral emulator lib * add cyfral read mode, refract rendering and events * add ADC1_IN14, add adc interrupt * cyfral read mode * rename and move api-hal includes folder * build onewire libs only if we build app * start in mode 0
26 lines
585 B
C++
26 lines
585 B
C++
#include "one_wire_device.h"
|
|
|
|
// TODO fix GPL compability
|
|
// currently we use rework of OneWireHub
|
|
|
|
OneWireDevice::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) {
|
|
id_storage[0] = id_1;
|
|
id_storage[1] = id_2;
|
|
id_storage[2] = id_3;
|
|
id_storage[3] = id_4;
|
|
id_storage[4] = id_5;
|
|
id_storage[5] = id_6;
|
|
id_storage[6] = id_7;
|
|
id_storage[7] = maxim_crc8(id_storage, 7);
|
|
}
|
|
|
|
void OneWireDevice::send_id(OneWireGpioSlave* owner) const {
|
|
owner->send(id_storage, 8);
|
|
}
|