[FL-3179] 1-Wire Overdrive Mode (#2522)
* 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>
This commit is contained in:
@@ -61,6 +61,14 @@ bool ds_generic_write_blank(OneWireHost* host, iButtonProtocolData* protocol_dat
|
||||
return tm2004_write(host, data->rom_data.bytes, sizeof(DallasCommonRomData));
|
||||
}
|
||||
|
||||
static bool ds_generic_reset_callback(bool is_short, void* context) {
|
||||
DallasGenericProtocolData* data = context;
|
||||
if(!is_short) {
|
||||
onewire_slave_set_overdrive(data->state.bus, is_short);
|
||||
}
|
||||
return !is_short;
|
||||
}
|
||||
|
||||
static bool ds_generic_command_callback(uint8_t command, void* context) {
|
||||
furi_assert(context);
|
||||
DallasGenericProtocolData* data = context;
|
||||
@@ -85,7 +93,7 @@ void ds_generic_emulate(OneWireSlave* bus, iButtonProtocolData* protocol_data) {
|
||||
DallasGenericProtocolData* data = protocol_data;
|
||||
data->state.bus = bus;
|
||||
|
||||
onewire_slave_set_reset_callback(bus, NULL, NULL);
|
||||
onewire_slave_set_reset_callback(bus, ds_generic_reset_callback, NULL);
|
||||
onewire_slave_set_command_callback(bus, ds_generic_command_callback, protocol_data);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user