2021-05-04 13:21:16 +00:00
|
|
|
#pragma once
|
2022-01-05 16:10:18 +00:00
|
|
|
#include "encoder_generic.h"
|
|
|
|
#include "osc_fsk.h"
|
2021-05-04 13:21:16 +00:00
|
|
|
|
2021-05-06 08:45:52 +00:00
|
|
|
class EncoderHID_H10301 : public EncoderGeneric {
|
2021-05-04 13:21:16 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @brief init data to emulate
|
|
|
|
*
|
|
|
|
* @param data 1 byte FC, next 2 byte SN
|
|
|
|
* @param data_size must be 3
|
|
|
|
*/
|
|
|
|
void init(const uint8_t* data, const uint8_t data_size) final;
|
|
|
|
void get_next(bool* polarity, uint16_t* period, uint16_t* pulse) final;
|
2021-07-30 11:12:36 +00:00
|
|
|
EncoderHID_H10301();
|
|
|
|
~EncoderHID_H10301();
|
2021-05-04 13:21:16 +00:00
|
|
|
|
|
|
|
private:
|
2021-05-05 07:50:19 +00:00
|
|
|
static const uint8_t card_data_max = 3;
|
|
|
|
uint32_t card_data[card_data_max];
|
2021-05-04 13:21:16 +00:00
|
|
|
uint8_t card_data_index;
|
2021-05-05 07:50:19 +00:00
|
|
|
void write_bit(bool bit, uint8_t position);
|
|
|
|
void write_raw_bit(bool bit, uint8_t position);
|
2021-07-30 11:12:36 +00:00
|
|
|
|
|
|
|
OscFSK* fsk;
|
2021-05-04 13:21:16 +00:00
|
|
|
};
|