Rev 1820 | Rev 1830 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1820 | Rev 1823 | ||
|---|---|---|---|
| Line 64... | Line 64... | ||
| 64 | int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
64 | int8_t parsePanasonic(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 65 | #endif |
65 | #endif |
| 66 | #if (IR_PROTOCOLS_USE_SKY) |
66 | #if (IR_PROTOCOLS_USE_SKY) |
| 67 | int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
67 | int8_t parseSky(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 68 | #endif |
68 | #endif |
| 69 | - | ||
| 70 | #if (IR_PROTOCOLS_USE_NEXA2) |
69 | #if (IR_PROTOCOLS_USE_NEXA2) |
| 71 | int8_t parseNexa2(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
70 | int8_t parseNexa2(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 72 | #endif |
71 | #endif |
| 73 | 72 | ||
| 74 | /* Try to parse all above protocols until a match is found. */ |
73 | /* Try to parse all above protocols until a match is found. */ |
| Line 76... | Line 75... | ||
| 76 | /* The Hash protocol always succeeds and creates a one-way signature of the |
75 | /* The Hash protocol always succeeds and creates a one-way signature of the |
| 77 | * pulse times buffer that is supposed to be unique and constant for a specific |
76 | * pulse times buffer that is supposed to be unique and constant for a specific |
| 78 | * IR event. It may be used to send a valid event even if the protocol hasn't |
77 | * IR event. It may be used to send a valid event even if the protocol hasn't |
| 79 | * been implemented or decoded yet. */ |
78 | * been implemented or decoded yet. */ |
| 80 | int8_t parseHash(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
79 | int8_t parseHash(const uint16_t *buf, uint8_t len, Ir_Protocol_Data_t *proto); |
| 81 | 80 | ||
| 82 | /* These functions expand a Ir_Protocol_Data_t structure into a raw buffer with |
81 | /* These functions expand a Ir_Protocol_Data_t structure into a raw buffer with |
| 83 | * pulse lengths. They return IR_OK on success and IR_NOT_CORRECT_DATA if the |
82 | * pulse lengths. They return IR_OK on success and IR_NOT_CORRECT_DATA if the |
| 84 | * Ir_Protocol_Data_t structure is for another protocol or contains invalid |
83 | * Ir_Protocol_Data_t structure is for another protocol or contains invalid |
| 85 | * data. */ |
84 | * data. */ |
| 86 | int8_t expandSIRC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
85 | int8_t expandSIRC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| Line 89... | Line 88... | ||
| 89 | int8_t expandNEC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
88 | int8_t expandNEC(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 90 | int8_t expandSamsung(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
89 | int8_t expandSamsung(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 91 | int8_t expandMarantz(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
90 | int8_t expandMarantz(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 92 | int8_t expandPanasonic(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
91 | int8_t expandPanasonic(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 93 | int8_t expandSky(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
92 | int8_t expandSky(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| - | 93 | //int8_t expandNexa2(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
|
| 94 | /* Pass the Ir_Protocol_Data_t automatically to the correct function. */ |
94 | /* Pass the Ir_Protocol_Data_t automatically to the correct function. */ |
| 95 | int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
95 | int8_t expandProtocol(uint16_t *buf, uint8_t *len, Ir_Protocol_Data_t *proto); |
| 96 | 96 | ||
| 97 | 97 | ||
| 98 | #define IR_OK 1 |
98 | #define IR_OK 1 |
| Line 108... | Line 108... | ||
| 108 | 108 | ||
| 109 | // defined for the module, uses same definitions for pressed and released as other buttons |
109 | // defined for the module, uses same definitions for pressed and released as other buttons |
| 110 | #define IR_BUTTON_RELEASED 0x0 |
110 | #define IR_BUTTON_RELEASED 0x0 |
| 111 | #define IR_BUTTON_PRESSED 0x1 |
111 | #define IR_BUTTON_PRESSED 0x1 |
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | #define CYCLES_PER_US (F_CPU/1000000) |
114 | #define CYCLES_PER_US (F_CPU/1000000) |
| 115 | #define TIMER_PRESC 8 |
115 | #define TIMER_PRESC 8 |
| 116 | 116 | ||
| 117 | #define IR_MIN_PULSE_WIDTH 5 //us |
117 | #define IR_MIN_PULSE_WIDTH 5 //us |
| - | 118 | #ifndef IR_MAX_PULSE_WIDTH |
|
| 118 | #define IR_MAX_PULSE_WIDTH 12000 //us |
119 | #define IR_MAX_PULSE_WIDTH 12000 //us |
| - | 120 | #endif |
|
| 119 | 121 | ||
| 120 | /* RC5 Implementation |
122 | /* RC5 Implementation |
| 121 | * Receiver: DONE |
123 | * Receiver: DONE |
| 122 | * Transmitter: DONE |
124 | * Transmitter: DONE |
| 123 | */ |
125 | */ |