Naming and coding style convention, new linter tool. (#945)
* Makefile, Scripts: new linter * About: remove ID from IC * Firmware: remove double define for DIVC/DIVR * Scripts: check folder names too. Docker: replace syntax check with make lint. * Reformat Sources and Migrate to new file naming convention * Docker: symlink clang-format-12 to clang-format * Add coding style guide
This commit is contained in:
34
applications/ibutton/helpers/key_emulator.h
Normal file
34
applications/ibutton/helpers/key_emulator.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
#include "pulse_sequencer.h"
|
||||
#include "../ibutton_key.h"
|
||||
#include <one_wire_slave.h>
|
||||
#include <one_wire_device_ds_1990.h>
|
||||
#include <atomic>
|
||||
|
||||
class KeyEmulator {
|
||||
public:
|
||||
KeyEmulator(OneWireSlave* onewire_slave);
|
||||
~KeyEmulator();
|
||||
|
||||
void start(iButtonKey* key);
|
||||
bool emulated();
|
||||
void stop();
|
||||
|
||||
private:
|
||||
DS1990 dallas_key;
|
||||
OneWireSlave* onewire_slave;
|
||||
|
||||
PulseSequencer pulser;
|
||||
uint32_t pulse_data[72];
|
||||
|
||||
std::atomic<bool> anything_emulated;
|
||||
|
||||
void start_cyfral_emulate(iButtonKey* key);
|
||||
void start_metakom_emulate(iButtonKey* key);
|
||||
void start_dallas_emulate(iButtonKey* key);
|
||||
|
||||
void set_pulse_data_cyfral(uint8_t index, const uint32_t* data);
|
||||
void set_pulse_data_metakom(uint8_t index, const uint32_t* data);
|
||||
|
||||
void result_callback(bool success, void* ctx);
|
||||
};
|
Reference in New Issue
Block a user