Go to the documentation of this file.
39 #define CMD_ON_OFF 0xff
41 #define CMD_VOL_UP 0xfd
42 #define CMD_VOL_DOWN 0xfc
43 #define CMD_PRESET_6 0xfb
44 #define CMD_SLEEP 0xfa
48 #define CMD_PLAY_PAUSE 0xf6
50 #define CMD_TUNE_UP 0xf4
51 #define CMD_TUNE_DOWN 0xf3
52 #define CMD_PRESET_1 0xf2
53 #define CMD_PRESET_2 0xf1
54 #define CMD_PRESET_3 0xf0
55 #define CMD_PRESET_4 0xef
56 #define CMD_PRESET_5 0xee
58 #define BOSEWAVE_BITS 8
59 #define BOSEWAVE_HDR_MARK 1061
60 #define BOSEWAVE_HDR_SPACE 1456
61 #define BOSEWAVE_BIT_MARK 534
62 #define BOSEWAVE_ONE_SPACE 468
63 #define BOSEWAVE_ZERO_SPACE 1447
64 #define BOSEWAVE_END_MARK 614
65 #define BOSEWAVE_RPT_SPACE 51200
78 for (
unsigned char mask = 0x80; mask; mask >>= 1) {
88 for (
unsigned char mask = 0x80; mask; mask >>= 1) {
107 unsigned char command = 0;
108 unsigned char complement = 0;
116 DBG_PRINT(
"\tInvalid data length found: ");
124 DBG_PRINT(
"\tInvalid Header Mark. Expecting ");
134 DBG_PRINT(
"\tInvalid Header Space. Expecting ");
143 for (
int ii = 7; ii >= 0; ii--) {
146 DBG_PRINT(
"\tInvalid command Mark. Expecting ");
156 command |= (0x01 << ii);
160 DBG_PRINT(
"\tInvalid command Space. Got ");
169 for (
int ii = 7; ii >= 0; ii--) {
172 DBG_PRINT(
"\tInvalid complement Mark. Expecting ");
184 complement |= (0x01 << ii);
186 DBG_PRINT(
"\tInvalid complement Space. Got ");
193 if (command != complement) {
194 DBG_PRINT(
"\tComplement is not correct. Command=0x");
212 results->
value = command;
#define BOSEWAVE_ONE_SPACE
Results returned from the decoder.
int bits
Number of bits in decoded value.
#define DBG_PRINTLN(...)
If DEBUG, print the arguments as a line, otherwise do nothing.
volatile unsigned int * rawbuf
Raw intervals in 50uS ticks.
#define BOSEWAVE_END_MARK
decode_type_t decode_type
UNKNOWN, NEC, SONY, RC5, ...
#define DBG_PRINT(...)
If DEBUG, print the arguments, otherwise do nothing.
#define BOSEWAVE_HDR_MARK
int MATCH_SPACE(int measured_ticks, int desired_us)
volatile irparams_t irparams
Allow all parts of the code access to the ISR data NB.
void sendBoseWave(unsigned char code)
unsigned int rawSignal[35]
#define BOSEWAVE_ZERO_SPACE
#define BOSEWAVE_BIT_MARK
#define BOSEWAVE_HDR_SPACE
Public API to the library.
unsigned long value
Decoded value [max 32-bits].
int MATCH_MARK(int measured_ticks, int desired_us)
unsigned int rawlen
Number of records in rawbuf.
unsigned int rawlen
counter of entries in rawbuf
void sendRaw(const unsigned int buf[], unsigned int len, unsigned int hz)