Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LG by
Diff: DeviceProtocol.h
- Revision:
- 73:29fccfe239a3
- Parent:
- 72:f5e189c62bcb
- Child:
- 74:f4d9c3403578
--- a/DeviceProtocol.h Tue Feb 23 14:23:37 2016 +0000
+++ b/DeviceProtocol.h Wed Feb 24 02:48:32 2016 +0000
@@ -4,19 +4,20 @@
#include "DeviceSettings.h"
#include "stdint.h"
+/*Move to DeviceCommunication.h*/
#define InputBufferSize 1024
typedef struct _DeviceInputBuffer {
uint8_t buffer[InputBufferSize];
int start; //read start position
int end; //write start position
} DeviceInputBuffer;
-
+/*Move to DeviceCommunication.h*/
#define OutputBufferSize 64
typedef struct _DeviceOutputBuffer {
uint8_t buffer[OutputBufferSize];
int count; //byte count
} DeviceOutputBuffer;
-
+/*Move to DeviceCommunication.h*/
typedef struct _DeviceCommunicationState {
DeviceInputBuffer requestBuffer;
DeviceOutputBuffer responseBuffer;
@@ -38,6 +39,7 @@
uint32_t responsePeriodClock; //Values in mks; response period clock - send response if clock > period;
} DeviceCommunicationState;
+/*Move to DeviceCounters.h*/
typedef struct _DeviceLatchState {
//Latch mode
DeviceLatchMode mode;
@@ -50,6 +52,7 @@
DeviceDeltaMode deltaMode;
} DeviceCountersState;
+/*Move to Device.h*/
typedef struct _DeviceState {
DeviceCommunicationState communication;
DeviceCountersState counters;
@@ -128,11 +131,13 @@
//Command: DeviceMode
//DeviceMessageCheckPoint DeviceModeRequestCheck[] = {{0x00,0xff,0xcc},{0x02,0xff,0xcc},{0x03,0xf0,0x00}};
//DeviceMessageCheckPoint DeviceModeResponseCheck[] = {{0x00,0xff,0xcc},{0x02,0xff,0x00}};
+/*Move to DeviceCommunication.h*/
typedef enum
{
RESPONSE_IMMEDIATE, //external latch by RS422 B_Delta_BINS request with B_Delta_BINS format response
RESPONSE_BROADCAST //external latch mode with B_Delta_BINS format data and latch pulse request
} ResponseModes;
+/*Move to DeviceCounters.h*/
typedef enum
{
Reserved,
@@ -175,7 +180,7 @@
int PullRequest(DeviceInputBuffer *b);
-void TransmitResponse(void);
+void TransmitDelta(void);
DeviceLatchMode DecodeLatchModeFromDeviceMode(uint8_t param);
DeviceDeltaMode DecodeDeltaModeFromDeviceMode(uint8_t param);
@@ -185,8 +190,13 @@
void Encode8(uint8_t);
void Encode16(uint16_t);
+
+void EncodeStart(void);
+void EncodeEnd(void);
+
void EncodeDeviceMode(void);
void EncodeSysRgR(void);
+
void EncodeCRC(void);
#endif /* __DEVICEPROTOCOL_H__ */
\ No newline at end of file
