From f19e2e305d8baeafc30dde4fc0aa3fa37038869c Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Mon, 9 Apr 2018 14:24:42 +0300 Subject: Update dancer config --- .../PMR/Common/MessageType.pb-c.c | 108 ++++++------ .../PMR/Common/MessageType.pb-c.h | 4 + .../PMR/Diagnostics/EventType.pb-c.c | 18 +- .../PMR/Diagnostics/EventType.pb-c.h | 4 +- .../PMR/Hardware/HardwarePidControl.pb-c.c | 60 +++++-- .../PMR/Hardware/HardwarePidControl.pb-c.h | 34 ++-- .../PMR/Stubs/StubMotorHomeMarkRequest.pb-c.c | 105 ++++++++++++ .../PMR/Stubs/StubMotorHomeMarkRequest.pb-c.h | 77 +++++++++ .../PMR/Stubs/StubMotorHomeMarkResponse.pb-c.c | 105 ++++++++++++ .../PMR/Stubs/StubMotorHomeMarkResponse.pb-c.h | 74 +++++++++ .../PMR/Stubs/StubMotorRunStepTickRequest.pb-c.c | 118 +++++++++++++ .../PMR/Stubs/StubMotorRunStepTickRequest.pb-c.h | 76 +++++++++ .../PMR/Stubs/StubMotorRunStepTickResponse.pb-c.c | 183 +++++++++++++++++++++ .../PMR/Stubs/StubMotorRunStepTickResponse.pb-c.h | 92 +++++++++++ .../twine_usblib_demo/Stubs_Handler/Container.c | 8 + .../twine_usblib_demo/Stubs_Handler/DataDef.h | 6 + .../twine_usblib_demo/Stubs_Handler/Stub_Motor.c | 114 +++++++++++++ .../twine_usblib_demo/Stubs_Handler/Stub_Motor.h | 3 +- .../drivers/Danser_SSI/SSI_Comm.c | 50 ++++-- .../twine_usblib_demo/drivers/SPI/SPI_Comm.c | 20 +-- Software/Code_Composer/twine_usblib_demo/main.c | 2 +- 21 files changed, 1147 insertions(+), 114 deletions(-) create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.c create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.h create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.c create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.h create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.c create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.h create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.c create mode 100644 Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.h (limited to 'Software/Code_Composer') 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 78ba96d77..45ba5c5b9 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[110] = +static const ProtobufCEnumValue message_type__enum_values_by_number[114] = { { "None", "MESSAGE_TYPE__None", 0 }, { "CalculateRequest", "MESSAGE_TYPE__CalculateRequest", 3 }, @@ -74,6 +74,10 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[110] = { "StubHeatingTestPollResponse", "MESSAGE_TYPE__StubHeatingTestPollResponse", 64 }, { "StubMotorRequest", "MESSAGE_TYPE__StubMotorRequest", 65 }, { "StubMotorResponse", "MESSAGE_TYPE__StubMotorResponse", 66 }, + { "StubMotorHomeMarkRequest", "MESSAGE_TYPE__StubMotorHomeMarkRequest", 67 }, + { "StubMotorHomeMarkResponse", "MESSAGE_TYPE__StubMotorHomeMarkResponse", 68 }, + { "StubMotorRunStepTickRequest", "MESSAGE_TYPE__StubMotorRunStepTickRequest", 69 }, + { "StubMotorRunStepTickResponse", "MESSAGE_TYPE__StubMotorRunStepTickResponse", 70 }, { "ExternalBridgeUdpDiscoveryPacket", "MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket", 1000 }, { "ExternalClientLoginRequest", "MESSAGE_TYPE__ExternalClientLoginRequest", 1001 }, { "ExternalClientLoginResponse", "MESSAGE_TYPE__ExternalClientLoginResponse", 1002 }, @@ -121,52 +125,52 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[110] = { "UploadHardwareConfigurationResponse", "MESSAGE_TYPE__UploadHardwareConfigurationResponse", 5001 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 1},{1000, 65},{2000, 74},{3000, 100},{4000, 106},{5000, 108},{0, 110} +{0, 0},{3, 1},{1000, 69},{2000, 78},{3000, 104},{4000, 110},{5000, 112},{0, 114} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[110] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[114] = { - { "AbortJobRequest", 102 }, - { "AbortJobResponse", 103 }, + { "AbortJobRequest", 106 }, + { "AbortJobResponse", 107 }, { "CalculateRequest", 1 }, { "CalculateResponse", 2 }, - { "DebugLogRequest", 106 }, - { "DebugLogResponse", 107 }, - { "DirectSynchronizationRequest", 68 }, - { "DirectSynchronizationResponse", 69 }, - { "DispenserAbortHomingRequest", 84 }, - { "DispenserAbortHomingResponse", 85 }, - { "DispenserAbortJoggingRequest", 90 }, - { "DispenserAbortJoggingResponse", 91 }, - { "DispenserHomingRequest", 86 }, - { "DispenserHomingResponse", 87 }, - { "DispenserJoggingRequest", 88 }, - { "DispenserJoggingResponse", 89 }, - { "ExternalBridgeUdpDiscoveryPacket", 65 }, - { "ExternalClientLoginRequest", 66 }, - { "ExternalClientLoginResponse", 67 }, - { "JobRequest", 100 }, - { "JobResponse", 101 }, - { "KeepAliveRequest", 72 }, - { "KeepAliveResponse", 73 }, - { "MotorAbortHomingRequest", 76 }, - { "MotorAbortHomingResponse", 77 }, - { "MotorAbortJoggingRequest", 82 }, - { "MotorAbortJoggingResponse", 83 }, - { "MotorHomingRequest", 78 }, - { "MotorHomingResponse", 79 }, - { "MotorJoggingRequest", 80 }, - { "MotorJoggingResponse", 81 }, + { "DebugLogRequest", 110 }, + { "DebugLogResponse", 111 }, + { "DirectSynchronizationRequest", 72 }, + { "DirectSynchronizationResponse", 73 }, + { "DispenserAbortHomingRequest", 88 }, + { "DispenserAbortHomingResponse", 89 }, + { "DispenserAbortJoggingRequest", 94 }, + { "DispenserAbortJoggingResponse", 95 }, + { "DispenserHomingRequest", 90 }, + { "DispenserHomingResponse", 91 }, + { "DispenserJoggingRequest", 92 }, + { "DispenserJoggingResponse", 93 }, + { "ExternalBridgeUdpDiscoveryPacket", 69 }, + { "ExternalClientLoginRequest", 70 }, + { "ExternalClientLoginResponse", 71 }, + { "JobRequest", 104 }, + { "JobResponse", 105 }, + { "KeepAliveRequest", 76 }, + { "KeepAliveResponse", 77 }, + { "MotorAbortHomingRequest", 80 }, + { "MotorAbortHomingResponse", 81 }, + { "MotorAbortJoggingRequest", 86 }, + { "MotorAbortJoggingResponse", 87 }, + { "MotorHomingRequest", 82 }, + { "MotorHomingResponse", 83 }, + { "MotorJoggingRequest", 84 }, + { "MotorJoggingResponse", 85 }, { "None", 0 }, - { "OverrideDataBaseRequest", 70 }, - { "OverrideDataBaseResponse", 71 }, + { "OverrideDataBaseRequest", 74 }, + { "OverrideDataBaseResponse", 75 }, { "ProgressRequest", 3 }, { "ProgressResponse", 4 }, - { "PushDiagnosticsRequest", 74 }, - { "PushDiagnosticsResponse", 75 }, - { "SetComponentValueRequest", 98 }, - { "SetComponentValueResponse", 99 }, - { "SetDigitalOutRequest", 92 }, - { "SetDigitalOutResponse", 93 }, + { "PushDiagnosticsRequest", 78 }, + { "PushDiagnosticsResponse", 79 }, + { "SetComponentValueRequest", 102 }, + { "SetComponentValueResponse", 103 }, + { "SetDigitalOutRequest", 96 }, + { "SetDigitalOutResponse", 97 }, { "StubCartridgeReadRequest", 5 }, { "StubCartridgeReadResponse", 6 }, { "StubCartridgeWriteRequest", 7 }, @@ -205,6 +209,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[110] = { "StubL6470DriverResponse", 40 }, { "StubMotorEncoderRequest", 23 }, { "StubMotorEncoderResponse", 24 }, + { "StubMotorHomeMarkRequest", 65 }, + { "StubMotorHomeMarkResponse", 66 }, { "StubMotorInitRequest", 41 }, { "StubMotorInitResponse", 42 }, { "StubMotorMovRequest", 49 }, @@ -215,6 +221,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[110] = { "StubMotorResponse", 64 }, { "StubMotorRunRequest", 43 }, { "StubMotorRunResponse", 44 }, + { "StubMotorRunStepTickRequest", 67 }, + { "StubMotorRunStepTickResponse", 68 }, { "StubMotorSpeedRequest", 51 }, { "StubMotorSpeedResponse", 52 }, { "StubMotorStatusRequest", 47 }, @@ -227,14 +235,14 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[110] = { "StubSteperMotorResponse", 28 }, { "StubValveRequest", 29 }, { "StubValveResponse", 30 }, - { "ThreadAbortJoggingRequest", 96 }, - { "ThreadAbortJoggingResponse", 97 }, - { "ThreadJoggingRequest", 94 }, - { "ThreadJoggingResponse", 95 }, - { "UploadHardwareConfigurationRequest", 108 }, - { "UploadHardwareConfigurationResponse", 109 }, - { "UploadProcessParametersRequest", 104 }, - { "UploadProcessParametersResponse", 105 }, + { "ThreadAbortJoggingRequest", 100 }, + { "ThreadAbortJoggingResponse", 101 }, + { "ThreadJoggingRequest", 98 }, + { "ThreadJoggingResponse", 99 }, + { "UploadHardwareConfigurationRequest", 112 }, + { "UploadHardwareConfigurationResponse", 113 }, + { "UploadProcessParametersRequest", 108 }, + { "UploadProcessParametersResponse", 109 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -243,9 +251,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 110, + 114, message_type__enum_values_by_number, - 110, + 114, message_type__enum_values_by_name, 7, 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 fdc8f18ba..387a5eb1d 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 @@ -85,6 +85,10 @@ typedef enum _MessageType { MESSAGE_TYPE__StubHeatingTestPollResponse = 64, MESSAGE_TYPE__StubMotorRequest = 65, MESSAGE_TYPE__StubMotorResponse = 66, + MESSAGE_TYPE__StubMotorHomeMarkRequest = 67, + MESSAGE_TYPE__StubMotorHomeMarkResponse = 68, + MESSAGE_TYPE__StubMotorRunStepTickRequest = 69, + MESSAGE_TYPE__StubMotorRunStepTickResponse = 70, MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 1000, MESSAGE_TYPE__ExternalClientLoginRequest = 1001, MESSAGE_TYPE__ExternalClientLoginResponse = 1002, diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.c index cf6300148..bd3bc7fd6 100644 --- a/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.c +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "EventType.pb-c.h" -static const ProtobufCEnumValue event_type__enum_values_by_number[34] = +static const ProtobufCEnumValue event_type__enum_values_by_number[36] = { { "ThreadBreak", "EVENT_TYPE__ThreadBreak", 0 }, { "ThreadTensionControlFailure", "EVENT_TYPE__ThreadTensionControlFailure", 1 }, @@ -42,17 +42,21 @@ static const ProtobufCEnumValue event_type__enum_values_by_number[34] = { "ResponseReceived", "EVENT_TYPE__ResponseReceived", 30 }, { "RequestFailed", "EVENT_TYPE__RequestFailed", 31 }, { "ApplicationException", "EVENT_TYPE__ApplicationException", 32 }, - { "ApplicationInformation", "EVENT_TYPE__ApplicationInformation", 34 }, + { "ApplicationInformation", "EVENT_TYPE__ApplicationInformation", 33 }, + { "ApplicationStarted", "EVENT_TYPE__ApplicationStarted", 34 }, + { "ApplicationTerminated", "EVENT_TYPE__ApplicationTerminated", 35 }, }; static const ProtobufCIntRange event_type__value_ranges[] = { -{0, 0},{34, 33},{0, 34} +{0, 0},{0, 36} }; -static const ProtobufCEnumValueIndex event_type__enum_values_by_name[34] = +static const ProtobufCEnumValueIndex event_type__enum_values_by_name[36] = { { "AirFilterClogged", 13 }, { "AirFilterNotInstalled", 14 }, { "ApplicationException", 32 }, { "ApplicationInformation", 33 }, + { "ApplicationStarted", 34 }, + { "ApplicationTerminated", 35 }, { "DHThermalCutoff", 7 }, { "DispenserEmpty", 18 }, { "DispenserLowLevel", 19 }, @@ -91,11 +95,11 @@ const ProtobufCEnumDescriptor event_type__descriptor = "EventType", "EventType", "", - 34, + 36, event_type__enum_values_by_number, - 34, + 36, event_type__enum_values_by_name, - 2, + 1, event_type__value_ranges, NULL,NULL,NULL,NULL /* reserved[1234] */ }; diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.h index 0fbfc6914..c6bd394cf 100644 --- a/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.h +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Diagnostics/EventType.pb-c.h @@ -53,7 +53,9 @@ typedef enum _EventType { EVENT_TYPE__ResponseReceived = 30, EVENT_TYPE__RequestFailed = 31, EVENT_TYPE__ApplicationException = 32, - EVENT_TYPE__ApplicationInformation = 34 + EVENT_TYPE__ApplicationInformation = 33, + EVENT_TYPE__ApplicationStarted = 34, + EVENT_TYPE__ApplicationTerminated = 35 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(EVENT_TYPE) } EventType; diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.c index 8eb96d16d..9826afdda 100644 --- a/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.c +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.c @@ -52,7 +52,7 @@ void hardware_pid_control__free_unpacked assert(message->base.descriptor == &hardware_pid_control__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15] = +static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[17] = { { "HardwarePidControlType", @@ -70,7 +70,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "OutputProportionalPowerLimit", 2, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_outputproportionalpowerlimit), offsetof(HardwarePidControl, outputproportionalpowerlimit), NULL, @@ -82,7 +82,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "OutputProportionalBand", 3, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_outputproportionalband), offsetof(HardwarePidControl, outputproportionalband), NULL, @@ -94,7 +94,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "IntegralTime", 4, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_integraltime), offsetof(HardwarePidControl, integraltime), NULL, @@ -106,7 +106,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "DerivativeTime", 5, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_derivativetime), offsetof(HardwarePidControl, derivativetime), NULL, @@ -118,7 +118,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "SensorCorrectionAdjustment", 6, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_sensorcorrectionadjustment), offsetof(HardwarePidControl, sensorcorrectionadjustment), NULL, @@ -130,7 +130,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "SensorMinValue", 7, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_sensorminvalue), offsetof(HardwarePidControl, sensorminvalue), NULL, @@ -142,7 +142,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "SensorMaxValue", 8, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_sensormaxvalue), offsetof(HardwarePidControl, sensormaxvalue), NULL, @@ -154,7 +154,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "SetPointRampRateorSoftStartRamp", 9, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_setpointramprateorsoftstartramp), offsetof(HardwarePidControl, setpointramprateorsoftstartramp), NULL, @@ -166,7 +166,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "SetPointControlOutputRate", 10, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_setpointcontroloutputrate), offsetof(HardwarePidControl, setpointcontroloutputrate), NULL, @@ -178,7 +178,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "ControlOutputType", 11, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_controloutputtype), offsetof(HardwarePidControl, controloutputtype), NULL, @@ -190,7 +190,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "SsrControlOutputType", 12, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_ssrcontroloutputtype), offsetof(HardwarePidControl, ssrcontroloutputtype), NULL, @@ -202,7 +202,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "OutputOnOffHysteresisValue", 13, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_outputonoffhysteresisvalue), offsetof(HardwarePidControl, outputonoffhysteresisvalue), NULL, @@ -214,7 +214,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "ProcessVariableSamplingRate", 14, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_processvariablesamplingrate), offsetof(HardwarePidControl, processvariablesamplingrate), NULL, @@ -226,7 +226,7 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 "PvInputFilterFactorMode", 15, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_INT32, + PROTOBUF_C_TYPE_DOUBLE, offsetof(HardwarePidControl, has_pvinputfilterfactormode), offsetof(HardwarePidControl, pvinputfilterfactormode), NULL, @@ -234,14 +234,40 @@ static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "OutputProportionalCycleTime", + 16, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_outputproportionalcycletime), + offsetof(HardwarePidControl, outputproportionalcycletime), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "AcHeatersHalfCycleTime", + 17, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_acheatershalfcycletime), + offsetof(HardwarePidControl, acheatershalfcycletime), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned hardware_pid_control__field_indices_by_name[] = { + 16, /* field[16] = AcHeatersHalfCycleTime */ 10, /* field[10] = ControlOutputType */ 4, /* field[4] = DerivativeTime */ 0, /* field[0] = HardwarePidControlType */ 3, /* field[3] = IntegralTime */ 12, /* field[12] = OutputOnOffHysteresisValue */ 2, /* field[2] = OutputProportionalBand */ + 15, /* field[15] = OutputProportionalCycleTime */ 1, /* field[1] = OutputProportionalPowerLimit */ 13, /* field[13] = ProcessVariableSamplingRate */ 14, /* field[14] = PvInputFilterFactorMode */ @@ -255,7 +281,7 @@ static const unsigned hardware_pid_control__field_indices_by_name[] = { static const ProtobufCIntRange hardware_pid_control__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 15 } + { 0, 17 } }; const ProtobufCMessageDescriptor hardware_pid_control__descriptor = { @@ -265,7 +291,7 @@ const ProtobufCMessageDescriptor hardware_pid_control__descriptor = "HardwarePidControl", "", sizeof(HardwarePidControl), - 15, + 17, hardware_pid_control__field_descriptors, hardware_pid_control__field_indices_by_name, 1, hardware_pid_control__number_ranges, diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.h index 2a316b5ab..b012fb377 100644 --- a/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.h +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Hardware/HardwarePidControl.pb-c.h @@ -30,37 +30,41 @@ struct _HardwarePidControl protobuf_c_boolean has_hardwarepidcontroltype; HardwarePidControlType hardwarepidcontroltype; protobuf_c_boolean has_outputproportionalpowerlimit; - int32_t outputproportionalpowerlimit; + double outputproportionalpowerlimit; protobuf_c_boolean has_outputproportionalband; - int32_t outputproportionalband; + double outputproportionalband; protobuf_c_boolean has_integraltime; - int32_t integraltime; + double integraltime; protobuf_c_boolean has_derivativetime; - int32_t derivativetime; + double derivativetime; protobuf_c_boolean has_sensorcorrectionadjustment; - int32_t sensorcorrectionadjustment; + double sensorcorrectionadjustment; protobuf_c_boolean has_sensorminvalue; - int32_t sensorminvalue; + double sensorminvalue; protobuf_c_boolean has_sensormaxvalue; - int32_t sensormaxvalue; + double sensormaxvalue; protobuf_c_boolean has_setpointramprateorsoftstartramp; - int32_t setpointramprateorsoftstartramp; + double setpointramprateorsoftstartramp; protobuf_c_boolean has_setpointcontroloutputrate; - int32_t setpointcontroloutputrate; + double setpointcontroloutputrate; protobuf_c_boolean has_controloutputtype; - int32_t controloutputtype; + double controloutputtype; protobuf_c_boolean has_ssrcontroloutputtype; - int32_t ssrcontroloutputtype; + double ssrcontroloutputtype; protobuf_c_boolean has_outputonoffhysteresisvalue; - int32_t outputonoffhysteresisvalue; + double outputonoffhysteresisvalue; protobuf_c_boolean has_processvariablesamplingrate; - int32_t processvariablesamplingrate; + double processvariablesamplingrate; protobuf_c_boolean has_pvinputfilterfactormode; - int32_t pvinputfilterfactormode; + double pvinputfilterfactormode; + protobuf_c_boolean has_outputproportionalcycletime; + int32_t outputproportionalcycletime; + protobuf_c_boolean has_acheatershalfcycletime; + int32_t acheatershalfcycletime; }; #define HARDWARE_PID_CONTROL__INIT \ { PROTOBUF_C_MESSAGE_INIT (&hardware_pid_control__descriptor) \ - , 0, HARDWARE_PID_CONTROL_TYPE__DryerHeater1000w, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, HARDWARE_PID_CONTROL_TYPE__DryerHeater1000w, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } /* HardwarePidControl methods */ diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.c new file mode 100644 index 000000000..fbfe0ab08 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorHomeMarkRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorHomeMarkRequest.pb-c.h" +void stub_motor_home_mark_request__init + (StubMotorHomeMarkRequest *message) +{ + static const StubMotorHomeMarkRequest init_value = STUB_MOTOR_HOME_MARK_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_home_mark_request__get_packed_size + (const StubMotorHomeMarkRequest *message) +{ + assert(message->base.descriptor == &stub_motor_home_mark_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_home_mark_request__pack + (const StubMotorHomeMarkRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_home_mark_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_home_mark_request__pack_to_buffer + (const StubMotorHomeMarkRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_home_mark_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorHomeMarkRequest * + stub_motor_home_mark_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorHomeMarkRequest *) + protobuf_c_message_unpack (&stub_motor_home_mark_request__descriptor, + allocator, len, data); +} +void stub_motor_home_mark_request__free_unpacked + (StubMotorHomeMarkRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_home_mark_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_home_mark_request__field_descriptors[2] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorHomeMarkRequest, has_motor_id), + offsetof(StubMotorHomeMarkRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Set_Home_Mark_GO_Home_Mark", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorHomeMarkRequest, has_set_home_mark_go_home_mark), + offsetof(StubMotorHomeMarkRequest, set_home_mark_go_home_mark), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_home_mark_request__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ + 1, /* field[1] = Set_Home_Mark_GO_Home_Mark */ +}; +static const ProtobufCIntRange stub_motor_home_mark_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_motor_home_mark_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorHomeMarkRequest", + "StubMotorHomeMarkRequest", + "StubMotorHomeMarkRequest", + "", + sizeof(StubMotorHomeMarkRequest), + 2, + stub_motor_home_mark_request__field_descriptors, + stub_motor_home_mark_request__field_indices_by_name, + 1, stub_motor_home_mark_request__number_ranges, + (ProtobufCMessageInit) stub_motor_home_mark_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.h new file mode 100644 index 000000000..401241e76 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkRequest.pb-c.h @@ -0,0 +1,77 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorHomeMarkRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorHomeMarkRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorHomeMarkRequest_2eproto__INCLUDED + +#include + +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 _StubMotorHomeMarkRequest StubMotorHomeMarkRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorHomeMarkRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + /* + * 0..3 + */ + protobuf_c_boolean has_set_home_mark_go_home_mark; + uint32_t set_home_mark_go_home_mark; +}; +#define STUB_MOTOR_HOME_MARK_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_home_mark_request__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMotorHomeMarkRequest methods */ +void stub_motor_home_mark_request__init + (StubMotorHomeMarkRequest *message); +size_t stub_motor_home_mark_request__get_packed_size + (const StubMotorHomeMarkRequest *message); +size_t stub_motor_home_mark_request__pack + (const StubMotorHomeMarkRequest *message, + uint8_t *out); +size_t stub_motor_home_mark_request__pack_to_buffer + (const StubMotorHomeMarkRequest *message, + ProtobufCBuffer *buffer); +StubMotorHomeMarkRequest * + stub_motor_home_mark_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_home_mark_request__free_unpacked + (StubMotorHomeMarkRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorHomeMarkRequest_Closure) + (const StubMotorHomeMarkRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_home_mark_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorHomeMarkRequest_2eproto__INCLUDED */ diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.c new file mode 100644 index 000000000..65f1b899f --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorHomeMarkResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorHomeMarkResponse.pb-c.h" +void stub_motor_home_mark_response__init + (StubMotorHomeMarkResponse *message) +{ + static const StubMotorHomeMarkResponse init_value = STUB_MOTOR_HOME_MARK_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_home_mark_response__get_packed_size + (const StubMotorHomeMarkResponse *message) +{ + assert(message->base.descriptor == &stub_motor_home_mark_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_home_mark_response__pack + (const StubMotorHomeMarkResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_home_mark_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_home_mark_response__pack_to_buffer + (const StubMotorHomeMarkResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_home_mark_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorHomeMarkResponse * + stub_motor_home_mark_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorHomeMarkResponse *) + protobuf_c_message_unpack (&stub_motor_home_mark_response__descriptor, + allocator, len, data); +} +void stub_motor_home_mark_response__free_unpacked + (StubMotorHomeMarkResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_home_mark_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_home_mark_response__field_descriptors[2] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorHomeMarkResponse, has_motor_id), + offsetof(StubMotorHomeMarkResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Position", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorHomeMarkResponse, has_position), + offsetof(StubMotorHomeMarkResponse, position), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_home_mark_response__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ + 1, /* field[1] = Position */ +}; +static const ProtobufCIntRange stub_motor_home_mark_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_motor_home_mark_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorHomeMarkResponse", + "StubMotorHomeMarkResponse", + "StubMotorHomeMarkResponse", + "", + sizeof(StubMotorHomeMarkResponse), + 2, + stub_motor_home_mark_response__field_descriptors, + stub_motor_home_mark_response__field_indices_by_name, + 1, stub_motor_home_mark_response__number_ranges, + (ProtobufCMessageInit) stub_motor_home_mark_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.h new file mode 100644 index 000000000..431e62d4b --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorHomeMarkResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorHomeMarkResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorHomeMarkResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorHomeMarkResponse_2eproto__INCLUDED + +#include + +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 _StubMotorHomeMarkResponse StubMotorHomeMarkResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorHomeMarkResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_position; + uint32_t position; +}; +#define STUB_MOTOR_HOME_MARK_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_home_mark_response__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMotorHomeMarkResponse methods */ +void stub_motor_home_mark_response__init + (StubMotorHomeMarkResponse *message); +size_t stub_motor_home_mark_response__get_packed_size + (const StubMotorHomeMarkResponse *message); +size_t stub_motor_home_mark_response__pack + (const StubMotorHomeMarkResponse *message, + uint8_t *out); +size_t stub_motor_home_mark_response__pack_to_buffer + (const StubMotorHomeMarkResponse *message, + ProtobufCBuffer *buffer); +StubMotorHomeMarkResponse * + stub_motor_home_mark_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_home_mark_response__free_unpacked + (StubMotorHomeMarkResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorHomeMarkResponse_Closure) + (const StubMotorHomeMarkResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_home_mark_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorHomeMarkResponse_2eproto__INCLUDED */ diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.c new file mode 100644 index 000000000..80a362034 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunStepTickRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorRunStepTickRequest.pb-c.h" +void stub_motor_run_step_tick_request__init + (StubMotorRunStepTickRequest *message) +{ + static const StubMotorRunStepTickRequest init_value = STUB_MOTOR_RUN_STEP_TICK_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_run_step_tick_request__get_packed_size + (const StubMotorRunStepTickRequest *message) +{ + assert(message->base.descriptor == &stub_motor_run_step_tick_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_run_step_tick_request__pack + (const StubMotorRunStepTickRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_run_step_tick_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_run_step_tick_request__pack_to_buffer + (const StubMotorRunStepTickRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_run_step_tick_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorRunStepTickRequest * + stub_motor_run_step_tick_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorRunStepTickRequest *) + protobuf_c_message_unpack (&stub_motor_run_step_tick_request__descriptor, + allocator, len, data); +} +void stub_motor_run_step_tick_request__free_unpacked + (StubMotorRunStepTickRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_run_step_tick_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_run_step_tick_request__field_descriptors[3] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunStepTickRequest, has_motor_id), + offsetof(StubMotorRunStepTickRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Direction", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunStepTickRequest, has_direction), + offsetof(StubMotorRunStepTickRequest, direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Speed", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StubMotorRunStepTickRequest, has_speed), + offsetof(StubMotorRunStepTickRequest, speed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_run_step_tick_request__field_indices_by_name[] = { + 1, /* field[1] = Direction */ + 0, /* field[0] = Motor_ID */ + 2, /* field[2] = Speed */ +}; +static const ProtobufCIntRange stub_motor_run_step_tick_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor stub_motor_run_step_tick_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorRunStepTickRequest", + "StubMotorRunStepTickRequest", + "StubMotorRunStepTickRequest", + "", + sizeof(StubMotorRunStepTickRequest), + 3, + stub_motor_run_step_tick_request__field_descriptors, + stub_motor_run_step_tick_request__field_indices_by_name, + 1, stub_motor_run_step_tick_request__number_ranges, + (ProtobufCMessageInit) stub_motor_run_step_tick_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.h new file mode 100644 index 000000000..d2efb1df9 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickRequest.pb-c.h @@ -0,0 +1,76 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunStepTickRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorRunStepTickRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorRunStepTickRequest_2eproto__INCLUDED + +#include + +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 _StubMotorRunStepTickRequest StubMotorRunStepTickRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorRunStepTickRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_direction; + protobuf_c_boolean direction; + protobuf_c_boolean has_speed; + double speed; +}; +#define STUB_MOTOR_RUN_STEP_TICK_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_run_step_tick_request__descriptor) \ + , 0, 0, 0, 0, 0, 0 } + + +/* StubMotorRunStepTickRequest methods */ +void stub_motor_run_step_tick_request__init + (StubMotorRunStepTickRequest *message); +size_t stub_motor_run_step_tick_request__get_packed_size + (const StubMotorRunStepTickRequest *message); +size_t stub_motor_run_step_tick_request__pack + (const StubMotorRunStepTickRequest *message, + uint8_t *out); +size_t stub_motor_run_step_tick_request__pack_to_buffer + (const StubMotorRunStepTickRequest *message, + ProtobufCBuffer *buffer); +StubMotorRunStepTickRequest * + stub_motor_run_step_tick_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_run_step_tick_request__free_unpacked + (StubMotorRunStepTickRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorRunStepTickRequest_Closure) + (const StubMotorRunStepTickRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_run_step_tick_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorRunStepTickRequest_2eproto__INCLUDED */ diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.c b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.c new file mode 100644 index 000000000..1fa6f484a --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.c @@ -0,0 +1,183 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunStepTickResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorRunStepTickResponse.pb-c.h" +void stub_motor_run_step_tick_response__init + (StubMotorRunStepTickResponse *message) +{ + static const StubMotorRunStepTickResponse init_value = STUB_MOTOR_RUN_STEP_TICK_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_run_step_tick_response__get_packed_size + (const StubMotorRunStepTickResponse *message) +{ + assert(message->base.descriptor == &stub_motor_run_step_tick_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_run_step_tick_response__pack + (const StubMotorRunStepTickResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_run_step_tick_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_run_step_tick_response__pack_to_buffer + (const StubMotorRunStepTickResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_run_step_tick_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorRunStepTickResponse * + stub_motor_run_step_tick_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorRunStepTickResponse *) + protobuf_c_message_unpack (&stub_motor_run_step_tick_response__descriptor, + allocator, len, data); +} +void stub_motor_run_step_tick_response__free_unpacked + (StubMotorRunStepTickResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_run_step_tick_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_run_step_tick_response__field_descriptors[8] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunStepTickResponse, has_motor_id), + offsetof(StubMotorRunStepTickResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Speed", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StubMotorRunStepTickResponse, has_speed), + offsetof(StubMotorRunStepTickResponse, speed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status_Reg", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunStepTickResponse, has_status_reg), + offsetof(StubMotorRunStepTickResponse, status_reg), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Direction", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunStepTickResponse, has_direction), + offsetof(StubMotorRunStepTickResponse, direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Mot_Status", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunStepTickResponse, has_mot_status), + offsetof(StubMotorRunStepTickResponse, mot_status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_A", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunStepTickResponse, has_step_loss_a), + offsetof(StubMotorRunStepTickResponse, step_loss_a), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_B", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunStepTickResponse, has_step_loss_b), + offsetof(StubMotorRunStepTickResponse, step_loss_b), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "BUSY", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunStepTickResponse, has_busy), + offsetof(StubMotorRunStepTickResponse, busy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_run_step_tick_response__field_indices_by_name[] = { + 7, /* field[7] = BUSY */ + 3, /* field[3] = Direction */ + 4, /* field[4] = Mot_Status */ + 0, /* field[0] = Motor_ID */ + 5, /* field[5] = STEP_LOSS_A */ + 6, /* field[6] = STEP_LOSS_B */ + 1, /* field[1] = Speed */ + 2, /* field[2] = Status_Reg */ +}; +static const ProtobufCIntRange stub_motor_run_step_tick_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 8 } +}; +const ProtobufCMessageDescriptor stub_motor_run_step_tick_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorRunStepTickResponse", + "StubMotorRunStepTickResponse", + "StubMotorRunStepTickResponse", + "", + sizeof(StubMotorRunStepTickResponse), + 8, + stub_motor_run_step_tick_response__field_descriptors, + stub_motor_run_step_tick_response__field_indices_by_name, + 1, stub_motor_run_step_tick_response__number_ranges, + (ProtobufCMessageInit) stub_motor_run_step_tick_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.h b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.h new file mode 100644 index 000000000..5541f9b82 --- /dev/null +++ b/Software/Code_Composer/twine_usblib_demo/PMR/Stubs/StubMotorRunStepTickResponse.pb-c.h @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunStepTickResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorRunStepTickResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorRunStepTickResponse_2eproto__INCLUDED + +#include + +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 _StubMotorRunStepTickResponse StubMotorRunStepTickResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorRunStepTickResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_speed; + double speed; + protobuf_c_boolean has_status_reg; + uint32_t status_reg; + /* + * Reverse / Forward + */ + protobuf_c_boolean has_direction; + protobuf_c_boolean direction; + /* + *Stopped / Acceleration / Deceleration / Constant speed + */ + protobuf_c_boolean has_mot_status; + uint32_t mot_status; + protobuf_c_boolean has_step_loss_a; + protobuf_c_boolean step_loss_a; + protobuf_c_boolean has_step_loss_b; + protobuf_c_boolean step_loss_b; + protobuf_c_boolean has_busy; + protobuf_c_boolean busy; +}; +#define STUB_MOTOR_RUN_STEP_TICK_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_run_step_tick_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubMotorRunStepTickResponse methods */ +void stub_motor_run_step_tick_response__init + (StubMotorRunStepTickResponse *message); +size_t stub_motor_run_step_tick_response__get_packed_size + (const StubMotorRunStepTickResponse *message); +size_t stub_motor_run_step_tick_response__pack + (const StubMotorRunStepTickResponse *message, + uint8_t *out); +size_t stub_motor_run_step_tick_response__pack_to_buffer + (const StubMotorRunStepTickResponse *message, + ProtobufCBuffer *buffer); +StubMotorRunStepTickResponse * + stub_motor_run_step_tick_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_run_step_tick_response__free_unpacked + (StubMotorRunStepTickResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorRunStepTickResponse_Closure) + (const StubMotorRunStepTickResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_run_step_tick_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorRunStepTickResponse_2eproto__INCLUDED */ 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 3cd3b3931..2f3bd6009 100644 --- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Container.c +++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Container.c @@ -155,6 +155,14 @@ void receive_callback(char* buffer, size_t length) Stub_MotorRequest(requestContainer); break; + case MESSAGE_TYPE__StubMotorHomeMarkRequest: + Stub_MotorHomeMarkRequest(requestContainer); + break; + case MESSAGE_TYPE__StubMotorRunStepTickRequest: + Stub_MotorRunStepTickRequest(requestContainer); + break; + + default: //unsupported message type !! break; 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 30b9cab07..dcf8d151c 100644 --- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/DataDef.h +++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/DataDef.h @@ -33,6 +33,12 @@ enum #define NOTBUSY 0 #define BUSY 1 + +#define SET_HOME 0 +#define SET_MARK 1 +#define GO_HOME 2 +#define GO_MARK 3 + // //#define SPI_BUSY 0 //#define SPI_NOTBUSY 1 diff --git a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Motor.c b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Motor.c index d1e6ff82d..c6422d6d9 100644 --- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Motor.c +++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Motor.c @@ -15,6 +15,10 @@ #include #include #include +#include +#include +#include +#include #include #include @@ -526,4 +530,114 @@ void Stub_MotorRequest(MessageContainer* requestContainer) free(requestContainer); } +void Stub_MotorHomeMarkRequest(MessageContainer* requestContainer) +{ + + MessageContainer responseContainer; + + StubMotorHomeMarkRequest* request = stub_motor_home_mark_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + switch(request->set_home_mark_go_home_mark) + { + case SET_HOME: + ResetPos(); + break; + case SET_MARK: + Get_Param(x_MARK); ///???? + break; + case GO_HOME: + GoHome(); + break; + case GO_MARK: + GoMark(); + break; + + default: + break; + } + + StubMotorHomeMarkResponse response = STUB_MOTOR_HOME_MARK_RESPONSE__INIT; + + response.motor_id = request->motor_id; + response.has_motor_id = true; + + response.position = Get_Param(x_ABS_POS); + response.has_position = true; + + responseContainer = createContainer(MESSAGE_TYPE__StubMotorHomeMarkResponse, requestContainer->token, true, &response, &stub_motor_home_mark_response__pack, &stub_motor_home_mark_response__get_packed_size); + + 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_MotorRunStepTickRequest(MessageContainer* requestContainer) +{ + + uint32_t read_status; + + MessageContainer responseContainer; + + StubMotorRunStepTickRequest* request = stub_motor_run_step_tick_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + + //float temp = (float)request->speed; + //Run_Value = SpdCalc(temp); + //Direction = request->direction; + + + Run(request->direction,request->speed); + + + + + + StubMotorRunStepTickResponse response = STUB_MOTOR_RUN_STEP_TICK_RESPONSE__INIT; + + response.motor_id = request->motor_id; + response.has_motor_id = true; + + read_status = Get_and_Clear_Status(); + + response.speed = (Get_Param(x_SPEED)); + response.has_speed = true; + + response.status_reg = read_status; + response.has_status_reg = true; + + response.direction = ((read_status & x_STATUS_DIR)>>4); + response.has_direction = true; + + response.step_loss_a = ((read_status & x_STATUS_STEP_LOSS_A)>>13); + response.has_step_loss_a = true; + response.step_loss_b = ((read_status & x_STATUS_STEP_LOSS_B)>>14); + response.has_step_loss_b = true; + + + response.mot_status = ((read_status & x_STATUS_MOT_STATUS)>>5); + response.has_mot_status = true; + + response.busy = ((read_status & x_STATUS_BUSY)>>1); + response.has_busy = true; + + + responseContainer = createContainer(MESSAGE_TYPE__StubMotorRunStepTickResponse, requestContainer->token, true, &response, &stub_motor_run_step_tick_response__pack, &stub_motor_run_step_tick_response__get_packed_size); + + writeLine("Sending Response: "); + + writeFloat(response.motor_id); + + + 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_Motor.h b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Motor.h index 59312179f..6366698c5 100644 --- a/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Motor.h +++ b/Software/Code_Composer/twine_usblib_demo/Stubs_Handler/Stub_Motor.h @@ -6,5 +6,6 @@ void Stub_MotorSpeedRequest(MessageContainer* requestContainer); void Stub_MotorPositionRequest(MessageContainer* requestContainer); void Stub_MotorMovRequest(MessageContainer* requestContainer); void Stub_MotorRequest(MessageContainer* requestContainer); - +void Stub_MotorHomeMarkRequest(MessageContainer* requestContainer); +void Stub_MotorRunStepTickRequest(MessageContainer* requestContainer); diff --git a/Software/Code_Composer/twine_usblib_demo/drivers/Danser_SSI/SSI_Comm.c b/Software/Code_Composer/twine_usblib_demo/drivers/Danser_SSI/SSI_Comm.c index bf9460ab5..2cd0534a7 100644 --- a/Software/Code_Composer/twine_usblib_demo/drivers/Danser_SSI/SSI_Comm.c +++ b/Software/Code_Composer/twine_usblib_demo/drivers/Danser_SSI/SSI_Comm.c @@ -10,6 +10,26 @@ //00 - No special requirements +/* +down + +Name : RByte + Default:34988 + Hex:0x000088AC + Decimal:34988 + Octal:0104254 + Binary:0000000000000000 10001000101011 00b (position = 8747) +up + Name : RByte + Default:44520 + Hex:0x0000ADE8 + Decimal:44520 + Octal:0126750 + Binary:0000000000000000 10101101111010 00b (position = 11130) + + missing 8 bits of Detailed status (the 16 MSB should not be receive) + */ + #include #include #include @@ -33,9 +53,9 @@ typedef struct // 24bit { - unsigned char Det_status:8; - unsigned char Gen_status:2; unsigned short Position:14; + unsigned char Gen_status:2; + unsigned char Det_status:8; }SSI_ENC; SSI_ENC SSI_enc; @@ -79,9 +99,9 @@ void SSI1_Init() SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); /* Configure pad settings */ // AVI - GPIOPadConfigSet(GPIO_PORTE_BASE, - GPIO_PIN_4, - GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD); +// GPIOPadConfigSet(GPIO_PORTE_BASE, +// GPIO_PIN_4, +// GPIO_STRENGTH_4MA, GPIO_PIN_TYPE_STD); GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_5, @@ -121,8 +141,8 @@ void SSI1_Init() // Configure and enable the SSI1 port for SPI Master mode. // - SSIConfigSetExpClk(SSI1_BASE, ui32SysClock, SSI_FRF_NMW, - SSI_MODE_MASTER, 500000, 16); // to receive Clock period 2uSec, Clock frequency 500KHz + SSIConfigSetExpClk(SSI1_BASE, ui32SysClock, SSI_FRF_MOTO_MODE_0,//SSI_FRF_NMW, + SSI_MODE_MASTER, 500000, 32);//16); // to receive Clock period 2uSec, Clock frequency 500KHz //SSI_MODE_MASTER send 24 bits 0x00 (dummy) 0x7f 0xff -> create clock of 24 bits for SSI SSIAdvModeSet(SSI1_BASE,SSI_ADV_MODE_READ_WRITE ); @@ -140,14 +160,17 @@ uint32_t Write_Dummy_Byte() uint8_t WByte = 0x00; // Dummy Byte uint32_t RByte = 0x00; + SSIDataPut(SSI1_BASE, WByte); while(SSIBusy(SSI1_BASE)){}; - SSIDataGet(SSI1_BASE, &RByte);// 24 bytes - return (RByte & 0xffffff);// 24 bytes + while(SSIDataGetNonBlocking(SSI1_BASE, &RByte)){}; //FIFO to read 24 bit + + //return (RByte & 0xffffff);// 24 bytes + return (RByte & 0xffff);//14 bit position + 2 bit general status } void Read_Dancer_Position () @@ -158,11 +181,14 @@ void Read_Dancer_Position () ENC_SSI_Data = Write_Dummy_Byte(); - SSI_enc.Det_status = ENC_SSI_Data & 0xFF; - ENC_SSI_Data = ENC_SSI_Data >> 8; + + //SSI_enc.Det_status = ENC_SSI_Data & 0xFF; + //ENC_SSI_Data = ENC_SSI_Data >> 8; + SSI_enc.Det_status = 0; + SSI_enc.Gen_status = ENC_SSI_Data & 0x3; ENC_SSI_Data = ENC_SSI_Data >> 2; - SSI_enc.Position = ENC_SSI_Data & 0x3FFF; + SSI_enc.Position = ENC_SSI_Data & 0x3FFF; // up 11130 down 8747 SSIDisable(SSI1_BASE); } diff --git a/Software/Code_Composer/twine_usblib_demo/drivers/SPI/SPI_Comm.c b/Software/Code_Composer/twine_usblib_demo/drivers/SPI/SPI_Comm.c index 4eeeda774..2f44ed635 100644 --- a/Software/Code_Composer/twine_usblib_demo/drivers/SPI/SPI_Comm.c +++ b/Software/Code_Composer/twine_usblib_demo/drivers/SPI/SPI_Comm.c @@ -394,7 +394,7 @@ void setup(StubMotorInitRequest* request) { SetParam(x_STEP_MODE, !x_SYNC_EN | - x_STEP_SEL_1_8 | + x_STEP_SEL_1 |//x_STEP_SEL_1_8 | x_SYNC_SEL_1); } @@ -505,7 +505,7 @@ void setup(StubMotorInitRequest* request) read_status = Get_Param(x_STATUS); } - //writable only when outputs are in high impedance: +// //writable only when outputs are in high impedance: SetParam(x_CONFIG, x_CONFIG_PWM_DIV_1 | x_CONFIG_PWM_MUL_2 | @@ -540,14 +540,14 @@ void setup(StubMotorInitRequest* request) // SetParam(x_FN_SLP_DEC, /*0x48);// */ 0x23); //for Motor 49: - SetParam(x_KVAL_HOLD, 0x35); - SetParam(x_KVAL_RUN, 0x4B); - SetParam(x_KVAL_ACC, 0x4B); - SetParam(x_KVAL_DEC, 0x4B); - SetParam(x_ST_SLP, 0x20); - SetParam(x_INT_SPD, 0x1A13); - SetParam(x_FN_SLP_ACC, 0x50); - SetParam(x_FN_SLP_DEC, 0x50); +// SetParam(x_KVAL_HOLD, 0x35); +// SetParam(x_KVAL_RUN, 0x4B); +// SetParam(x_KVAL_ACC, 0x4B); +// SetParam(x_KVAL_DEC, 0x4B); +// SetParam(x_ST_SLP, 0x20); +// SetParam(x_INT_SPD, 0x1A13); +// SetParam(x_FN_SLP_ACC, 0x50); +// SetParam(x_FN_SLP_DEC, 0x50); //https://www.youtube.com/watch?v=8C7qdjPbhlg MIN 2:20 diff --git a/Software/Code_Composer/twine_usblib_demo/main.c b/Software/Code_Composer/twine_usblib_demo/main.c index 2f1591661..a6eb475ad 100644 --- a/Software/Code_Composer/twine_usblib_demo/main.c +++ b/Software/Code_Composer/twine_usblib_demo/main.c @@ -139,7 +139,7 @@ int main(void) // SPI_Control(); SSI1_Init(); // Read dancer ENC SSI - //Loop_SSI(); + Loop_SSI(); SPI2_Init(); init_BUSY_Pin(); -- cgit v1.3.1