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