[FL-1684] IRDA Add SIRC protocol (#693)
* IRDA HAL: Fill buffer refactoring * IRDA: Add SIRC protocol * IRDA: correct adr/cmd bit length * Disable Unit tests Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
38
lib/irda/encoder_decoder/sirc/irda_sirc_spec.c
Normal file
38
lib/irda/encoder_decoder/sirc/irda_sirc_spec.c
Normal file
@@ -0,0 +1,38 @@
|
||||
#include "../irda_i.h"
|
||||
#include "irda_protocol_defs_i.h"
|
||||
|
||||
static const IrdaProtocolSpecification irda_sirc_protocol_specification = {
|
||||
.name = "SIRC",
|
||||
.address_length = 5,
|
||||
.command_length = 7,
|
||||
.frequency = IRDA_SIRC_CARRIER_FREQUENCY,
|
||||
.duty_cycle = IRDA_SIRC_DUTY_CYCLE,
|
||||
};
|
||||
|
||||
static const IrdaProtocolSpecification irda_sirc15_protocol_specification = {
|
||||
.name = "SIRC15",
|
||||
.address_length = 8,
|
||||
.command_length = 7,
|
||||
.frequency = IRDA_SIRC_CARRIER_FREQUENCY,
|
||||
.duty_cycle = IRDA_SIRC_DUTY_CYCLE,
|
||||
};
|
||||
|
||||
static const IrdaProtocolSpecification irda_sirc20_protocol_specification = {
|
||||
.name = "SIRC20",
|
||||
.address_length = 13,
|
||||
.command_length = 7,
|
||||
.frequency = IRDA_SIRC_CARRIER_FREQUENCY,
|
||||
.duty_cycle = IRDA_SIRC_DUTY_CYCLE,
|
||||
};
|
||||
|
||||
const IrdaProtocolSpecification* irda_sirc_get_spec(IrdaProtocol protocol) {
|
||||
if (protocol == IrdaProtocolSIRC)
|
||||
return &irda_sirc_protocol_specification;
|
||||
else if (protocol == IrdaProtocolSIRC15)
|
||||
return &irda_sirc15_protocol_specification;
|
||||
else if (protocol == IrdaProtocolSIRC20)
|
||||
return &irda_sirc20_protocol_specification;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user