2021-05-04 16:21:16 +03:00
|
|
|
#pragma once
|
2022-01-05 19:10:18 +03:00
|
|
|
#include "encoder_generic.h"
|
|
|
|
#include "osc_fsk.h"
|
2021-05-04 16:21:16 +03:00
|
|
|
|
2021-05-06 11:45:52 +03:00
|
|
|
class EncoderHID_H10301 : public EncoderGeneric {
|
2021-05-04 16:21:16 +03: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 14:12:36 +03:00
|
|
|
EncoderHID_H10301();
|
|
|
|
~EncoderHID_H10301();
|
2021-05-04 16:21:16 +03:00
|
|
|
|
|
|
|
private:
|
2021-05-05 10:50:19 +03:00
|
|
|
static const uint8_t card_data_max = 3;
|
|
|
|
uint32_t card_data[card_data_max];
|
2021-05-04 16:21:16 +03:00
|
|
|
uint8_t card_data_index;
|
2021-05-05 10:50:19 +03:00
|
|
|
void write_bit(bool bit, uint8_t position);
|
|
|
|
void write_raw_bit(bool bit, uint8_t position);
|
2021-07-30 14:12:36 +03:00
|
|
|
|
|
|
|
OscFSK* fsk;
|
2021-05-04 16:21:16 +03:00
|
|
|
};
|