123
Fork of LG by
DeviceUserProtocolDecoder.h@177:672ef279c8e0, 2016-07-03 (annotated)
- Committer:
- Diletant
- Date:
- Sun Jul 03 13:40:48 2016 +0000
- Revision:
- 177:672ef279c8e0
- Parent:
- 167:bedc0a9d559a
Device&... update. Some Ask_Gld functionality. Not final!!!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Diletant | 161:efd949e8d536 | 1 | #ifndef __DEVICE_USER_PROTOCOL_DECODER_H__ |
Diletant | 161:efd949e8d536 | 2 | #define __DEVICE_USER_PROTOCOL_DECODER_H__ |
Diletant | 161:efd949e8d536 | 3 | |
Diletant | 161:efd949e8d536 | 4 | //Requests decoding state |
Diletant | 161:efd949e8d536 | 5 | typedef struct _DeviceUserProtocolDecoder { |
Diletant | 161:efd949e8d536 | 6 | uint8_t error; //Decode error encountered |
Diletant | 161:efd949e8d536 | 7 | uint8_t canceled; //Decode canceled flag: continue decoding when clear (new data arrived) |
Diletant | 161:efd949e8d536 | 8 | uint8_t count; //Decoded bytes count |
Diletant | 177:672ef279c8e0 | 9 | uint8_t last; //Last attempt decoded bytes count: do not send Decode8() debug message if (last > count) |
Diletant | 161:efd949e8d536 | 10 | uint8_t address; //Decoded request address |
Diletant | 161:efd949e8d536 | 11 | uint8_t version; //Decoded protocol version (currently only 0 version exist) |
Diletant | 161:efd949e8d536 | 12 | uint16_t code; //Decoded command code |
Diletant | 161:efd949e8d536 | 13 | uint16_t position;//Current decoder position in input buffer |
Diletant | 161:efd949e8d536 | 14 | uint16_t CRC; //Current/final CRC of decoded packet |
Diletant | 161:efd949e8d536 | 15 | uint32_t param0; //Function call parameter 0 |
Diletant | 161:efd949e8d536 | 16 | uint32_t param1; //Function call parameter 1 |
Diletant | 161:efd949e8d536 | 17 | uint32_t param2; //Function call parameter 2 |
Diletant | 161:efd949e8d536 | 18 | uint32_t param3; //Function call parameter 3 |
Diletant | 161:efd949e8d536 | 19 | } DeviceUserProtocolDecoder; |
Diletant | 161:efd949e8d536 | 20 | |
Diletant | 167:bedc0a9d559a | 21 | void InitUserProtocolDecoderDefaultSettings(void); |
Diletant | 167:bedc0a9d559a | 22 | void InitUserProtocolDecoderState(void); |
Diletant | 167:bedc0a9d559a | 23 | void DeviceStartUserProtocolDecoder(void); |
Diletant | 161:efd949e8d536 | 24 | |
Diletant | 161:efd949e8d536 | 25 | //Host communication main functions |
Diletant | 177:672ef279c8e0 | 26 | void userDecodeRequests(void); //Decode requests from receive buffer |
Diletant | 177:672ef279c8e0 | 27 | void userDecodePin(void); //Decode hardware pin request |
Diletant | 177:672ef279c8e0 | 28 | void userEncodeResponse(void); //Encode response to transmit buffer |
Diletant | 161:efd949e8d536 | 29 | |
Diletant | 161:efd949e8d536 | 30 | //Decoder elementary functions |
Diletant | 161:efd949e8d536 | 31 | uint8_t Decode8(void); |
Diletant | 161:efd949e8d536 | 32 | uint16_t Decode16(void); |
Diletant | 161:efd949e8d536 | 33 | uint32_t Decode32(void); |
Diletant | 161:efd949e8d536 | 34 | |
Diletant | 161:efd949e8d536 | 35 | //Decoder common functions |
Diletant | 161:efd949e8d536 | 36 | void DecodeStart(void); |
Diletant | 161:efd949e8d536 | 37 | void DecodeEnd(void); |
Diletant | 161:efd949e8d536 | 38 | void DecodeCancel(void); |
Diletant | 161:efd949e8d536 | 39 | void DecodeFail(void); |
Diletant | 161:efd949e8d536 | 40 | |
Diletant | 161:efd949e8d536 | 41 | void DecodeAddress(void); |
Diletant | 161:efd949e8d536 | 42 | void DecodeCode(void); |
Diletant | 161:efd949e8d536 | 43 | void DecodeExtentionCode(void); |
Diletant | 161:efd949e8d536 | 44 | void DecodeCRC(void); |
Diletant | 161:efd949e8d536 | 45 | |
Diletant | 161:efd949e8d536 | 46 | //Decoder factory functions |
Diletant | 161:efd949e8d536 | 47 | void DecodeFactory(void); |
Diletant | 161:efd949e8d536 | 48 | |
Diletant | 161:efd949e8d536 | 49 | //Decoder data output functions |
Diletant | 161:efd949e8d536 | 50 | void DecodeDeviceMode(void); |
Diletant | 161:efd949e8d536 | 51 | void DecodeDelta(void); |
Diletant | 161:efd949e8d536 | 52 | |
Diletant | 161:efd949e8d536 | 53 | //Decoder maintenance functions |
Diletant | 161:efd949e8d536 | 54 | void DecodeMaintenanceMode(void); |
Diletant | 161:efd949e8d536 | 55 | |
Diletant | 161:efd949e8d536 | 56 | void DecodeMBasic(void); |
Diletant | 161:efd949e8d536 | 57 | void DoMaintenanceClear(void); |
Diletant | 161:efd949e8d536 | 58 | void DoMaintenanceMirror(void); |
Diletant | 161:efd949e8d536 | 59 | void DoMaintenanceStart(void); |
Diletant | 161:efd949e8d536 | 60 | void DoMaintenanceStop(void); |
Diletant | 161:efd949e8d536 | 61 | |
Diletant | 161:efd949e8d536 | 62 | void DecodeBITMode(void); |
Diletant | 161:efd949e8d536 | 63 | void DecodeMStymul(void); |
Diletant | 161:efd949e8d536 | 64 | void DecodeMReset(void); |
Diletant | 177:672ef279c8e0 | 65 | void DecodeMCtlR(void); |
Diletant | 177:672ef279c8e0 | 66 | void DecodeMCtlM(void); |
Diletant | 161:efd949e8d536 | 67 | void DecodeMADCR(void); |
Diletant | 161:efd949e8d536 | 68 | void DecodeMTmpW(void); |
Diletant | 161:efd949e8d536 | 69 | void DecodeMTmpR(void); |
Diletant | 161:efd949e8d536 | 70 | void DecodeMe5rW(void); |
Diletant | 161:efd949e8d536 | 71 | void DecodeMCntR(void); |
Diletant | 161:efd949e8d536 | 72 | void DecodeMFlgR(void); |
Diletant | 161:efd949e8d536 | 73 | void DecodeMVibW(void); |
Diletant | 161:efd949e8d536 | 74 | void DecodeMGphW(void); |
Diletant | 161:efd949e8d536 | 75 | |
Diletant | 161:efd949e8d536 | 76 | void DecodeMRate(void); |
Diletant | 161:efd949e8d536 | 77 | void DecodeMRate2(void); |
Diletant | 161:efd949e8d536 | 78 | void DecodeMRate3(void); |
Diletant | 161:efd949e8d536 | 79 | |
Diletant | 161:efd949e8d536 | 80 | void DecodeMParamR(void); |
Diletant | 161:efd949e8d536 | 81 | void DecodeMParamW(void); |
Diletant | 161:efd949e8d536 | 82 | void DecodeMe5raW(void); |
Diletant | 161:efd949e8d536 | 83 | |
Diletant | 161:efd949e8d536 | 84 | #endif /* __DEVICE_USER_PROTOCOL_DECODER_H__ */ |