1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #ifndef __TOSHIBA_IR__
- #define __TOSHIBA_IR__
- #include <stdbool.h>
- #include <stdint.h>
- void Toshiba_ir_ResetDecoder ();
- int64_t nextPulseToshiba_ir(uint32_t width);
- #define kToshibaACStateLengthLong 10
- union ToshibaProtocol{
- uint8_t raw[kToshibaACStateLengthLong]; ///< The state in code form.
- struct {
- // Byte[0] - 0xF2
- uint8_t :8;
- // Byte[1] - 0x0D (inverted previous byte's value)
- uint8_t :8;
- // Byte[2] - The expected payload length (in bytes) past the Byte[4].
- ///< Known lengths are:
- ///< 1 (56 bit message)
- ///< 3 (72 bit message)
- ///< 4 (80 bit message)
- uint8_t Length :8;
- // Byte[3] - The bit-inverted value of the "length" byte.
- uint8_t :8;
- // Byte[4]
- uint8_t :3;
- uint8_t LongMsg :1;
- uint8_t :1;
- uint8_t ShortMsg :1;
- uint8_t :2;
- // Byte[5]
- uint8_t Swing :3;
- uint8_t :1;
- uint8_t Temp :4;
- // Byte[6]
- uint8_t Mode :3;
- uint8_t :2;
- uint8_t Fan :3;
- // Byte[7]
- uint8_t :4;
- uint8_t Filter :1;
- uint8_t :3;
- // Byte[8]
- // (Checksum for 72 bit messages, Eco/Turbo for long 80 bit messages)
- uint8_t EcoTurbo :8;
- };
- };
- #endif
|