[FL-1912, FL-1939] Sub-GHz frequency analyzer and add new protocol (#746)

* ToolBox: add manchester-decoder and manchester-encoder
* SubGhz: add new FM config cc1101
* Subghz: add protocol Kia
* SubGhz: fix receiving the last packet Nero Radio
* SubGhz: app protocol CAME Twin (TW2EE/TW4EE)
* SubGhz: add protocol CAME Atomo (AT03EV/ AT04EV)
* F7: sync with F6
* SubGhz: add frequency analyzer
* SubGhz: remove space from file name 
* SubGhz: frequency analyzer add filter and fix view
* [FL-1939] GubGhz: Frequency analyzer redesign
* SubGhz: fix incorrect subghz api call sequence in frequency analyzer worker

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2021-10-10 18:35:10 +04:00
committed by GitHub
parent 5dbfe3d90a
commit 4418e73b26
37 changed files with 2082 additions and 316 deletions

View File

@@ -0,0 +1,34 @@
#include "manchester-decoder.h"
#include <stdint.h>
static const uint8_t transitions[] = {0b00000001, 0b10010001, 0b10011011, 0b11111011};
static const ManchesterState manchester_reset_state = ManchesterStateMid1;
bool manchester_advance(
ManchesterState state,
ManchesterEvent event,
ManchesterState* next_state,
bool* data) {
bool result = false;
ManchesterState new_state;
if(event == ManchesterEventReset) {
new_state = manchester_reset_state;
} else {
new_state = transitions[state] >> event & 0x3;
if(new_state == state) {
new_state = manchester_reset_state;
} else {
if(new_state == ManchesterStateMid0) {
*data = false;
result = true;
} else if(new_state == ManchesterStateMid1) {
*data = true;
result = true;
}
}
}
*next_state = new_state;
return result;
}