Testing OOK TX baseband module

This commit is contained in:
furrtek 2016-08-03 08:53:50 +02:00
parent 1b44b22419
commit 787f656500
10 changed files with 399 additions and 81 deletions

View file

@ -46,57 +46,92 @@ private:
uint16_t clk_per_symbol;
std::vector<std::string> bit_format;
uint8_t word_length;
std::string format;
bool sync_bit;
std::string word_def;
std::string word_format;
std::string sync;
uint32_t default_frequency;
uint8_t repeat_min;
};
// P = Prelude
// S = Sync
// 0~9 A~J = Address/data bits
const encoder_def_t encoder_defs[7] = {
// PT2260
const encoder_def_t encoder_defs[11] = {
// PT2260: Data bits can only be 0 or 1 !
{ 3, 1024, 128,
{ "10001000", "11101110", "10001110" },
12, "0123456789ABS",
true, 200000, 1 },
12, "0123456789ABS", "AAAAAAAAAADD",
"10000000000000000000000000000000",
200000, 1 },
// PT2262
{ 3, 32, 4,
{ "10001000", "11101110", "10001110" },
12, "0123456789ABS",
true, 30000, 4 },
12, "0123456789ABS", "AAAAAAAAADDD",
"10000000000000000000000000000000",
30000, 4 },
// HK526E
{ 2, 24, 8,
{ "110", "100" },
12, "0123456789AB",
false, 20000, 4 },
12, "0123456789AB", "AAAAAAAAAAAA",
"",
20000, 4 },
// HT12E
{ 2, 3, 1,
{ "011", "001" },
12, "PS0123456789AB",
true, 3000, 4 },
12, "S0123456789AB", "AAAAAAAADDDD",
"0000000000000000000000000000000000001",
3000, 4 },
// VD5026 13 bits ?
{ 4, 128, 8,
{ "1000000010000000", "1111111011111110", "1111111010000000", "1000000011111110" },
12, "S0123456789AB",
true, 100000, 4 },
12, "S0123456789AB", "AAAAAAAADDDD",
"000000000000000000000000000000000000000000000001", // ?
100000, 4 },
// UM3750
{ 2, 96, 32,
{ "011", "001" },
12, "S0123456789AB",
true, 100000, 4 },
12, "S0123456789AB", "AAAAAAAAAAAA",
"1",
100000, 4 },
// UM3758
{ 3, 96, 16,
{ "011011", "001001", "011001" },
18, "S0123456789ABCDEFGH",
true, 160000, 4 }
18, "S0123456789ABCDEFGH", "AAAAAAAAAADDDDDDDD",
"1",
160000, 4 },
// BA5104
{ 2, 3072, 768,
{ "1000", "1110" },
9, "S012345678", "DDAAAAAAA",
"",
455000, 4 },
// MC145026
{ 3, 16, 1,
{ "0111111101111111", "0100000001000000", "0111111101000000" },
9, "S012345678", "AAAAADDDD",
"000000000000000000",
455000, 2 },
// HT6xxx
{ 3, 198, 33,
{ "011011", "001001", "001011" },
18, "S0123456789ABCDEFGH", "AAAAAAAAAAAADDDDDD",
"0000000000000000000000000000000000001011001011001",
100000, 3 },
// TC9148
{ 2, 48, 12,
{ "1000", "1110", },
12, "0123456789AB", "DDDDDDDDDDDD",
"",
455000, 3 }
};
enum tx_modes {
@ -106,7 +141,7 @@ private:
};
uint8_t enc_type = 0;
const encoder_def_t * encoder_def = &encoder_defs[0];
const encoder_def_t * encoder_def;
tx_modes tx_mode = IDLE;
//bool abort_scan = false;
//uint8_t scan_count;
@ -114,7 +149,7 @@ private:
//unsigned int scan_index;
std::string debug_text = "0";
//rf::Frequency f;
//uint8_t repeat_index;
uint8_t repeat_index;
void on_bitfield();
void on_type_change(size_t index);
@ -145,6 +180,17 @@ private:
.foreground = Color::black(),
};
const Style style_address {
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::red(),
};
const Style style_data {
.font = font::fixed_8x16,
.background = Color::black(),
.foreground = Color::blue(),
};
std::array<NumberField, 18> bitfields;
Text text_enctype {
@ -153,15 +199,19 @@ private:
};
OptionsField options_enctype {
{ 2 * 8, 5 * 8 },
7,
8,
{
{ "PT2260 ", 0 },
{ "PT2262 ", 1 },
{ "HK526E ", 2 },
{ "HT12E ", 3 },
{ "VD5026 ", 4 },
{ "UM3750 ", 5 },
{ "UM3758 ", 6 }
{ "PT2260 ", 0 },
{ "PT2262 ", 1 },
{ "HK526E ", 2 },
{ "HT12E ", 3 },
{ "VD5026 ", 4 },
{ "UM3750 ", 5 },
{ "UM3758 ", 6 },
{ "BA5104 ", 7 },
{ "MC145026", 8 },
{ "HT6xxx ", 9 },
{ "TC9148 ", 10 }
}
};
@ -172,7 +222,7 @@ private:
NumberField numberfield_clk {
{ 21 * 8, 3 * 8 },
3,
{ 1, 300 },
{ 1, 500 },
1,
' '
};
@ -188,7 +238,7 @@ private:
NumberField numberfield_bitduration {
{ 20 * 8, 5 * 8 },
4,
{ 300, 9999 },
{ 50, 9999 },
1,
' '
};
@ -217,9 +267,11 @@ private:
{ 2 * 8, 8 * 8, 5 * 8, 16 },
"Word:"
};
Text text_format_a;
Text text_format_d;
Text text_waveform {
{ 1 * 8, 112, 9 * 8, 16 },
{ 1 * 8, 16 * 8, 9 * 8, 16 },
"Waveform:"
};