unleashed-firmware/lib/ibutton/protocols/dallas/protocol_dallas_base.h
Georgii Surkov 8b224ecb15
[FL-3179] 1-Wire Overdrive Mode ()
* Separate ibutton to its own module, add one_wire to f18
* Move onewire cli to a separate app
* Add definitions for normal and overdrive timings
* Update api definitions
* Add rough overdrive timings definition for onewire emulation
* Remove one_wire_host_timing.h
* Add rough overdrive timings for onewire host
* Improve overdrive mode
* Working overdrive mode from flipper to flipper
* Update thermometer example app
* Turn on otg power when running thermometer example app
* Implement reset overdrive switching
* Always exit out of overdrive mode
* Improve overdrive timings
* Fix typos
* Fix reset behaviour
* Use overdrive mode everywhere in DS1996
* Improve comments
* Bump API version

Co-authored-by: あく <alleteam@gmail.com>
2023-03-22 23:54:06 +09:00

39 lines
1.6 KiB
C

#pragma once
#include "../protocol_common_i.h"
#include <one_wire/one_wire_host.h>
#include <one_wire/one_wire_slave.h>
#include <flipper_format/flipper_format.h>
typedef bool (*iButtonProtocolDallasReadWriteFunc)(OneWireHost*, iButtonProtocolData*);
typedef void (*iButtonProtocolDallasEmulateFunc)(OneWireSlave*, iButtonProtocolData*);
typedef bool (*iButtonProtocolDallasSaveFunc)(FlipperFormat*, const iButtonProtocolData*);
typedef bool (*iButtonProtocolDallasLoadFunc)(FlipperFormat*, uint32_t, iButtonProtocolData*);
typedef void (*iButtonProtocolDallasRenderDataFunc)(FuriString*, const iButtonProtocolData*);
typedef bool (*iButtonProtocolDallasIsValidFunc)(const iButtonProtocolData*);
typedef void (
*iButtonProtocolDallasGetEditableDataFunc)(iButtonEditableData*, iButtonProtocolData*);
typedef void (*iButtonProtocolDallasApplyEditsFunc)(iButtonProtocolData*);
typedef struct {
const uint8_t family_code;
const uint32_t features;
const size_t data_size;
const char* manufacturer;
const char* name;
iButtonProtocolDallasReadWriteFunc read;
iButtonProtocolDallasReadWriteFunc write_blank;
iButtonProtocolDallasReadWriteFunc write_copy;
iButtonProtocolDallasEmulateFunc emulate;
iButtonProtocolDallasSaveFunc save;
iButtonProtocolDallasLoadFunc load;
iButtonProtocolDallasRenderDataFunc render_data;
iButtonProtocolDallasRenderDataFunc render_brief_data;
iButtonProtocolDallasRenderDataFunc render_error;
iButtonProtocolDallasIsValidFunc is_valid;
iButtonProtocolDallasGetEditableDataFunc get_editable_data;
iButtonProtocolDallasApplyEditsFunc apply_edits;
} iButtonProtocolDallasBase;