[FL-572][FL-577] Irda receive feature (#282)
* fix "state not acquired error" * add InterruptTypeComparatorTrigger to interrupt mgr, use interrupt mgr in irda app * separate init irda timer * capture events buffer by app * irda common decoder * irda nec decoder realization * finished work with decoder * fix app path * fix widget remove on exit * nec receive, store and send * init some packets
This commit is contained in:
39
applications/irda/irda-decoder/irda-decoder-nec.h
Normal file
39
applications/irda/irda-decoder/irda-decoder-nec.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "irda-decoder-types.h"
|
||||
|
||||
typedef enum {
|
||||
WAIT_PREAMBULA_HIGH,
|
||||
WAIT_PREAMBULA_LOW,
|
||||
WAIT_RETRY_HIGH,
|
||||
WAIT_BIT_HIGH,
|
||||
WAIT_BIT_LOW,
|
||||
WAIT_BIT_STOP_HIGH,
|
||||
} IrDANecDecoderState;
|
||||
|
||||
typedef struct {
|
||||
uint8_t addr2;
|
||||
uint8_t addr1;
|
||||
uint8_t cmd_inverse;
|
||||
uint8_t cmd;
|
||||
} IrDANecData;
|
||||
|
||||
typedef uint32_t IrDANecDataType;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
IrDANecData simple;
|
||||
IrDANecDataType data;
|
||||
} data;
|
||||
uint8_t current_data_index;
|
||||
IrDANecDecoderState state;
|
||||
} IrDANecDecoder;
|
||||
|
||||
bool process_decoder_nec(
|
||||
IrDANecDecoder* decoder,
|
||||
bool polarity,
|
||||
uint32_t time,
|
||||
IrDADecoderOutputData* out);
|
||||
|
||||
void reset_decoder_nec(IrDANecDecoder* decoder);
|
Reference in New Issue
Block a user