aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Code_Composer
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2017-12-28 15:13:27 +0200
committerAvi Levkovich <avi@twine-s.com>2017-12-28 15:13:27 +0200
commit15799210aab388996f86808e000940093306ca41 (patch)
tree2c36ddd18b76f74e6a0a429d102bb33d36e98337 /Software/Code_Composer
parent76aa983631df4fa5b16b170e2f6dd845c5ac9531 (diff)
downloadTango-15799210aab388996f86808e000940093306ca41.tar.gz
Tango-15799210aab388996f86808e000940093306ca41.zip
Working on stubs.
Diffstat (limited to 'Software/Code_Composer')
-rw-r--r--Software/Code_Composer/twine_usblib_demo/.cproject2
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.c18
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.h6
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.c39
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.h13
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.c30
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.h13
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.c92
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.h75
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.c170
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.h99
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.c144
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.h95
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.c105
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.h79
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.c27
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.c32
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.c23
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.c27
-rw-r--r--Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.h12
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Container.c7
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/DataDef.h18
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Cartridge.c22
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Dispenser.c8
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.c163
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.h8
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_GPIO.c65
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Heater.c8
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_MotorEncoder.c10
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_OptLimitSwitch.c9
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.c57
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.h3
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_SteperMotor.c8
-rw-r--r--Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Valve.c11
-rw-r--r--Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.c488
-rw-r--r--Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.h6
-rw-r--r--Software/Code_Composer/twine_usblib_demo/main.c10
54 files changed, 2087 insertions, 196 deletions
diff --git a/Software/Code_Composer/twine_usblib_demo/.cproject b/Software/Code_Composer/twine_usblib_demo/.cproject
index 863662ebe..c6812f5ac 100644
--- a/Software/Code_Composer/twine_usblib_demo/.cproject
+++ b/Software/Code_Composer/twine_usblib_demo/.cproject
@@ -60,7 +60,7 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/twine_usblib_demo/PMR/Common}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/twine_usblib_demo/PMR/Jobs}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/twine_usblib_demo/PMR/Stubs}&quot;"/>
- <listOptionValue builtIn="false" value="&quot;${workspace_loc:/twine_usblib_demo/protobuf}&quot;"/>
+ <listOptionValue builtIn="false" value="&quot;${workspace_loc:/twine_usblib_demo\protobuf-c}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/twine_usblib_demo}&quot;"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.321246444" name="Debugging model" superClass="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL" useByScannerDiscovery="false" value="com.ti.ccstudio.buildDefinitions.TMS470_16.3.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.c
index 6416e1fcd..0f52fa295 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.c
@@ -7,7 +7,7 @@
#endif
#include "MessageType.pb-c.h"
-static const ProtobufCEnumValue message_type__enum_values_by_number[33] =
+static const ProtobufCEnumValue message_type__enum_values_by_number[37] =
{
{ "RGB", "MESSAGE_TYPE__RGB", 0 },
{ "Job", "MESSAGE_TYPE__Job", 1 },
@@ -42,11 +42,15 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[33] =
{ "StubSteperMotorResponse", "MESSAGE_TYPE__StubSteperMotorResponse", 30 },
{ "StubValveRequest", "MESSAGE_TYPE__StubValveRequest", 31 },
{ "StubValveResponse", "MESSAGE_TYPE__StubValveResponse", 32 },
+ { "StubExtFlashReadRequest", "MESSAGE_TYPE__StubExtFlashReadRequest", 33 },
+ { "StubExtFlashReadResponse", "MESSAGE_TYPE__StubExtFlashReadResponse", 34 },
+ { "StubExtFlashWriteRequest", "MESSAGE_TYPE__StubExtFlashWriteRequest", 35 },
+ { "StubExtFlashWriteResponse", "MESSAGE_TYPE__StubExtFlashWriteResponse", 36 },
};
static const ProtobufCIntRange message_type__value_ranges[] = {
-{0, 0},{0, 33}
+{0, 0},{0, 37}
};
-static const ProtobufCEnumValueIndex message_type__enum_values_by_name[33] =
+static const ProtobufCEnumValueIndex message_type__enum_values_by_name[37] =
{
{ "CalculateRequest", 3 },
{ "CalculateResponse", 4 },
@@ -61,6 +65,10 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[33] =
{ "StubCartridgeWriteResponse", 10 },
{ "StubDispenserRequest", 11 },
{ "StubDispenserResponse", 12 },
+ { "StubExtFlashReadRequest", 33 },
+ { "StubExtFlashReadResponse", 34 },
+ { "StubExtFlashWriteRequest", 35 },
+ { "StubExtFlashWriteResponse", 36 },
{ "StubGPIOInputSetupRequest", 13 },
{ "StubGPIOInputSetupResponse", 14 },
{ "StubGPIOReadBitRequest", 15 },
@@ -89,9 +97,9 @@ const ProtobufCEnumDescriptor message_type__descriptor =
"MessageType",
"MessageType",
"",
- 33,
+ 37,
message_type__enum_values_by_number,
- 33,
+ 37,
message_type__enum_values_by_name,
1,
message_type__value_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.h
index 56f9af6ca..1f6bc4229 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Common/MessageType.pb-c.h
@@ -52,7 +52,11 @@ typedef enum _MessageType {
MESSAGE_TYPE__StubSteperMotorRequest = 29,
MESSAGE_TYPE__StubSteperMotorResponse = 30,
MESSAGE_TYPE__StubValveRequest = 31,
- MESSAGE_TYPE__StubValveResponse = 32
+ MESSAGE_TYPE__StubValveResponse = 32,
+ MESSAGE_TYPE__StubExtFlashReadRequest = 33,
+ MESSAGE_TYPE__StubExtFlashReadResponse = 34,
+ MESSAGE_TYPE__StubExtFlashWriteRequest = 35,
+ MESSAGE_TYPE__StubExtFlashWriteResponse = 36
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(MESSAGE_TYPE)
} MessageType;
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.c
index 7c23c1ffa..125ec15e2 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_cartridge_read_response__free_unpacked
assert(message->base.descriptor == &stub_cartridge_read_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_cartridge_read_response__field_descriptors[6] =
+static const ProtobufCFieldDescriptor stub_cartridge_read_response__field_descriptors[7] =
{
{
"CartridgeId",
@@ -68,7 +68,7 @@ static const ProtobufCFieldDescriptor stub_cartridge_read_response__field_descri
},
{
"CartridgeColor",
- 3,
+ 2,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_UINT32,
offsetof(StubCartridgeReadResponse, has_cartridgecolor),
@@ -80,7 +80,7 @@ static const ProtobufCFieldDescriptor stub_cartridge_read_response__field_descri
},
{
"CartridgeVersion",
- 4,
+ 3,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_UINT32,
offsetof(StubCartridgeReadResponse, has_cartridgeversion),
@@ -92,7 +92,7 @@ static const ProtobufCFieldDescriptor stub_cartridge_read_response__field_descri
},
{
"CartridgeData",
- 5,
+ 4,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_INT32,
offsetof(StubCartridgeReadResponse, has_cartridgedata),
@@ -104,7 +104,7 @@ static const ProtobufCFieldDescriptor stub_cartridge_read_response__field_descri
},
{
"CartridgeUsed",
- 6,
+ 5,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_BOOL,
offsetof(StubCartridgeReadResponse, has_cartridgeused),
@@ -116,16 +116,28 @@ static const ProtobufCFieldDescriptor stub_cartridge_read_response__field_descri
},
{
"Status",
- 8,
+ 6,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_UINT32,
- offsetof(StubCartridgeReadResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubCartridgeReadResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 7,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubCartridgeReadResponse, has_statusword),
+ offsetof(StubCartridgeReadResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_cartridge_read_response__field_indices_by_name[] = {
1, /* field[1] = CartridgeColor */
@@ -134,13 +146,12 @@ static const unsigned stub_cartridge_read_response__field_indices_by_name[] = {
4, /* field[4] = CartridgeUsed */
2, /* field[2] = CartridgeVersion */
5, /* field[5] = Status */
+ 6, /* field[6] = StatusWord */
};
-static const ProtobufCIntRange stub_cartridge_read_response__number_ranges[3 + 1] =
+static const ProtobufCIntRange stub_cartridge_read_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 3, 1 },
- { 8, 5 },
- { 0, 6 }
+ { 0, 7 }
};
const ProtobufCMessageDescriptor stub_cartridge_read_response__descriptor =
{
@@ -150,10 +161,10 @@ const ProtobufCMessageDescriptor stub_cartridge_read_response__descriptor =
"StubCartridgeReadResponse",
"",
sizeof(StubCartridgeReadResponse),
- 6,
+ 7,
stub_cartridge_read_response__field_descriptors,
stub_cartridge_read_response__field_indices_by_name,
- 3, stub_cartridge_read_response__number_ranges,
+ 1, stub_cartridge_read_response__number_ranges,
(ProtobufCMessageInit) stub_cartridge_read_response__init,
NULL,NULL,NULL /* reserved[123] */
};
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.h
index 3b82ef645..06a173e8b 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeReadResponse.pb-c.h
@@ -36,12 +36,19 @@ struct _StubCartridgeReadResponse
int32_t cartridgedata;
protobuf_c_boolean has_cartridgeused;
protobuf_c_boolean cartridgeused;
- protobuf_c_boolean has_status;
- uint32_t status;
+ /*
+ * Passed/Failed
+ */
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_CARTRIDGE_READ_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_cartridge_read_response__descriptor) \
- , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+ , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0 }
/* StubCartridgeReadResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.c
index 66454c20a..aa271df59 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_cartridge_write_response__free_unpacked
assert(message->base.descriptor == &stub_cartridge_write_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_cartridge_write_response__field_descriptors[2] =
+static const ProtobufCFieldDescriptor stub_cartridge_write_response__field_descriptors[3] =
{
{
"CartridgeId",
@@ -68,26 +68,38 @@ static const ProtobufCFieldDescriptor stub_cartridge_write_response__field_descr
},
{
"Status",
- 8,
+ 2,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_UINT32,
- offsetof(StubCartridgeWriteResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubCartridgeWriteResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubCartridgeWriteResponse, has_statusword),
+ offsetof(StubCartridgeWriteResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_cartridge_write_response__field_indices_by_name[] = {
0, /* field[0] = CartridgeId */
1, /* field[1] = Status */
+ 2, /* field[2] = StatusWord */
};
-static const ProtobufCIntRange stub_cartridge_write_response__number_ranges[2 + 1] =
+static const ProtobufCIntRange stub_cartridge_write_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 8, 1 },
- { 0, 2 }
+ { 0, 3 }
};
const ProtobufCMessageDescriptor stub_cartridge_write_response__descriptor =
{
@@ -97,10 +109,10 @@ const ProtobufCMessageDescriptor stub_cartridge_write_response__descriptor =
"StubCartridgeWriteResponse",
"",
sizeof(StubCartridgeWriteResponse),
- 2,
+ 3,
stub_cartridge_write_response__field_descriptors,
stub_cartridge_write_response__field_indices_by_name,
- 2, stub_cartridge_write_response__number_ranges,
+ 1, stub_cartridge_write_response__number_ranges,
(ProtobufCMessageInit) stub_cartridge_write_response__init,
NULL,NULL,NULL /* reserved[123] */
};
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.h
index 5ba0eb28c..dab3d46fb 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubCartridgeWriteResponse.pb-c.h
@@ -28,12 +28,19 @@ struct _StubCartridgeWriteResponse
ProtobufCMessage base;
protobuf_c_boolean has_cartridgeid;
uint32_t cartridgeid;
- protobuf_c_boolean has_status;
- uint32_t status;
+ /*
+ * Passed/Failed
+ */
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_CARTRIDGE_WRITE_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_cartridge_write_response__descriptor) \
- , 0, 0, 0, 0 }
+ , 0, 0, NULL, 0, 0 }
/* StubCartridgeWriteResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.c
index de699971a..cbfd886ec 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_dispenser_response__free_unpacked
assert(message->base.descriptor == &stub_dispenser_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_dispenser_response__field_descriptors[4] =
+static const ProtobufCFieldDescriptor stub_dispenser_response__field_descriptors[5] =
{
{
"DispenserId",
@@ -94,25 +94,38 @@ static const ProtobufCFieldDescriptor stub_dispenser_response__field_descriptors
"Status",
4,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BOOL,
- offsetof(StubDispenserResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubDispenserResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubDispenserResponse, has_statusword),
+ offsetof(StubDispenserResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_dispenser_response__field_indices_by_name[] = {
0, /* field[0] = DispenserId */
1, /* field[1] = DispenserPosition */
2, /* field[2] = InkWorningLevel */
3, /* field[3] = Status */
+ 4, /* field[4] = StatusWord */
};
static const ProtobufCIntRange stub_dispenser_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 4 }
+ { 0, 5 }
};
const ProtobufCMessageDescriptor stub_dispenser_response__descriptor =
{
@@ -122,7 +135,7 @@ const ProtobufCMessageDescriptor stub_dispenser_response__descriptor =
"StubDispenserResponse",
"",
sizeof(StubDispenserResponse),
- 4,
+ 5,
stub_dispenser_response__field_descriptors,
stub_dispenser_response__field_indices_by_name,
1, stub_dispenser_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.h
index 7598720df..14d55b18e 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubDispenserResponse.pb-c.h
@@ -41,14 +41,18 @@ struct _StubDispenserResponse
protobuf_c_boolean has_inkworninglevel;
uint32_t inkworninglevel;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- protobuf_c_boolean status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_DISPENSER_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_dispenser_response__descriptor) \
- , 0, 0, 0, 0, 0, 0, 0, 0 }
+ , 0, 0, 0, 0, 0, 0, NULL, 0, 0 }
/* StubDispenserResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.c
new file mode 100644
index 000000000..e5f22797a
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.c
@@ -0,0 +1,92 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashReadRequest.proto */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C__NO_DEPRECATED
+#define PROTOBUF_C__NO_DEPRECATED
+#endif
+
+#include "StubExtFlashReadRequest.pb-c.h"
+void stub_ext_flash_read_request__init
+ (StubExtFlashReadRequest *message)
+{
+ static const StubExtFlashReadRequest init_value = STUB_EXT_FLASH_READ_REQUEST__INIT;
+ *message = init_value;
+}
+size_t stub_ext_flash_read_request__get_packed_size
+ (const StubExtFlashReadRequest *message)
+{
+ assert(message->base.descriptor == &stub_ext_flash_read_request__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t stub_ext_flash_read_request__pack
+ (const StubExtFlashReadRequest *message,
+ uint8_t *out)
+{
+ assert(message->base.descriptor == &stub_ext_flash_read_request__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t stub_ext_flash_read_request__pack_to_buffer
+ (const StubExtFlashReadRequest *message,
+ ProtobufCBuffer *buffer)
+{
+ assert(message->base.descriptor == &stub_ext_flash_read_request__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+StubExtFlashReadRequest *
+ stub_ext_flash_read_request__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (StubExtFlashReadRequest *)
+ protobuf_c_message_unpack (&stub_ext_flash_read_request__descriptor,
+ allocator, len, data);
+}
+void stub_ext_flash_read_request__free_unpacked
+ (StubExtFlashReadRequest *message,
+ ProtobufCAllocator *allocator)
+{
+ if(!message)
+ return;
+ assert(message->base.descriptor == &stub_ext_flash_read_request__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor stub_ext_flash_read_request__field_descriptors[1] =
+{
+ {
+ "Number_Of_Words",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubExtFlashReadRequest, has_number_of_words),
+ offsetof(StubExtFlashReadRequest, number_of_words),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned stub_ext_flash_read_request__field_indices_by_name[] = {
+ 0, /* field[0] = Number_Of_Words */
+};
+static const ProtobufCIntRange stub_ext_flash_read_request__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 1 }
+};
+const ProtobufCMessageDescriptor stub_ext_flash_read_request__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "StubExtFlashReadRequest",
+ "StubExtFlashReadRequest",
+ "StubExtFlashReadRequest",
+ "",
+ sizeof(StubExtFlashReadRequest),
+ 1,
+ stub_ext_flash_read_request__field_descriptors,
+ stub_ext_flash_read_request__field_indices_by_name,
+ 1, stub_ext_flash_read_request__number_ranges,
+ (ProtobufCMessageInit) stub_ext_flash_read_request__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.h
new file mode 100644
index 000000000..0345c7c86
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadRequest.pb-c.h
@@ -0,0 +1,75 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashReadRequest.proto */
+
+#ifndef PROTOBUF_C_StubExtFlashReadRequest_2eproto__INCLUDED
+#define PROTOBUF_C_StubExtFlashReadRequest_2eproto__INCLUDED
+
+#include <protobuf-c/protobuf-c.h>
+
+PROTOBUF_C__BEGIN_DECLS
+
+#if PROTOBUF_C_VERSION_NUMBER < 1003000
+# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
+#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
+# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
+#endif
+
+
+typedef struct _StubExtFlashReadRequest StubExtFlashReadRequest;
+
+
+/* --- enums --- */
+
+
+/* --- messages --- */
+
+struct _StubExtFlashReadRequest
+{
+ ProtobufCMessage base;
+ /*
+ *Max 5 at this test
+ */
+ protobuf_c_boolean has_number_of_words;
+ uint32_t number_of_words;
+};
+#define STUB_EXT_FLASH_READ_REQUEST__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&stub_ext_flash_read_request__descriptor) \
+ , 0, 0 }
+
+
+/* StubExtFlashReadRequest methods */
+void stub_ext_flash_read_request__init
+ (StubExtFlashReadRequest *message);
+size_t stub_ext_flash_read_request__get_packed_size
+ (const StubExtFlashReadRequest *message);
+size_t stub_ext_flash_read_request__pack
+ (const StubExtFlashReadRequest *message,
+ uint8_t *out);
+size_t stub_ext_flash_read_request__pack_to_buffer
+ (const StubExtFlashReadRequest *message,
+ ProtobufCBuffer *buffer);
+StubExtFlashReadRequest *
+ stub_ext_flash_read_request__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void stub_ext_flash_read_request__free_unpacked
+ (StubExtFlashReadRequest *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*StubExtFlashReadRequest_Closure)
+ (const StubExtFlashReadRequest *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor stub_ext_flash_read_request__descriptor;
+
+PROTOBUF_C__END_DECLS
+
+
+#endif /* PROTOBUF_C_StubExtFlashReadRequest_2eproto__INCLUDED */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.c
new file mode 100644
index 000000000..57045730d
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.c
@@ -0,0 +1,170 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashReadResponse.proto */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C__NO_DEPRECATED
+#define PROTOBUF_C__NO_DEPRECATED
+#endif
+
+#include "StubExtFlashReadResponse.pb-c.h"
+void stub_ext_flash_read_response__init
+ (StubExtFlashReadResponse *message)
+{
+ static const StubExtFlashReadResponse init_value = STUB_EXT_FLASH_READ_RESPONSE__INIT;
+ *message = init_value;
+}
+size_t stub_ext_flash_read_response__get_packed_size
+ (const StubExtFlashReadResponse *message)
+{
+ assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t stub_ext_flash_read_response__pack
+ (const StubExtFlashReadResponse *message,
+ uint8_t *out)
+{
+ assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t stub_ext_flash_read_response__pack_to_buffer
+ (const StubExtFlashReadResponse *message,
+ ProtobufCBuffer *buffer)
+{
+ assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+StubExtFlashReadResponse *
+ stub_ext_flash_read_response__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (StubExtFlashReadResponse *)
+ protobuf_c_message_unpack (&stub_ext_flash_read_response__descriptor,
+ allocator, len, data);
+}
+void stub_ext_flash_read_response__free_unpacked
+ (StubExtFlashReadResponse *message,
+ ProtobufCAllocator *allocator)
+{
+ if(!message)
+ return;
+ assert(message->base.descriptor == &stub_ext_flash_read_response__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor stub_ext_flash_read_response__field_descriptors[7] =
+{
+ {
+ "ReadWord_1",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashReadResponse, has_readword_1),
+ offsetof(StubExtFlashReadResponse, readword_1),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ReadWord_2",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashReadResponse, has_readword_2),
+ offsetof(StubExtFlashReadResponse, readword_2),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ReadWord_3",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashReadResponse, has_readword_3),
+ offsetof(StubExtFlashReadResponse, readword_3),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ReadWord_4",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashReadResponse, has_readword_4),
+ offsetof(StubExtFlashReadResponse, readword_4),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "ReadWord_5",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashReadResponse, has_readword_5),
+ offsetof(StubExtFlashReadResponse, readword_5),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "Status",
+ 6,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ offsetof(StubExtFlashReadResponse, status),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "StatusWord",
+ 7,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubExtFlashReadResponse, has_statusword),
+ offsetof(StubExtFlashReadResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned stub_ext_flash_read_response__field_indices_by_name[] = {
+ 0, /* field[0] = ReadWord_1 */
+ 1, /* field[1] = ReadWord_2 */
+ 2, /* field[2] = ReadWord_3 */
+ 3, /* field[3] = ReadWord_4 */
+ 4, /* field[4] = ReadWord_5 */
+ 5, /* field[5] = Status */
+ 6, /* field[6] = StatusWord */
+};
+static const ProtobufCIntRange stub_ext_flash_read_response__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 7 }
+};
+const ProtobufCMessageDescriptor stub_ext_flash_read_response__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "StubExtFlashReadResponse",
+ "StubExtFlashReadResponse",
+ "StubExtFlashReadResponse",
+ "",
+ sizeof(StubExtFlashReadResponse),
+ 7,
+ stub_ext_flash_read_response__field_descriptors,
+ stub_ext_flash_read_response__field_indices_by_name,
+ 1, stub_ext_flash_read_response__number_ranges,
+ (ProtobufCMessageInit) stub_ext_flash_read_response__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.h
new file mode 100644
index 000000000..c0bfdd88c
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashReadResponse.pb-c.h
@@ -0,0 +1,99 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashReadResponse.proto */
+
+#ifndef PROTOBUF_C_StubExtFlashReadResponse_2eproto__INCLUDED
+#define PROTOBUF_C_StubExtFlashReadResponse_2eproto__INCLUDED
+
+#include <protobuf-c/protobuf-c.h>
+
+PROTOBUF_C__BEGIN_DECLS
+
+#if PROTOBUF_C_VERSION_NUMBER < 1003000
+# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
+#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
+# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
+#endif
+
+
+typedef struct _StubExtFlashReadResponse StubExtFlashReadResponse;
+
+
+/* --- enums --- */
+
+
+/* --- messages --- */
+
+struct _StubExtFlashReadResponse
+{
+ ProtobufCMessage base;
+ /*
+ */
+ protobuf_c_boolean has_readword_1;
+ int32_t readword_1;
+ /*
+ */
+ protobuf_c_boolean has_readword_2;
+ int32_t readword_2;
+ /*
+ */
+ protobuf_c_boolean has_readword_3;
+ int32_t readword_3;
+ /*
+ */
+ protobuf_c_boolean has_readword_4;
+ int32_t readword_4;
+ /*
+ */
+ protobuf_c_boolean has_readword_5;
+ int32_t readword_5;
+ /*
+ * Passed/Failed
+ */
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
+};
+#define STUB_EXT_FLASH_READ_RESPONSE__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&stub_ext_flash_read_response__descriptor) \
+ , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0 }
+
+
+/* StubExtFlashReadResponse methods */
+void stub_ext_flash_read_response__init
+ (StubExtFlashReadResponse *message);
+size_t stub_ext_flash_read_response__get_packed_size
+ (const StubExtFlashReadResponse *message);
+size_t stub_ext_flash_read_response__pack
+ (const StubExtFlashReadResponse *message,
+ uint8_t *out);
+size_t stub_ext_flash_read_response__pack_to_buffer
+ (const StubExtFlashReadResponse *message,
+ ProtobufCBuffer *buffer);
+StubExtFlashReadResponse *
+ stub_ext_flash_read_response__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void stub_ext_flash_read_response__free_unpacked
+ (StubExtFlashReadResponse *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*StubExtFlashReadResponse_Closure)
+ (const StubExtFlashReadResponse *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor stub_ext_flash_read_response__descriptor;
+
+PROTOBUF_C__END_DECLS
+
+
+#endif /* PROTOBUF_C_StubExtFlashReadResponse_2eproto__INCLUDED */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.c
new file mode 100644
index 000000000..e74bb57de
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.c
@@ -0,0 +1,144 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashWriteRequest.proto */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C__NO_DEPRECATED
+#define PROTOBUF_C__NO_DEPRECATED
+#endif
+
+#include "StubExtFlashWriteRequest.pb-c.h"
+void stub_ext_flash_write_request__init
+ (StubExtFlashWriteRequest *message)
+{
+ static const StubExtFlashWriteRequest init_value = STUB_EXT_FLASH_WRITE_REQUEST__INIT;
+ *message = init_value;
+}
+size_t stub_ext_flash_write_request__get_packed_size
+ (const StubExtFlashWriteRequest *message)
+{
+ assert(message->base.descriptor == &stub_ext_flash_write_request__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t stub_ext_flash_write_request__pack
+ (const StubExtFlashWriteRequest *message,
+ uint8_t *out)
+{
+ assert(message->base.descriptor == &stub_ext_flash_write_request__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t stub_ext_flash_write_request__pack_to_buffer
+ (const StubExtFlashWriteRequest *message,
+ ProtobufCBuffer *buffer)
+{
+ assert(message->base.descriptor == &stub_ext_flash_write_request__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+StubExtFlashWriteRequest *
+ stub_ext_flash_write_request__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (StubExtFlashWriteRequest *)
+ protobuf_c_message_unpack (&stub_ext_flash_write_request__descriptor,
+ allocator, len, data);
+}
+void stub_ext_flash_write_request__free_unpacked
+ (StubExtFlashWriteRequest *message,
+ ProtobufCAllocator *allocator)
+{
+ if(!message)
+ return;
+ assert(message->base.descriptor == &stub_ext_flash_write_request__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor stub_ext_flash_write_request__field_descriptors[5] =
+{
+ {
+ "WordToWrite1",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashWriteRequest, has_wordtowrite1),
+ offsetof(StubExtFlashWriteRequest, wordtowrite1),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "WordToWrite2",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashWriteRequest, has_wordtowrite2),
+ offsetof(StubExtFlashWriteRequest, wordtowrite2),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "WordToWrite3",
+ 3,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashWriteRequest, has_wordtowrite3),
+ offsetof(StubExtFlashWriteRequest, wordtowrite3),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "WordToWrite4",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashWriteRequest, has_wordtowrite4),
+ offsetof(StubExtFlashWriteRequest, wordtowrite4),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "WordToWrite5",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_INT32,
+ offsetof(StubExtFlashWriteRequest, has_wordtowrite5),
+ offsetof(StubExtFlashWriteRequest, wordtowrite5),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned stub_ext_flash_write_request__field_indices_by_name[] = {
+ 0, /* field[0] = WordToWrite1 */
+ 1, /* field[1] = WordToWrite2 */
+ 2, /* field[2] = WordToWrite3 */
+ 3, /* field[3] = WordToWrite4 */
+ 4, /* field[4] = WordToWrite5 */
+};
+static const ProtobufCIntRange stub_ext_flash_write_request__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 5 }
+};
+const ProtobufCMessageDescriptor stub_ext_flash_write_request__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "StubExtFlashWriteRequest",
+ "StubExtFlashWriteRequest",
+ "StubExtFlashWriteRequest",
+ "",
+ sizeof(StubExtFlashWriteRequest),
+ 5,
+ stub_ext_flash_write_request__field_descriptors,
+ stub_ext_flash_write_request__field_indices_by_name,
+ 1, stub_ext_flash_write_request__number_ranges,
+ (ProtobufCMessageInit) stub_ext_flash_write_request__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.h
new file mode 100644
index 000000000..91453d218
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteRequest.pb-c.h
@@ -0,0 +1,95 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashWriteRequest.proto */
+
+#ifndef PROTOBUF_C_StubExtFlashWriteRequest_2eproto__INCLUDED
+#define PROTOBUF_C_StubExtFlashWriteRequest_2eproto__INCLUDED
+
+#include <protobuf-c/protobuf-c.h>
+
+PROTOBUF_C__BEGIN_DECLS
+
+#if PROTOBUF_C_VERSION_NUMBER < 1003000
+# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
+#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
+# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
+#endif
+
+
+typedef struct _StubExtFlashWriteRequest StubExtFlashWriteRequest;
+
+
+/* --- enums --- */
+
+
+/* --- messages --- */
+
+struct _StubExtFlashWriteRequest
+{
+ ProtobufCMessage base;
+ /*
+ *0..255
+ */
+ protobuf_c_boolean has_wordtowrite1;
+ int32_t wordtowrite1;
+ /*
+ *0..255
+ */
+ protobuf_c_boolean has_wordtowrite2;
+ int32_t wordtowrite2;
+ /*
+ *0..255
+ */
+ protobuf_c_boolean has_wordtowrite3;
+ int32_t wordtowrite3;
+ /*
+ *0..255
+ */
+ protobuf_c_boolean has_wordtowrite4;
+ int32_t wordtowrite4;
+ /*
+ *0..255
+ */
+ protobuf_c_boolean has_wordtowrite5;
+ int32_t wordtowrite5;
+};
+#define STUB_EXT_FLASH_WRITE_REQUEST__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&stub_ext_flash_write_request__descriptor) \
+ , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+
+
+/* StubExtFlashWriteRequest methods */
+void stub_ext_flash_write_request__init
+ (StubExtFlashWriteRequest *message);
+size_t stub_ext_flash_write_request__get_packed_size
+ (const StubExtFlashWriteRequest *message);
+size_t stub_ext_flash_write_request__pack
+ (const StubExtFlashWriteRequest *message,
+ uint8_t *out);
+size_t stub_ext_flash_write_request__pack_to_buffer
+ (const StubExtFlashWriteRequest *message,
+ ProtobufCBuffer *buffer);
+StubExtFlashWriteRequest *
+ stub_ext_flash_write_request__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void stub_ext_flash_write_request__free_unpacked
+ (StubExtFlashWriteRequest *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*StubExtFlashWriteRequest_Closure)
+ (const StubExtFlashWriteRequest *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor stub_ext_flash_write_request__descriptor;
+
+PROTOBUF_C__END_DECLS
+
+
+#endif /* PROTOBUF_C_StubExtFlashWriteRequest_2eproto__INCLUDED */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.c
new file mode 100644
index 000000000..33a3b7e98
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.c
@@ -0,0 +1,105 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashWriteResponse.proto */
+
+/* Do not generate deprecated warnings for self */
+#ifndef PROTOBUF_C__NO_DEPRECATED
+#define PROTOBUF_C__NO_DEPRECATED
+#endif
+
+#include "StubExtFlashWriteResponse.pb-c.h"
+void stub_ext_flash_write_response__init
+ (StubExtFlashWriteResponse *message)
+{
+ static const StubExtFlashWriteResponse init_value = STUB_EXT_FLASH_WRITE_RESPONSE__INIT;
+ *message = init_value;
+}
+size_t stub_ext_flash_write_response__get_packed_size
+ (const StubExtFlashWriteResponse *message)
+{
+ assert(message->base.descriptor == &stub_ext_flash_write_response__descriptor);
+ return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
+}
+size_t stub_ext_flash_write_response__pack
+ (const StubExtFlashWriteResponse *message,
+ uint8_t *out)
+{
+ assert(message->base.descriptor == &stub_ext_flash_write_response__descriptor);
+ return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
+}
+size_t stub_ext_flash_write_response__pack_to_buffer
+ (const StubExtFlashWriteResponse *message,
+ ProtobufCBuffer *buffer)
+{
+ assert(message->base.descriptor == &stub_ext_flash_write_response__descriptor);
+ return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
+}
+StubExtFlashWriteResponse *
+ stub_ext_flash_write_response__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data)
+{
+ return (StubExtFlashWriteResponse *)
+ protobuf_c_message_unpack (&stub_ext_flash_write_response__descriptor,
+ allocator, len, data);
+}
+void stub_ext_flash_write_response__free_unpacked
+ (StubExtFlashWriteResponse *message,
+ ProtobufCAllocator *allocator)
+{
+ if(!message)
+ return;
+ assert(message->base.descriptor == &stub_ext_flash_write_response__descriptor);
+ protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
+}
+static const ProtobufCFieldDescriptor stub_ext_flash_write_response__field_descriptors[2] =
+{
+ {
+ "Status",
+ 1,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ offsetof(StubExtFlashWriteResponse, status),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "StatusWord",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubExtFlashWriteResponse, has_statusword),
+ offsetof(StubExtFlashWriteResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+};
+static const unsigned stub_ext_flash_write_response__field_indices_by_name[] = {
+ 0, /* field[0] = Status */
+ 1, /* field[1] = StatusWord */
+};
+static const ProtobufCIntRange stub_ext_flash_write_response__number_ranges[1 + 1] =
+{
+ { 1, 0 },
+ { 0, 2 }
+};
+const ProtobufCMessageDescriptor stub_ext_flash_write_response__descriptor =
+{
+ PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
+ "StubExtFlashWriteResponse",
+ "StubExtFlashWriteResponse",
+ "StubExtFlashWriteResponse",
+ "",
+ sizeof(StubExtFlashWriteResponse),
+ 2,
+ stub_ext_flash_write_response__field_descriptors,
+ stub_ext_flash_write_response__field_indices_by_name,
+ 1, stub_ext_flash_write_response__number_ranges,
+ (ProtobufCMessageInit) stub_ext_flash_write_response__init,
+ NULL,NULL,NULL /* reserved[123] */
+};
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.h
new file mode 100644
index 000000000..50d2f94d4
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubExtFlashWriteResponse.pb-c.h
@@ -0,0 +1,79 @@
+/* Generated by the protocol buffer compiler. DO NOT EDIT! */
+/* Generated from: StubExtFlashWriteResponse.proto */
+
+#ifndef PROTOBUF_C_StubExtFlashWriteResponse_2eproto__INCLUDED
+#define PROTOBUF_C_StubExtFlashWriteResponse_2eproto__INCLUDED
+
+#include <protobuf-c/protobuf-c.h>
+
+PROTOBUF_C__BEGIN_DECLS
+
+#if PROTOBUF_C_VERSION_NUMBER < 1003000
+# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
+#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
+# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
+#endif
+
+
+typedef struct _StubExtFlashWriteResponse StubExtFlashWriteResponse;
+
+
+/* --- enums --- */
+
+
+/* --- messages --- */
+
+struct _StubExtFlashWriteResponse
+{
+ ProtobufCMessage base;
+ /*
+ * Passed/Failed
+ */
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
+};
+#define STUB_EXT_FLASH_WRITE_RESPONSE__INIT \
+ { PROTOBUF_C_MESSAGE_INIT (&stub_ext_flash_write_response__descriptor) \
+ , NULL, 0, 0 }
+
+
+/* StubExtFlashWriteResponse methods */
+void stub_ext_flash_write_response__init
+ (StubExtFlashWriteResponse *message);
+size_t stub_ext_flash_write_response__get_packed_size
+ (const StubExtFlashWriteResponse *message);
+size_t stub_ext_flash_write_response__pack
+ (const StubExtFlashWriteResponse *message,
+ uint8_t *out);
+size_t stub_ext_flash_write_response__pack_to_buffer
+ (const StubExtFlashWriteResponse *message,
+ ProtobufCBuffer *buffer);
+StubExtFlashWriteResponse *
+ stub_ext_flash_write_response__unpack
+ (ProtobufCAllocator *allocator,
+ size_t len,
+ const uint8_t *data);
+void stub_ext_flash_write_response__free_unpacked
+ (StubExtFlashWriteResponse *message,
+ ProtobufCAllocator *allocator);
+/* --- per-message closures --- */
+
+typedef void (*StubExtFlashWriteResponse_Closure)
+ (const StubExtFlashWriteResponse *message,
+ void *closure_data);
+
+/* --- services --- */
+
+
+/* --- descriptors --- */
+
+extern const ProtobufCMessageDescriptor stub_ext_flash_write_response__descriptor;
+
+PROTOBUF_C__END_DECLS
+
+
+#endif /* PROTOBUF_C_StubExtFlashWriteResponse_2eproto__INCLUDED */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.c
index d9d10ab20..a7ad8a8e5 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_gpioinput_setup_response__free_unpacked
assert(message->base.descriptor == &stub_gpioinput_setup_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_gpioinput_setup_response__field_descriptors[3] =
+static const ProtobufCFieldDescriptor stub_gpioinput_setup_response__field_descriptors[4] =
{
{
"PortId",
@@ -82,24 +82,37 @@ static const ProtobufCFieldDescriptor stub_gpioinput_setup_response__field_descr
"Status",
3,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_UINT32,
- offsetof(StubGPIOInputSetupResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubGPIOInputSetupResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubGPIOInputSetupResponse, has_statusword),
+ offsetof(StubGPIOInputSetupResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_gpioinput_setup_response__field_indices_by_name[] = {
1, /* field[1] = PinId */
0, /* field[0] = PortId */
2, /* field[2] = Status */
+ 3, /* field[3] = StatusWord */
};
static const ProtobufCIntRange stub_gpioinput_setup_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 3 }
+ { 0, 4 }
};
const ProtobufCMessageDescriptor stub_gpioinput_setup_response__descriptor =
{
@@ -109,7 +122,7 @@ const ProtobufCMessageDescriptor stub_gpioinput_setup_response__descriptor =
"StubGPIOInputSetupResponse",
"",
sizeof(StubGPIOInputSetupResponse),
- 3,
+ 4,
stub_gpioinput_setup_response__field_descriptors,
stub_gpioinput_setup_response__field_indices_by_name,
1, stub_gpioinput_setup_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.h
index c0c18fa8c..7a93c3048 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOInputSetupResponse.pb-c.h
@@ -36,14 +36,18 @@ struct _StubGPIOInputSetupResponse
protobuf_c_boolean has_pinid;
uint32_t pinid;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- uint32_t status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_GPIOINPUT_SETUP_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_gpioinput_setup_response__descriptor) \
- , NULL, 0, 0, 0, 0 }
+ , NULL, 0, 0, NULL, 0, 0 }
/* StubGPIOInputSetupResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.c
index 95720a650..bc5bc2e84 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_gpioread_bit_response__free_unpacked
assert(message->base.descriptor == &stub_gpioread_bit_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_gpioread_bit_response__field_descriptors[4] =
+static const ProtobufCFieldDescriptor stub_gpioread_bit_response__field_descriptors[5] =
{
{
"PortId",
@@ -94,25 +94,38 @@ static const ProtobufCFieldDescriptor stub_gpioread_bit_response__field_descript
"Status",
4,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_UINT32,
- offsetof(StubGPIOReadBitResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubGPIOReadBitResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 5,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubGPIOReadBitResponse, has_statusword),
+ offsetof(StubGPIOReadBitResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_gpioread_bit_response__field_indices_by_name[] = {
2, /* field[2] = BitValue */
1, /* field[1] = PinId */
0, /* field[0] = PortId */
3, /* field[3] = Status */
+ 4, /* field[4] = StatusWord */
};
static const ProtobufCIntRange stub_gpioread_bit_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 4 }
+ { 0, 5 }
};
const ProtobufCMessageDescriptor stub_gpioread_bit_response__descriptor =
{
@@ -122,7 +135,7 @@ const ProtobufCMessageDescriptor stub_gpioread_bit_response__descriptor =
"StubGPIOReadBitResponse",
"",
sizeof(StubGPIOReadBitResponse),
- 4,
+ 5,
stub_gpioread_bit_response__field_descriptors,
stub_gpioread_bit_response__field_indices_by_name,
1, stub_gpioread_bit_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.h
index 09a7ea261..ebbdc199d 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadBitResponse.pb-c.h
@@ -38,14 +38,18 @@ struct _StubGPIOReadBitResponse
protobuf_c_boolean has_bitvalue;
protobuf_c_boolean bitvalue;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- uint32_t status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_GPIOREAD_BIT_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_gpioread_bit_response__descriptor) \
- , NULL, 0, 0, 0, 0, 0, 0 }
+ , NULL, 0, 0, 0, 0, NULL, 0, 0 }
/* StubGPIOReadBitResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.c
index a6ca419de..b43726c3e 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_gpioread_byte_response__free_unpacked
assert(message->base.descriptor == &stub_gpioread_byte_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_gpioread_byte_response__field_descriptors[3] =
+static const ProtobufCFieldDescriptor stub_gpioread_byte_response__field_descriptors[4] =
{
{
"PortId",
@@ -79,27 +79,40 @@ static const ProtobufCFieldDescriptor stub_gpioread_byte_response__field_descrip
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "status",
+ "Status",
3,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_UINT32,
- offsetof(StubGPIOReadByteResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubGPIOReadByteResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubGPIOReadByteResponse, has_statusword),
+ offsetof(StubGPIOReadByteResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_gpioread_byte_response__field_indices_by_name[] = {
1, /* field[1] = ByteValue */
0, /* field[0] = PortId */
- 2, /* field[2] = status */
+ 2, /* field[2] = Status */
+ 3, /* field[3] = StatusWord */
};
static const ProtobufCIntRange stub_gpioread_byte_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 3 }
+ { 0, 4 }
};
const ProtobufCMessageDescriptor stub_gpioread_byte_response__descriptor =
{
@@ -109,7 +122,7 @@ const ProtobufCMessageDescriptor stub_gpioread_byte_response__descriptor =
"StubGPIOReadByteResponse",
"",
sizeof(StubGPIOReadByteResponse),
- 3,
+ 4,
stub_gpioread_byte_response__field_descriptors,
stub_gpioread_byte_response__field_indices_by_name,
1, stub_gpioread_byte_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.h
index a1a8fe399..dad405984 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOReadByteResponse.pb-c.h
@@ -33,14 +33,18 @@ struct _StubGPIOReadByteResponse
protobuf_c_boolean has_bytevalue;
uint32_t bytevalue;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- uint32_t status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_GPIOREAD_BYTE_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_gpioread_byte_response__descriptor) \
- , NULL, 0, 0, 0, 0 }
+ , NULL, 0, 0, NULL, 0, 0 }
/* StubGPIOReadByteResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.c
index f650dff67..ef26dbf57 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_gpiowrite_bit_response__free_unpacked
assert(message->base.descriptor == &stub_gpiowrite_bit_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_gpiowrite_bit_response__field_descriptors[3] =
+static const ProtobufCFieldDescriptor stub_gpiowrite_bit_response__field_descriptors[4] =
{
{
"PortId",
@@ -82,24 +82,37 @@ static const ProtobufCFieldDescriptor stub_gpiowrite_bit_response__field_descrip
"Status",
3,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_UINT32,
- offsetof(StubGPIOWriteBitResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubGPIOWriteBitResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubGPIOWriteBitResponse, has_statusword),
+ offsetof(StubGPIOWriteBitResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_gpiowrite_bit_response__field_indices_by_name[] = {
1, /* field[1] = PinId */
0, /* field[0] = PortId */
2, /* field[2] = Status */
+ 3, /* field[3] = StatusWord */
};
static const ProtobufCIntRange stub_gpiowrite_bit_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 3 }
+ { 0, 4 }
};
const ProtobufCMessageDescriptor stub_gpiowrite_bit_response__descriptor =
{
@@ -109,7 +122,7 @@ const ProtobufCMessageDescriptor stub_gpiowrite_bit_response__descriptor =
"StubGPIOWriteBitResponse",
"",
sizeof(StubGPIOWriteBitResponse),
- 3,
+ 4,
stub_gpiowrite_bit_response__field_descriptors,
stub_gpiowrite_bit_response__field_indices_by_name,
1, stub_gpiowrite_bit_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.h
index 0516ad60e..831732f4a 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteBitResponse.pb-c.h
@@ -36,14 +36,18 @@ struct _StubGPIOWriteBitResponse
protobuf_c_boolean has_pinid;
uint32_t pinid;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- uint32_t status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_GPIOWRITE_BIT_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_gpiowrite_bit_response__descriptor) \
- , NULL, 0, 0, 0, 0 }
+ , NULL, 0, 0, NULL, 0, 0 }
/* StubGPIOWriteBitResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.c
index 4a72207c7..ab6b357d9 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_gpiowrite_byte_response__free_unpacked
assert(message->base.descriptor == &stub_gpiowrite_byte_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_gpiowrite_byte_response__field_descriptors[2] =
+static const ProtobufCFieldDescriptor stub_gpiowrite_byte_response__field_descriptors[3] =
{
{
"PortId",
@@ -67,12 +67,24 @@ static const ProtobufCFieldDescriptor stub_gpiowrite_byte_response__field_descri
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "status",
+ "Status",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
+ offsetof(StubGPIOWriteByteResponse, status),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "StatusWord",
3,
PROTOBUF_C_LABEL_OPTIONAL,
PROTOBUF_C_TYPE_UINT32,
- offsetof(StubGPIOWriteByteResponse, has_status),
- offsetof(StubGPIOWriteByteResponse, status),
+ offsetof(StubGPIOWriteByteResponse, has_statusword),
+ offsetof(StubGPIOWriteByteResponse, statusword),
NULL,
NULL,
0, /* flags */
@@ -81,13 +93,13 @@ static const ProtobufCFieldDescriptor stub_gpiowrite_byte_response__field_descri
};
static const unsigned stub_gpiowrite_byte_response__field_indices_by_name[] = {
0, /* field[0] = PortId */
- 1, /* field[1] = status */
+ 1, /* field[1] = Status */
+ 2, /* field[2] = StatusWord */
};
-static const ProtobufCIntRange stub_gpiowrite_byte_response__number_ranges[2 + 1] =
+static const ProtobufCIntRange stub_gpiowrite_byte_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 3, 1 },
- { 0, 2 }
+ { 0, 3 }
};
const ProtobufCMessageDescriptor stub_gpiowrite_byte_response__descriptor =
{
@@ -97,10 +109,10 @@ const ProtobufCMessageDescriptor stub_gpiowrite_byte_response__descriptor =
"StubGPIOWriteByteResponse",
"",
sizeof(StubGPIOWriteByteResponse),
- 2,
+ 3,
stub_gpiowrite_byte_response__field_descriptors,
stub_gpiowrite_byte_response__field_indices_by_name,
- 2, stub_gpiowrite_byte_response__number_ranges,
+ 1, stub_gpiowrite_byte_response__number_ranges,
(ProtobufCMessageInit) stub_gpiowrite_byte_response__init,
NULL,NULL,NULL /* reserved[123] */
};
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.h
index f02ec9254..6995dbc15 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubGPIOWriteByteResponse.pb-c.h
@@ -31,14 +31,18 @@ struct _StubGPIOWriteByteResponse
*/
char *portid;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- uint32_t status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_GPIOWRITE_BYTE_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_gpiowrite_byte_response__descriptor) \
- , NULL, 0, 0 }
+ , NULL, NULL, 0, 0 }
/* StubGPIOWriteByteResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.c
index 83586b8da..f45ed51b6 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_heater_response__free_unpacked
assert(message->base.descriptor == &stub_heater_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_heater_response__field_descriptors[3] =
+static const ProtobufCFieldDescriptor stub_heater_response__field_descriptors[4] =
{
{
"HeaterGroupId",
@@ -82,24 +82,37 @@ static const ProtobufCFieldDescriptor stub_heater_response__field_descriptors[3]
"Status",
3,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BOOL,
- offsetof(StubHeaterResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubHeaterResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubHeaterResponse, has_statusword),
+ offsetof(StubHeaterResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_heater_response__field_indices_by_name[] = {
0, /* field[0] = HeaterGroupId */
1, /* field[1] = HeaterTemperatureSensor */
2, /* field[2] = Status */
+ 3, /* field[3] = StatusWord */
};
static const ProtobufCIntRange stub_heater_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 3 }
+ { 0, 4 }
};
const ProtobufCMessageDescriptor stub_heater_response__descriptor =
{
@@ -109,7 +122,7 @@ const ProtobufCMessageDescriptor stub_heater_response__descriptor =
"StubHeaterResponse",
"",
sizeof(StubHeaterResponse),
- 3,
+ 4,
stub_heater_response__field_descriptors,
stub_heater_response__field_indices_by_name,
1, stub_heater_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.h
index c7b2d08d2..fd37a5ae7 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubHeaterResponse.pb-c.h
@@ -34,14 +34,18 @@ struct _StubHeaterResponse
protobuf_c_boolean has_heatertemperaturesensor;
uint32_t heatertemperaturesensor;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- protobuf_c_boolean status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_HEATER_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_heater_response__descriptor) \
- , 0, 0, 0, 0, 0, 0 }
+ , 0, 0, 0, 0, NULL, 0, 0 }
/* StubHeaterResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.c
index c5eac4915..5204790a0 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_motor_encoder_response__free_unpacked
assert(message->base.descriptor == &stub_motor_encoder_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_motor_encoder_response__field_descriptors[5] =
+static const ProtobufCFieldDescriptor stub_motor_encoder_response__field_descriptors[6] =
{
{
"EncoderId",
@@ -106,14 +106,26 @@ static const ProtobufCFieldDescriptor stub_motor_encoder_response__field_descrip
"Status",
5,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BOOL,
- offsetof(StubMotorEncoderResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubMotorEncoderResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 6,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubMotorEncoderResponse, has_statusword),
+ offsetof(StubMotorEncoderResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_motor_encoder_response__field_indices_by_name[] = {
0, /* field[0] = EncoderId */
@@ -121,11 +133,12 @@ static const unsigned stub_motor_encoder_response__field_indices_by_name[] = {
3, /* field[3] = MotorDirection */
2, /* field[2] = MotorSpeed */
4, /* field[4] = Status */
+ 5, /* field[5] = StatusWord */
};
static const ProtobufCIntRange stub_motor_encoder_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 5 }
+ { 0, 6 }
};
const ProtobufCMessageDescriptor stub_motor_encoder_response__descriptor =
{
@@ -135,7 +148,7 @@ const ProtobufCMessageDescriptor stub_motor_encoder_response__descriptor =
"StubMotorEncoderResponse",
"",
sizeof(StubMotorEncoderResponse),
- 5,
+ 6,
stub_motor_encoder_response__field_descriptors,
stub_motor_encoder_response__field_indices_by_name,
1, stub_motor_encoder_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.h
index cff4adfa4..d1e150306 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorEncoderResponse.pb-c.h
@@ -41,14 +41,18 @@ struct _StubMotorEncoderResponse
protobuf_c_boolean has_motordirection;
protobuf_c_boolean motordirection;
/*
- * 0-OK 1-Failed ( motion control error > ?)
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- protobuf_c_boolean status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_MOTOR_ENCODER_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_motor_encoder_response__descriptor) \
- , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+ , 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0 }
/* StubMotorEncoderResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.c
index a14fd9720..1f8445842 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_opt_limit_switch_response__free_unpacked
assert(message->base.descriptor == &stub_opt_limit_switch_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_opt_limit_switch_response__field_descriptors[3] =
+static const ProtobufCFieldDescriptor stub_opt_limit_switch_response__field_descriptors[4] =
{
{
"LimitSwitchrId",
@@ -82,24 +82,37 @@ static const ProtobufCFieldDescriptor stub_opt_limit_switch_response__field_desc
"Status",
3,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BOOL,
- offsetof(StubOptLimitSwitchResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubOptLimitSwitchResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubOptLimitSwitchResponse, has_statusword),
+ offsetof(StubOptLimitSwitchResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_opt_limit_switch_response__field_indices_by_name[] = {
1, /* field[1] = LimitSwitchDitection */
0, /* field[0] = LimitSwitchrId */
2, /* field[2] = Status */
+ 3, /* field[3] = StatusWord */
};
static const ProtobufCIntRange stub_opt_limit_switch_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 3 }
+ { 0, 4 }
};
const ProtobufCMessageDescriptor stub_opt_limit_switch_response__descriptor =
{
@@ -109,7 +122,7 @@ const ProtobufCMessageDescriptor stub_opt_limit_switch_response__descriptor =
"StubOptLimitSwitchResponse",
"",
sizeof(StubOptLimitSwitchResponse),
- 3,
+ 4,
stub_opt_limit_switch_response__field_descriptors,
stub_opt_limit_switch_response__field_indices_by_name,
1, stub_opt_limit_switch_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.h
index 61656ccde..74ebe93d8 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubOptLimitSwitchResponse.pb-c.h
@@ -36,14 +36,18 @@ struct _StubOptLimitSwitchResponse
protobuf_c_boolean has_limitswitchditection;
protobuf_c_boolean limitswitchditection;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- protobuf_c_boolean status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_OPT_LIMIT_SWITCH_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_opt_limit_switch_response__descriptor) \
- , 0, 0, 0, 0, 0, 0 }
+ , 0, 0, 0, 0, NULL, 0, 0 }
/* StubOptLimitSwitchResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.c
index 994bcda15..1d13edf23 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.c
@@ -52,7 +52,7 @@ void stub_steper_motor_response__free_unpacked
assert(message->base.descriptor == &stub_steper_motor_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_steper_motor_response__field_descriptors[3] =
+static const ProtobufCFieldDescriptor stub_steper_motor_response__field_descriptors[4] =
{
{
"MotorId",
@@ -82,24 +82,37 @@ static const ProtobufCFieldDescriptor stub_steper_motor_response__field_descript
"Status",
3,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BOOL,
- offsetof(StubSteperMotorResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubSteperMotorResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 4,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubSteperMotorResponse, has_statusword),
+ offsetof(StubSteperMotorResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_steper_motor_response__field_indices_by_name[] = {
0, /* field[0] = MotorId */
1, /* field[1] = MotorVersion */
2, /* field[2] = Status */
+ 3, /* field[3] = StatusWord */
};
static const ProtobufCIntRange stub_steper_motor_response__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 3 }
+ { 0, 4 }
};
const ProtobufCMessageDescriptor stub_steper_motor_response__descriptor =
{
@@ -109,7 +122,7 @@ const ProtobufCMessageDescriptor stub_steper_motor_response__descriptor =
"StubSteperMotorResponse",
"",
sizeof(StubSteperMotorResponse),
- 3,
+ 4,
stub_steper_motor_response__field_descriptors,
stub_steper_motor_response__field_indices_by_name,
1, stub_steper_motor_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.h
index 978fb8b2c..fbe1f63ef 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubSteperMotorResponse.pb-c.h
@@ -36,14 +36,18 @@ struct _StubSteperMotorResponse
protobuf_c_boolean has_motorversion;
uint32_t motorversion;
/*
- * 0-OK 1-Failed
+ * Passed / Failed
*/
- protobuf_c_boolean has_status;
- protobuf_c_boolean status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_STEPER_MOTOR_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_steper_motor_response__descriptor) \
- , 0, 0, 0, 0, 0, 0 }
+ , 0, 0, 0, 0, NULL, 0, 0 }
/* StubSteperMotorResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.c
index 4fbed304f..4556cc4d2 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.c
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.c
@@ -52,28 +52,41 @@ void stub_valve_response__free_unpacked
assert(message->base.descriptor == &stub_valve_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
-static const ProtobufCFieldDescriptor stub_valve_response__field_descriptors[1] =
+static const ProtobufCFieldDescriptor stub_valve_response__field_descriptors[2] =
{
{
"Status",
- 3,
+ 1,
PROTOBUF_C_LABEL_OPTIONAL,
- PROTOBUF_C_TYPE_BOOL,
- offsetof(StubValveResponse, has_status),
+ PROTOBUF_C_TYPE_STRING,
+ 0, /* quantifier_offset */
offsetof(StubValveResponse, status),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "StatusWord",
+ 2,
+ PROTOBUF_C_LABEL_OPTIONAL,
+ PROTOBUF_C_TYPE_UINT32,
+ offsetof(StubValveResponse, has_statusword),
+ offsetof(StubValveResponse, statusword),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned stub_valve_response__field_indices_by_name[] = {
0, /* field[0] = Status */
+ 1, /* field[1] = StatusWord */
};
static const ProtobufCIntRange stub_valve_response__number_ranges[1 + 1] =
{
- { 3, 0 },
- { 0, 1 }
+ { 1, 0 },
+ { 0, 2 }
};
const ProtobufCMessageDescriptor stub_valve_response__descriptor =
{
@@ -83,7 +96,7 @@ const ProtobufCMessageDescriptor stub_valve_response__descriptor =
"StubValveResponse",
"",
sizeof(StubValveResponse),
- 1,
+ 2,
stub_valve_response__field_descriptors,
stub_valve_response__field_indices_by_name,
1, stub_valve_response__number_ranges,
diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.h
index 1949b4602..3b1512450 100644
--- a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.h
+++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubValveResponse.pb-c.h
@@ -27,14 +27,18 @@ struct _StubValveResponse
{
ProtobufCMessage base;
/*
- * 0-OK 1-Failed
+ * Passed/Failed
*/
- protobuf_c_boolean has_status;
- protobuf_c_boolean status;
+ char *status;
+ /*
+ * Error number/bit when the status is Failed
+ */
+ protobuf_c_boolean has_statusword;
+ uint32_t statusword;
};
#define STUB_VALVE_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&stub_valve_response__descriptor) \
- , 0, 0 }
+ , NULL, 0, 0 }
/* StubValveResponse methods */
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Container.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Container.c
index 823ecb71a..570ead28f 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Container.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Container.c
@@ -24,6 +24,7 @@
#include "Stub_OptLimitSwitch.h"
#include "Stub_SteperMotor.h"
#include "Stub_Valve.h"
+#include "Stub_ExtFlash.h"
MessageContainer createContainer(MessageType type, char* token, protobuf_c_boolean completed, void* response, size_t (*packPtr)(void*, uint8_t*), size_t (*sizePtr)(void*))
{
@@ -106,6 +107,12 @@ void receive_callback(char* buffer, size_t length)
case MESSAGE_TYPE__StubValveRequest:
Stub_ValveRequest(requestContainer);
break;
+ case MESSAGE_TYPE__StubExtFlashReadRequest:
+ Stub_ExtFlashReadRequest(requestContainer);
+ break;
+ case MESSAGE_TYPE__StubExtFlashWriteRequest:
+ Stub_ExtFlashWriteRequest(requestContainer);
+ break;
default:
//unsupported message type !!
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/DataDef.h b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/DataDef.h
index 12daba274..08da87c09 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/DataDef.h
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/DataDef.h
@@ -7,9 +7,16 @@
#define ON 1
#define OFF 0
+enum
+{
+ PASSED = 0,
+ FAILED = 1,
+ NOT_SUPPORTED = 254,
+ VERIFIED = 255
+};
+
+
#define OK 0
-#define PASSED 0
-#define FAIL 1
#define ERROR 1
#define ENABLE 0
@@ -34,6 +41,10 @@
#define PULLDOWN 0
#define PULLUP 1
+#define TX 0
+#define RX 1
+#define TXRX 2
+
//---------------------------------------------------------------------
#pragma diag_suppress 169 /* Avoid warnings on VOID * conversions (protobuf issue)
The warning:
@@ -52,6 +63,9 @@ Supports diagnostic <id> (--diag_suppress, - pds)
190
*/
+//Project Properties->Build->Compiler->Include Options
+//There may be paths there relative to a build variable, rather than hard-coded paths, that may be triggering the error.
+
#endif /* DATADEF_H */
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Cartridge.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Cartridge.c
index 721425a6c..e97831e67 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Cartridge.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Cartridge.c
@@ -22,12 +22,12 @@
#include "StubCartridgeWriteResponse.pb-c.h"
#include "StubCartridgeWriteRequest.pb-c.h"
-
-
#include "Container.h"
+#include "Stub_Status.h"
void Stub_CartridgeReadRequest(MessageContainer* requestContainer)
{
+ uint32_t status = NOT_SUPPORTED;
MessageContainer responseContainer;
StubCartridgeReadRequest* request = stub_cartridge_read_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -55,8 +55,7 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer)
//response.cartridgeused
response.has_cartridgeused = false;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -70,7 +69,8 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.cartridgeused);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeReadResponse, requestContainer->token, true, &response, &stub_cartridge_read_response__pack, &stub_cartridge_read_response__get_packed_size);
@@ -84,6 +84,7 @@ void Stub_CartridgeReadRequest(MessageContainer* requestContainer)
void Stub_CartridgeWriteRequest(MessageContainer* requestContainer)
{
+ uint32_t status = NOT_SUPPORTED;
MessageContainer responseContainer;
StubCartridgeWriteRequest* request = stub_cartridge_write_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -111,14 +112,19 @@ void Stub_CartridgeWriteRequest(MessageContainer* requestContainer)
response.cartridgeid = request->cartridgeid;
response.has_cartridgeid = true;
- response.status = OK;
- response.has_status = true;
+// char temp[7] = "PASSED";
+// response.status = temp;
+// response.statusword = OK;
+// response.has_statusword = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
writeFloat(response.cartridgeid);
writeString(", ");
- writeFloat(response.status);
+// writeFloat(response.statusword);
+// WRITELINESTATUS;
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubCartridgeWriteResponse, requestContainer->token, true, &response, &stub_cartridge_write_response__pack, &stub_cartridge_write_response__get_packed_size);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Dispenser.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Dispenser.c
index a9adb4116..bb2ceaea9 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Dispenser.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Dispenser.c
@@ -21,9 +21,11 @@
#include "StubDispenserRequest.pb-c.h"
#include "Container.h"
+#include "Stub_Status.h"
void Stub_DispenserRequest(MessageContainer* requestContainer)
{
+ uint32_t status = NOT_SUPPORTED;
MessageContainer responseContainer;
StubDispenserRequest* request = stub_dispenser_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -57,8 +59,7 @@ void Stub_DispenserRequest(MessageContainer* requestContainer)
//response.inkworninglevel
response.has_inkworninglevel = false;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -68,7 +69,8 @@ void Stub_DispenserRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.inkworninglevel);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubDispenserResponse, requestContainer->token, true, &response, &stub_dispenser_response__pack, &stub_dispenser_response__get_packed_size);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.c
new file mode 100644
index 000000000..c7ef4aaa8
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.c
@@ -0,0 +1,163 @@
+
+#include <drivers/Flash_Memory/Flash_Memory.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <string.h>
+#include <Stubs_Handler/DataDef.h>
+#include "inc/hw_memmap.h"
+#include "inc/hw_types.h"
+#include "inc/hw_uart.h"
+#include "driverlib/gpio.h"
+
+#include "usb_serial_adapter.h"
+#include "graphics_adapter.h"
+
+#include "MessageContainer.pb-c.h"
+
+#include "StubExtFlashWriteRequest.pb-c.h"
+#include "StubExtFlashWriteResponse.pb-c.h"
+
+#include "StubExtFlashReadRequest.pb-c.h"
+#include "StubExtFlashReadResponse.pb-c.h"
+
+#include "Container.h"
+#include "Stub_Status.h"
+
+
+#define Max_words 5
+
+
+void Stub_ExtFlashWriteRequest(MessageContainer* requestContainer)
+{
+
+ uint32_t WriteBuf[5];
+ uint32_t status = PASSED;
+
+ MessageContainer responseContainer;
+
+ StubExtFlashWriteRequest* request = stub_ext_flash_write_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
+
+
+ WriteBuf[0] = request->wordtowrite1;
+ WriteBuf[1] = request->wordtowrite2;
+ WriteBuf[2] = request->wordtowrite3;
+ WriteBuf[3] = request->wordtowrite4;
+ WriteBuf[4] = request->wordtowrite5;
+
+ writeLine("ExtFlash Request: ");
+ writeFloat(request->wordtowrite1);
+ writeString(", ");
+ writeFloat(request->wordtowrite2);
+ writeString(", ");
+ writeFloat(request->wordtowrite3);
+ writeString(", ");
+ writeFloat(request->wordtowrite4);
+ writeString(", ");
+ writeFloat(request->wordtowrite5);
+
+ Ext_Flash_Operation(TX, Max_words, WriteBuf, NULL );
+
+ StubExtFlashWriteResponse response = STUB_EXT_FLASH_WRITE_RESPONSE__INIT;
+
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
+
+ responseContainer = createContainer(MESSAGE_TYPE__StubExtFlashWriteResponse, requestContainer->token, true, &response, &stub_ext_flash_write_response__pack, &stub_ext_flash_write_response__get_packed_size);
+
+ writeLine("Sending Response: ");
+
+ Write_status_response(status);
+
+ free(request);
+ //-------------------------------------------------------------------------------------------
+ uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer));
+ size_t container_size = message_container__pack(&responseContainer, container_buffer);
+ SendChars((char*)container_buffer, container_size);
+ free(container_buffer);
+ free(requestContainer);
+
+}
+
+void Stub_ExtFlashReadRequest(MessageContainer* requestContainer)
+{
+ uint32_t status = PASSED;
+ MessageContainer responseContainer;
+
+ StubExtFlashReadRequest* request = stub_ext_flash_read_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
+
+ uint32_t No_Words;
+ uint32_t ReadBuf[Max_words];
+
+ if(request->number_of_words>Max_words)
+ {
+ No_Words = Max_words;
+ }
+ else
+ {
+ No_Words = request->number_of_words;
+ }
+
+ Ext_Flash_Operation(RX, No_Words, NULL, ReadBuf );
+
+ writeLine("ExtFlash Request: ");
+ writeFloat(request->number_of_words);
+
+
+ StubExtFlashReadResponse response = STUB_EXT_FLASH_READ_RESPONSE__INIT;
+
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
+
+ response.has_readword_5 = false;
+ response.has_readword_4 = false;
+ response.has_readword_3 = false;
+ response.has_readword_2 = false;
+ response.has_readword_1 = false;
+
+ switch(No_Words)
+ {
+ case 5:
+ response.readword_5 = ReadBuf[4];
+ response.has_readword_5 = true;
+ case 4:
+ response.readword_4 = ReadBuf[3];
+ response.has_readword_4 = true;
+ case 3:
+ response.readword_3 = ReadBuf[2];
+ response.has_readword_3 = true;
+ case 2:
+ response.readword_2 = ReadBuf[1];
+ response.has_readword_2 = true;
+ case 1:
+ response.readword_1 = ReadBuf[0];
+ response.has_readword_1 = true;
+ break;
+ default:
+ break;
+ }
+
+ responseContainer = createContainer(MESSAGE_TYPE__StubExtFlashReadResponse, requestContainer->token, true, &response, &stub_ext_flash_read_response__pack, &stub_ext_flash_read_response__get_packed_size);
+ //clear();
+ writeLine("Sending Response: ");
+
+ Write_status_response(status);
+ writeString(", ");
+ writeFloat(response.readword_1);
+ writeString(", ");
+ writeFloat(response.readword_2);
+ writeString(", ");
+ writeFloat(response.readword_3);
+ writeString(", ");
+ writeFloat(response.readword_4);
+ writeString(", ");
+ writeFloat(response.readword_5);
+
+ free(request);
+ //-------------------------------------------------------------------------------------------
+ uint8_t* container_buffer = malloc(message_container__get_packed_size(&responseContainer));
+ size_t container_size = message_container__pack(&responseContainer, container_buffer);
+ SendChars((char*)container_buffer, container_size);
+ free(container_buffer);
+ free(requestContainer);
+}
+
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.h b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.h
new file mode 100644
index 000000000..35fc78f85
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_ExtFlash.h
@@ -0,0 +1,8 @@
+#ifndef STUB_EXTFLASH_H
+#define STUB_EXTFLASH_H
+
+void Stub_ExtFlashWriteRequest(MessageContainer* requestContainer);
+void Stub_ExtFlashReadRequest(MessageContainer* requestContainer);
+
+#endif //STUB_EXTFLASH_H
+
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_GPIO.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_GPIO.c
index a13293336..0d0896517 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_GPIO.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_GPIO.c
@@ -34,8 +34,11 @@
#include "Container.h"
#include <Stubs_Handler/User_Leds.h>
+#include "Stub_Status.h"
+
void Stub_GPIOWriteBitRequest(MessageContainer* requestContainer)
{
+ uint32_t status = FAILED;
MessageContainer responseContainer;
StubGPIOWriteBitRequest* request = stub_gpiowrite_bit_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -189,21 +192,33 @@ void Stub_GPIOWriteBitRequest(MessageContainer* requestContainer)
StubGPIOWriteBitResponse response = STUB_GPIOWRITE_BIT_RESPONSE__INIT;
response.portid = request->portid;
- //response.has_portid = true;
response.pinid = request->pinid;
response.has_pinid = true;
-
- response.status = OK;
- response.has_status = true;
+
+ //Verify Writing
+ if(request->bittowrite)
+ {
+ if(ROM_GPIOPinRead(PortId, PinId) == PinId)
+ status = VERIFIED;
+ }
+ else
+ {
+ if(ROM_GPIOPinRead(PortId, PinId) == 0)
+ status = VERIFIED;
+ }
+
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
writeString(response.portid);
- writeString(", ");
- writeFloat(response.pinid);
- writeString(", ");
- writeFloat(response.status);
+ writeString(", ");
+ writeFloat(response.pinid);
+ writeString(", ");
+
+ Write_status_response(status);
+
responseContainer = createContainer(MESSAGE_TYPE__StubGPIOWriteBitResponse, requestContainer->token, true, &response, &stub_gpiowrite_bit_response__pack, &stub_gpiowrite_bit_response__get_packed_size);
@@ -218,6 +233,7 @@ void Stub_GPIOWriteBitRequest(MessageContainer* requestContainer)
//
void Stub_GPIOReadByteRequest(MessageContainer* requestContainer)
{
+ uint32_t status = PASSED;
MessageContainer responseContainer;
StubGPIOReadByteRequest* request = stub_gpioread_byte_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -330,8 +346,7 @@ void Stub_GPIOReadByteRequest(MessageContainer* requestContainer)
response.bytevalue = temp;
response.has_bytevalue = true;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -339,7 +354,8 @@ void Stub_GPIOReadByteRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.bytevalue);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubGPIOReadByteResponse, requestContainer->token, true, &response, &stub_gpioread_byte_response__pack, &stub_gpioread_byte_response__get_packed_size);
@@ -354,6 +370,7 @@ void Stub_GPIOReadByteRequest(MessageContainer* requestContainer)
void Stub_GPIOReadBitRequest(MessageContainer* requestContainer)
{
+ uint32_t status = PASSED;
MessageContainer responseContainer;
StubGPIOReadBitRequest* request = stub_gpioread_bit_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -525,8 +542,7 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer)
response.bitvalue = temp;
response.has_bitvalue = true;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -536,7 +552,8 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.bitvalue);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubGPIOReadBitResponse, requestContainer->token, true, &response, &stub_gpioread_bit_response__pack, &stub_gpioread_bit_response__get_packed_size);
@@ -583,6 +600,7 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer)
writeFloat(response.bitvalue);
writeString(", ");
writeFloat(response.status);
+ WRITELINESTATUS;
responseContainer = createContainer(MESSAGE_TYPE__StubGPIOReadBitResponse, requestContainer->token, true, &response, &stub_gpioread_bit_response__pack, &stub_gpioread_bit_response__get_packed_size);
*/
@@ -598,6 +616,7 @@ void Stub_GPIOReadBitRequest(MessageContainer* requestContainer)
void Stub_GPIOWriteByteRequest(MessageContainer* requestContainer)
{
+ uint32_t status = FAILED;
MessageContainer responseContainer;
StubGPIOWriteByteRequest* request = stub_gpiowrite_byte_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -713,12 +732,19 @@ void Stub_GPIOWriteByteRequest(MessageContainer* requestContainer)
response.portid = request->portid;
- response.status = OK;
- response.has_status = true;
+ //Verify writing
+ if(ROM_GPIOPinRead(PortId, GPIO_BYTE) == request->datatowrite)
+ {
+ status = VERIFIED;
+ }
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
writeString(response.portid);
+ writeString(", ");
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubGPIOWriteByteResponse, requestContainer->token, true, &response, &stub_gpiowrite_byte_response__pack, &stub_gpiowrite_byte_response__get_packed_size);
@@ -734,6 +760,7 @@ void Stub_GPIOWriteByteRequest(MessageContainer* requestContainer)
void Stub_GPIOInputSetupRequest(MessageContainer* requestContainer)
{
+ uint32_t status = PASSED;
MessageContainer responseContainer;
StubGPIOInputSetupRequest* request = stub_gpioinput_setup_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -903,8 +930,7 @@ void Stub_GPIOInputSetupRequest(MessageContainer* requestContainer)
response.pinid = request->pinid;
response.has_pinid = true;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -912,7 +938,8 @@ void Stub_GPIOInputSetupRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.pinid);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubGPIOInputSetupResponse, requestContainer->token, true, &response, &stub_gpioinput_setup_response__pack, &stub_gpioinput_setup_response__get_packed_size);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Heater.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Heater.c
index de6aea470..38193f180 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Heater.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Heater.c
@@ -21,9 +21,11 @@
#include "StubHeaterRequest.pb-c.h"
#include "Container.h"
+#include "Stub_Status.h"
void Stub_HeaterRequest(MessageContainer* requestContainer)
{
+ uint32_t status = NOT_SUPPORTED;
MessageContainer responseContainer;
StubHeaterRequest* request = stub_heater_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -50,8 +52,7 @@ void Stub_HeaterRequest(MessageContainer* requestContainer)
//response.heatertemperaturesensor
response.has_heatertemperaturesensor = false;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -59,7 +60,8 @@ void Stub_HeaterRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.heatertemperaturesensor);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubHeaterResponse, requestContainer->token, true, &response, &stub_heater_response__pack, &stub_heater_response__get_packed_size);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_MotorEncoder.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_MotorEncoder.c
index 5ddc8ce3b..9380ec65f 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_MotorEncoder.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_MotorEncoder.c
@@ -20,9 +20,11 @@
#include "StubMotorEncoderRequest.pb-c.h"
#include "Container.h"
+#include "Stub_Status.h"
void Stub_MotorEncoderRequest(MessageContainer* requestContainer)
{
+ uint32_t status = NOT_SUPPORTED;
MessageContainer responseContainer;
StubMotorEncoderRequest* request = stub_motor_encoder_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -57,9 +59,8 @@ void Stub_MotorEncoderRequest(MessageContainer* requestContainer)
response.motordirection = CW;
response.has_motordirection = true;
-
- response.status = OK;
- response.has_status = true;
+
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -71,7 +72,8 @@ void Stub_MotorEncoderRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.motordirection);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubMotorEncoderResponse, requestContainer->token, true, &response, &stub_motor_encoder_response__pack, &stub_motor_encoder_response__get_packed_size);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_OptLimitSwitch.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_OptLimitSwitch.c
index 70e79000f..c7064b0ea 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_OptLimitSwitch.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_OptLimitSwitch.c
@@ -21,9 +21,12 @@
#include "StubOptLimitSwitchRequest.pb-c.h"
#include "Container.h"
+#include "Stub_Status.h"
void Stub_OptLimitSwitchRequest(MessageContainer* requestContainer)
{
+ uint32_t status = NOT_SUPPORTED;
+
MessageContainer responseContainer;
StubOptLimitSwitchRequest* request = stub_opt_limit_switch_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -47,8 +50,7 @@ void Stub_OptLimitSwitchRequest(MessageContainer* requestContainer)
//response.limitswitchditection = 2;
response.has_limitswitchditection = false;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -56,7 +58,8 @@ void Stub_OptLimitSwitchRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.limitswitchditection);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubOptLimitSwitchResponse, requestContainer->token, true, &response, &stub_opt_limit_switch_response__pack, &stub_opt_limit_switch_response__get_packed_size);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.c
new file mode 100644
index 000000000..ae9bc1b15
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.c
@@ -0,0 +1,57 @@
+
+#include <graphics_adapter.h>
+#include <protobuf-c.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include "Stub_Status.h"
+#include <Stubs_Handler/DataDef.h>
+
+int status_response(uint32_t Rstatus,char *status[20],uint32_t *statusword ,protobuf_c_boolean *has_statusword)
+{
+ if(Rstatus==PASSED)
+ {
+ *status = "PASSED";
+ *has_statusword = false;
+ }
+ else if(Rstatus==VERIFIED)
+ {
+ *status = "PASSED (VERIFIED)";
+ *has_statusword = false;
+ }
+ else if(Rstatus==NOT_SUPPORTED)
+ {
+ *status = "NOT_SUPPORTED";
+ *statusword = Rstatus;
+ *has_statusword = false;
+ }
+ else
+ {
+ *status = "FAILED";
+ *statusword = Rstatus;
+ *has_statusword = true;
+ }
+ return 0;
+}
+
+int Write_status_response(uint32_t Rstatus)
+{
+ writeFloat(Rstatus);
+
+ if(Rstatus==PASSED)
+ {
+ writeLine("PASSED");
+ }
+ else if(Rstatus==VERIFIED)
+ {
+ writeLine("PASSED (VERIFIED)");
+ }
+ else if(Rstatus==NOT_SUPPORTED)
+ {
+ writeLine("NOT_SUPPORTED");
+ }
+ else
+ {
+ writeLine("FAILED");
+ }
+ return 0;
+}
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.h b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.h
new file mode 100644
index 000000000..c2ff1b7e5
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Status.h
@@ -0,0 +1,3 @@
+
+int status_response(uint32_t Rstatus,char *status[8],uint32_t *statusword ,protobuf_c_boolean *has_statusword);
+int Write_status_response(uint32_t Rstatus);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_SteperMotor.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_SteperMotor.c
index 4f53b71ce..47ff8a0d5 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_SteperMotor.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_SteperMotor.c
@@ -21,9 +21,11 @@
#include "StubSteperMotorResponse.pb-c.h"
#include "Container.h"
+#include "Stub_Status.h"
void Stub_SteperMotorRequest(MessageContainer* requestContainer)
{
+ uint32_t status = NOT_SUPPORTED;
MessageContainer responseContainer;
StubSteperMotorRequest* request = stub_steper_motor_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -56,8 +58,7 @@ void Stub_SteperMotorRequest(MessageContainer* requestContainer)
response.motorversion = 123;
response.has_motorversion = true;
- response.status = OK;
- response.has_status = true;
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
writeLine("Sending Response: ");
@@ -65,7 +66,8 @@ void Stub_SteperMotorRequest(MessageContainer* requestContainer)
writeString(", ");
writeFloat(response.motorversion);
writeString(", ");
- writeFloat(response.status);
+
+ Write_status_response(status);
responseContainer = createContainer(MESSAGE_TYPE__StubSteperMotorResponse, requestContainer->token, true, &response, &stub_steper_motor_response__pack, &stub_steper_motor_response__get_packed_size);
diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Valve.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Valve.c
index beaa1c098..08c74611c 100644
--- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Valve.c
+++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Valve.c
@@ -21,9 +21,12 @@
#include "Container.h"
+#include "Stub_Status.h"
+
void Stub_ValveRequest(MessageContainer* requestContainer)
{
MessageContainer responseContainer;
+ uint32_t status = NOT_SUPPORTED;
StubValveRequest* request = stub_valve_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -40,16 +43,14 @@ void Stub_ValveRequest(MessageContainer* requestContainer)
writeFloat(request->valveon);
StubValveResponse response = STUB_VALVE_RESPONSE__INIT;
-
- response.status = OK;
- response.has_status = true;
-
+ status_response(status,&response.status, &response.statusword ,&response.has_statusword);
responseContainer = createContainer(MESSAGE_TYPE__StubValveResponse, requestContainer->token, true, &response, &stub_valve_response__pack, &stub_valve_response__get_packed_size);
writeLine("Sending Response: ");
- writeFloat(response.status);
+
+ Write_status_response(status);
free(request);
//-------------------------------------------------------------------------------------------
diff --git a/Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.c b/Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.c
new file mode 100644
index 000000000..b5f6fd8cb
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.c
@@ -0,0 +1,488 @@
+//Avi Last update: 20/12/17
+//Based on TM4C129_SSI3_MacronixFlash.c
+//On board Quad SPI 512Mb Flash
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdbool.h>
+#include "inc/hw_memmap.h"
+#include "inc/hw_types.h"
+#include "inc/hw_gpio.h"
+#include "inc/hw_ssi.h"
+#include "inc/hw_sysctl.h"
+#include "inc/hw_epi.h"
+#include "inc/hw_ints.h"
+#include "inc/hw_nvic.h"
+
+#include "driverlib/debug.h"
+#include "driverlib/fpu.h"
+#include "driverlib/gpio.h"
+#include "driverlib/rom.h"
+#include "driverlib/rom_map.h"
+#include "driverlib/interrupt.h"
+#include "driverlib/pin_map.h"
+#include "driverlib/sysctl.h"
+#include "driverlib/ssi.h"
+#include "driverlib/uart.h"
+#include "utils/uartstdio.h"
+
+#include "graphics_adapter.h"
+#include <Stubs_Handler/DataDef.h>
+
+//#define NUM_SSI_DATA 20
+#define INS_WRITE_ENABLE 0x06
+#define INS_READ_STATUS_REGISTER1 0x05
+#define DUMMY_BYTE 0x00
+#define FLASH_BUSY_BIT 0x01
+#define FLASH_WRITE_EN_LATCH_BIT 0x02
+#define INS_SECTOR_ERASE_4KB 0x20
+#define INS_PAGE_PROGRAM 0x02
+#define INS_READ_DATA 0x03
+
+
+uint8_t g_ui8InstrReadID[] = {0x90,0x00,0x00,0x00};
+//uint32_t pui32DataTx[NUM_SSI_DATA];
+//uint32_t pui32DataRx[NUM_SSI_DATA];
+
+//*****************************************************************************
+//
+// This function sets up SSI External Flash ID Read
+//
+//*****************************************************************************
+uint32_t SSILibSendReadIDAdvMode(uint32_t ui32Base)
+{
+ uint32_t ui32Idx, ui32Receive;
+ uint32_t ui32MfgID;
+ uint32_t ui32DevID;
+ uint32_t ui32ReadID[]={0xaa,0xaa};
+ uint32_t ui32ReadIDFlash;
+
+ for(ui32Idx = 0; ui32Idx < sizeof(g_ui8InstrReadID) / sizeof(g_ui8InstrReadID[0]); ui32Idx++)
+ {
+ SSIDataPut(ui32Base, g_ui8InstrReadID[ui32Idx]);
+ }
+
+ SSIAdvModeSet(ui32Base,SSI_ADV_MODE_READ_WRITE);
+ SSIDataPut(ui32Base, 0x00);
+ SSIDataGet(ui32Base, &ui32Receive);
+ ui32ReadID[0] = ui32Receive;
+ SSIAdvDataPutFrameEnd(ui32Base,0x00);
+ SSIDataGet(ui32Base, &ui32Receive);
+ ui32ReadID[1] = ui32Receive;
+ ui32MfgID = ui32ReadID[0];
+ ui32DevID = ui32ReadID[1];
+ ui32ReadIDFlash = ui32MfgID;
+
+ ui32ReadIDFlash = ui32ReadIDFlash << 8;
+ ui32ReadIDFlash |= ui32DevID;
+
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+
+ return ui32ReadIDFlash;
+}
+
+uint8_t SSILibSendReadStatusRegister(uint32_t ui32Base, uint8_t ui8FlashCommand)
+{
+ uint32_t ui32Status = 0;
+ uint8_t ui8FlashStatus;
+
+ SSIAdvFrameHoldEnable(ui32Base);
+ SSIDataPut(ui32Base,ui8FlashCommand);
+ SSIAdvModeSet(ui32Base,SSI_ADV_MODE_READ_WRITE);
+ SSIAdvDataPutFrameEnd(ui32Base,DUMMY_BYTE);
+ while(SSIBusy(ui32Base));
+ SSIDataGet(ui32Base, &ui32Status);
+ ui8FlashStatus = (uint8_t)ui32Status;
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+
+ return ui8FlashStatus;
+}
+
+
+void SSILibDeviceBusyCheck(uint32_t ui32Base)
+{
+ uint8_t ui8TempData=0xFF;
+
+ ui8TempData = SSILibSendReadStatusRegister(ui32Base,INS_READ_STATUS_REGISTER1);
+
+ while((ui8TempData & FLASH_BUSY_BIT) == FLASH_BUSY_BIT)
+ {
+ ui8TempData = SSILibSendReadStatusRegister(ui32Base,INS_READ_STATUS_REGISTER1);
+ }
+}
+
+void SSILibSendPageProgram(uint32_t ui32Base, uint32_t ui32Address, uint8_t ui8FlashCommand)
+{
+ uint32_t ui32TempAddr, ui32TempData;
+ uint8_t ui8AddrByte1, ui8AddrByte2, ui8AddrByte3;
+
+ ui32TempAddr = ui32Address >> 16 ;
+ ui8AddrByte1 = (uint8_t)ui32TempAddr;
+ ui32TempAddr = ui32Address >> 8 ;
+ ui8AddrByte2 = (uint8_t)ui32TempAddr;
+ ui8AddrByte3 = (uint8_t)ui32Address;
+
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+ SSIAdvFrameHoldEnable(ui32Base);
+ SSIAdvDataPutFrameEnd(ui32Base,INS_WRITE_ENABLE);
+ while(SSIBusy(ui32Base));
+
+ ui32TempData = SSILibSendReadStatusRegister(ui32Base,INS_READ_STATUS_REGISTER1);
+ while((ui32TempData & FLASH_WRITE_EN_LATCH_BIT) != FLASH_WRITE_EN_LATCH_BIT) {
+ ui32TempData = SSILibSendReadStatusRegister(ui32Base,INS_READ_STATUS_REGISTER1);
+ }
+
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+ SSIAdvFrameHoldEnable(ui32Base);
+ SSIDataPut(ui32Base,ui8FlashCommand);
+ SSIDataPut(ui32Base,ui8AddrByte1);
+ SSIDataPut(ui32Base,ui8AddrByte2);
+ SSIDataPut(ui32Base,ui8AddrByte3);
+}
+
+void SSILibSendReadDataAdvBi(uint32_t ui32Base, uint32_t ui32Address, uint8_t ui8FlashCommand)
+{
+ uint32_t ui32TempAddr;
+ uint8_t ui8AddrByte1, ui8AddrByte2, ui8AddrByte3;
+
+ ui32TempAddr = ui32Address >> 16 ;
+ ui8AddrByte1 = (uint8_t)ui32TempAddr;
+ ui32TempAddr = ui32Address >> 8 ;
+ ui8AddrByte2 = (uint8_t)ui32TempAddr;
+ ui8AddrByte3 = (uint8_t)ui32Address;
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+ SSIAdvFrameHoldEnable(ui32Base);
+ SSIDataPut(ui32Base,ui8FlashCommand);
+ SSIDataPut(ui32Base,ui8AddrByte1);
+ SSIDataPut(ui32Base,ui8AddrByte2);
+ SSIDataPut(ui32Base,ui8AddrByte3);
+
+ SSIAdvModeSet(ui32Base,SSI_ADV_MODE_READ_WRITE);
+}
+
+
+//*****************************************************************************
+//
+// This function sets up SSI External Flash Erase
+//
+//*****************************************************************************
+void SSILibSendEraseCommand (uint32_t ui32Base, uint32_t ui32Address, uint8_t ui8FlashCommand)
+{
+ uint32_t ui32TempAddr, ui32TempData;
+ uint8_t ui8AddrByte1, ui8AddrByte2, ui8AddrByte3;
+
+ ui32TempAddr = ui32Address >> 16 ;
+
+ ui8AddrByte1 = (uint8_t)ui32TempAddr;
+ ui32TempAddr = ui32Address >> 8 ;
+ ui8AddrByte2 = (uint8_t)ui32TempAddr;
+ ui8AddrByte3 = (uint8_t)ui32Address;
+
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+ SSIAdvFrameHoldEnable(ui32Base);
+ SSIAdvDataPutFrameEnd(ui32Base,INS_WRITE_ENABLE);
+ while(SSIBusy(ui32Base));
+
+ ui32TempData = SSILibSendReadStatusRegister(ui32Base,INS_READ_STATUS_REGISTER1);
+ while((ui32TempData & FLASH_WRITE_EN_LATCH_BIT) != FLASH_WRITE_EN_LATCH_BIT) {
+ ui32TempData = SSILibSendReadStatusRegister(ui32Base,INS_READ_STATUS_REGISTER1);
+ }
+
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+ SSIAdvFrameHoldEnable(ui32Base);
+ SSIDataPut(ui32Base,ui8FlashCommand);
+ SSIDataPut(ui32Base,ui8AddrByte1);
+ SSIDataPut(ui32Base,ui8AddrByte2);
+ SSIAdvDataPutFrameEnd(ui32Base,ui8AddrByte3);
+ while(SSIBusy(ui32Base));
+ //wait till the erase is completed
+ SSILibDeviceBusyCheck(ui32Base);
+
+}
+
+
+int Init_Ext_Flash()
+{
+ uint32_t pui32Dummy[1];
+ uint32_t ui32SysClockFreq;
+
+ //
+ // Set the clocking to run directly from the external crystal/oscillator.
+ // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
+ // crystal on your board.
+ //
+ ui32SysClockFreq = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
+ SYSCTL_OSC_MAIN |
+ SYSCTL_USE_PLL |
+ SYSCTL_CFG_VCO_480), 120000000);
+
+ // Display the setup on the console.
+ writeLine("SSI3 To DK-TM4C129 FLASH TRANSFER");
+
+ // The SSI3 peripheral must be enabled for use.
+ SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI3);
+
+ //
+ // For this example SSI3 is used with PortA[5:2]. The actual port and pins
+ // used may be different on your part, consult the data sheet for more
+ // information. GPIO port A needs to be enabled so these pins can be used.
+ // TODO: change this to whichever GPIO port you are using.
+ //
+ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);
+ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
+ SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
+
+ //
+ // GPIO Port F0 Pin is Locked. So Unlock and write the CR bit
+ //
+ HWREG(GPIO_PORTF_BASE+GPIO_O_LOCK) = GPIO_LOCK_KEY;
+ HWREG(GPIO_PORTF_BASE+GPIO_O_CR) |= GPIO_PIN_0;
+
+ //
+ // Configure the pin muxing for SSI3 functions on port Q0, Q1, Q2, F0,
+ // F4, F5
+ //
+ GPIOPinConfigure(GPIO_PQ0_SSI3CLK);
+ GPIOPinConfigure(GPIO_PQ1_SSI3FSS);
+ GPIOPinConfigure(GPIO_PQ2_SSI3XDAT0);
+ GPIOPinConfigure(GPIO_PF0_SSI3XDAT1);
+ GPIOPinConfigure(GPIO_PF4_SSI3XDAT2);
+ GPIOPinConfigure(GPIO_PF5_SSI3XDAT3);
+
+ //
+ // Configure the GPIO settings for the SSI pins. This function also gives
+ // control of these pins to the SSI hardware. Consult the data sheet to
+ // see which functions are allocated per pin.
+ // The pins are assigned as follows:
+ // PF5 - SSI3XDAT3
+ // PF4 - SSI3XDAT2
+ // PF0 - SSI3XDAT1
+ // PQ2 - SSI3XDAT0
+ // PQ1 - SSI3Fss
+ // PQ0 - SSI3CLK
+ // TODO: change this to select the port/pin you are using.
+ //
+ GPIOPinTypeSSI(GPIO_PORTQ_BASE, GPIO_PIN_2 | GPIO_PIN_1 |
+ GPIO_PIN_0);
+ GPIOPinTypeSSI(GPIO_PORTF_BASE, GPIO_PIN_5 | GPIO_PIN_4 |
+ GPIO_PIN_0);
+
+ //
+ // Configure and enable the SSI port for SPI master mode. Use SSI3,
+ // system clock supply, idle clock level low and active low clock in
+ // freescale SPI mode, master mode, 1MHz SSI frequency, and 8-bit data.
+ // For SPI mode, you can set the polarity of the SSI clock when the SSI
+ // unit is idle. You can also configure what clock edge you want to
+ // capture data on. Please reference the datasheet for more information on
+ // the different SPI modes.
+ //
+ SSIConfigSetExpClk(SSI3_BASE, ui32SysClockFreq, SSI_FRF_MOTO_MODE_0,
+ SSI_MODE_MASTER, 1000000, 8);
+
+ //
+ // Enable the SSI3 module.
+ //
+ SSIAdvModeSet(SSI3_BASE,SSI_ADV_MODE_WRITE);
+ SSIAdvFrameHoldEnable(SSI3_BASE);
+ SSIEnable(SSI3_BASE);
+
+ //
+ // Read any residual data from the SSI port. This makes sure the receive
+ // FIFOs are empty, so we don't read any unwanted junk. This is done here
+ // because the SPI SSI mode is full-duplex, which allows you to send and
+ // receive at the same time. The SSIDataGetNonBlocking function returns
+ // "true" when data was returned, and "false" when no data was returned.
+ // The "non-blocking" function checks if there is any data in the receive
+ // FIFO and does not "hang" if there isn't.
+ //
+ while(SSIDataGetNonBlocking(SSI3_BASE, &pui32Dummy[0]))
+ {
+ }
+
+ return 0;
+}
+
+int Init_TxBuf(uint32_t NumOfWords, uint32_t* TxBuf)
+{
+ uint32_t ui32Index;
+
+ for(ui32Index=0;ui32Index<NumOfWords;ui32Index++)
+ {
+ TxBuf[ui32Index] = rand()%256;
+ }
+
+ return 0;
+}
+
+int Init_RxBuf(uint32_t NumOfWords, uint32_t* RxBuf)
+{
+ uint32_t ui32Index;
+
+ for(ui32Index=0;ui32Index<NumOfWords;ui32Index++)
+ {
+ RxBuf[ui32Index] = 0x0;
+ }
+
+ return 0;
+}
+
+
+int Read_Ext_Flash_Device_ID()
+{
+ uint32_t ui32DeviceID;
+
+ ui32DeviceID = SSILibSendReadIDAdvMode(SSI3_BASE);
+ if(ui32DeviceID != 0xC219)
+ {
+ writeLine("No External Flash... Read Back:");
+ writeFloat(ui32DeviceID);
+ while(1);
+ }
+
+ writeLine("External Flash Detected with Device ID:");
+ writeFloat(ui32DeviceID);
+
+ return 0;
+}
+
+int Erase_Sector_before_writting_To_Ext_Flash()
+{
+ writeLine("Starting Erase Operations...");
+
+ SSILibSendEraseCommand(SSI3_BASE,0x0,INS_SECTOR_ERASE_4KB);
+
+ writeLine("Erase Completed...");
+
+ return 0;
+}
+
+int Write_Words_To_Ext_Flash(uint32_t NumOfWords, uint32_t* TxBuf)
+{
+
+ uint32_t ui32Index;
+
+ writeLine("Starting Write Operations...");
+
+ SSILibSendPageProgram(SSI3_BASE,0x0,INS_PAGE_PROGRAM);
+
+ for(ui32Index=0;ui32Index<NumOfWords-1;ui32Index++)
+ {
+ SSIDataPut(SSI3_BASE,TxBuf[ui32Index]);
+ }
+
+ SSIAdvDataPutFrameEnd(SSI3_BASE,TxBuf[NumOfWords-1]);
+
+ writeLine("Write Completed...");
+
+ return 0;
+}
+
+int Read_Words_From_Ext_Flash(uint32_t NumOfWords, uint32_t* RxBuf)
+{
+
+ uint32_t ui32Index;
+
+ writeLine("Starting Read Operations...");
+
+ SSILibSendReadDataAdvBi(SSI3_BASE,0x0,INS_READ_DATA);
+
+ for(ui32Index=0;ui32Index<NumOfWords-1;ui32Index++)
+ {
+ SSIDataPut(SSI3_BASE,DUMMY_BYTE);
+ SSIDataGet(SSI3_BASE,&RxBuf[ui32Index]);
+ }
+ SSIAdvDataPutFrameEnd(SSI3_BASE,DUMMY_BYTE);
+ SSIDataGet(SSI3_BASE,&RxBuf[NumOfWords-1]);
+
+ writeLine("Read Completed...");
+
+ return 0;
+}
+
+int Display_RX_TX_Ext_Flash_Data(uint32_t NumOfWords, uint32_t* TxBuf, uint32_t* RxBuf)
+{
+ uint32_t ui32Index;
+
+ for(ui32Index=0;ui32Index<NumOfWords;ui32Index++)
+ {
+ writeLine("#");
+ writeFloat(ui32Index);
+
+ if(TxBuf != NULL)
+ {
+ writeLine("Write: ");
+ writeFloat(TxBuf[ui32Index]);
+ }
+
+ if(RxBuf != NULL)
+ {
+ writeLine("Read: ");
+ writeFloat(RxBuf[ui32Index]);
+ }
+ }
+
+ return 0;
+}
+
+//*****************************************************************************
+//
+// Configure SSI3 in master Freescale (SPI) mode. This example will send out
+// 3 bytes of data, then wait for 3 bytes of data to come in. This will all be
+// done using the polling method.
+//
+//*****************************************************************************
+int Ext_Flash_Operation(uint32_t Operation, uint32_t NumOfWords, uint32_t* pui32DataTx, uint32_t* pui32DataRx )//main
+{
+
+/* uint32_t* pui32DataTx;
+ uint32_t* pui32DataRx;
+
+ pui32DataTx = (uint32_t*) malloc(NumOfWords*sizeof(uint32_t));
+ pui32DataRx = (uint32_t*) malloc(NumOfWords*sizeof(uint32_t));*/
+
+ Init_Ext_Flash();
+
+ // Read the DEVICE ID
+ Read_Ext_Flash_Device_ID();
+
+ if((Operation == TX) || (Operation == TXRX))
+ {
+ // --------------------------- TX ------------------------------------------
+ // Initialise the Transmit Buffer
+ //Init_TxBuf(NumOfWords, pui32DataTx);// with random numbers
+
+ // Display Data
+ Display_RX_TX_Ext_Flash_Data(NumOfWords, pui32DataTx, NULL);
+
+ // Erase the Sector before Program Operation...
+ Erase_Sector_before_writting_To_Ext_Flash();
+
+ // Write NUM_SSI_DATA words to the External Flash
+ Write_Words_To_Ext_Flash(NumOfWords, pui32DataTx);
+ }
+
+ if((Operation == RX) || (Operation == TXRX))
+ {
+ // --------------------------- RX ------------------------------------------
+
+ // Initialise the Receive Buffer
+ Init_RxBuf(NumOfWords, pui32DataRx);
+
+ // Read NUM_SSI_DATA words from the External Flash
+ Read_Words_From_Ext_Flash(NumOfWords, pui32DataRx);
+
+ if(Operation == RX)
+ {
+ // Display Data
+ Display_RX_TX_Ext_Flash_Data(NumOfWords, NULL, pui32DataRx);
+ }
+ else
+ {
+ // Display Data
+ Display_RX_TX_Ext_Flash_Data(NumOfWords, pui32DataTx, pui32DataRx);
+ }
+
+ }
+
+ return 0;
+}
diff --git a/Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.h b/Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.h
new file mode 100644
index 000000000..3271c6abb
--- /dev/null
+++ b/Software/Code_Composer/twine_usblib_demo/drivers/Flash_Memory/Flash_Memory.h
@@ -0,0 +1,6 @@
+#ifndef FLASHMEMORY_H
+#define FLASHMEMORY_H
+
+int Ext_Flash_Operation();
+
+#endif //FLASHMEMORY_H
diff --git a/Software/Code_Composer/twine_usblib_demo/main.c b/Software/Code_Composer/twine_usblib_demo/main.c
index 4f7545ea6..7ffd95043 100644
--- a/Software/Code_Composer/twine_usblib_demo/main.c
+++ b/Software/Code_Composer/twine_usblib_demo/main.c
@@ -1,3 +1,4 @@
+#include <drivers/Flash_Memory/Flash_Memory.h>
#include <protobuf-c/person-pb-c.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -41,6 +42,10 @@
#include "Stubs_Handler/Container.h"
#include "Stubs_Handler/User_Leds.h"
+#include <Stubs_Handler/DataDef.h>
+//#include "Stubs_Handler/Buzzer.h"
+
+
//*****************************************************************************
//
// The system tick rate expressed both as ticks per second and a millisecond
@@ -105,8 +110,9 @@ int main(void)
init_graphics(ui32SysClock);
clear();
- ///////////////
- //Test_3_Color_Led();
+ /////////////// tests by AVI
+ //Ext_Flash_Operation(TX,5);
+ //SoundExample();
/////////////////////
RegisterReceiveCallback(&receive_callback);