aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Include.h
blob: 7a9dda68b5b04f20bbf3d0d0a4f7b89657d1c6e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef INCLUDE_H_
#define INCLUDE_H_

//standard lib includes
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>

#include <stdlib.h>     /*malloc*/
#include <ctype.h>      /* tolower              */
#include <errno.h>
#include "./common/protobuf-c/protobuf-c.h"

//operation system includes
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/mailbox.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/gates/GateMutex.h>
//xdc
#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>


//driver includes
#include <driverlib/rom.h>
#include <driverlib/sysctl.h>
#include <driverlib/usb.h>
#include <driverlib/interrupt.h>
#include <driverlib/rom_map.h>
#include <driverlib/fpu.h>

#include <usblib/usblib.h>
#include <usblib/device/usbdevice.h>

#include <inc/hw_nvic.h>
#include <inc/hw_types.h>
#include <inc/hw_memmap.h>
#include "inc/hw_uart.h"

#include "Modules/General/GeneralHardware.h"
//#include "drivers/twine_usblib/usb_serial_adapter.h"
#include "drivers/USB_Communication/usbcdcd.h"

#include <xdc/runtime/System.h>

#include <utils/ustdlib.h>

#include "Common/Utilities/Utils.h"
#include "Common/report/report.h"
#include "DataDef.h"

#define SYS_CLK_FREQ                120000000

#define PI 3.1415926

typedef  uint32_t (* callback_fptr)(uint32_t deviceID, uint32_t ReadValue);

extern void SysTickHandler(void);

#endif  // INCLUDE_H_
>.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace Tango.PMR.Stubs { /// <summary>Holder for reflection information generated from StubMotorSpeedResponse.proto</summary> public static partial class StubMotorSpeedResponseReflection { #region Descriptor /// <summary>File descriptor for StubMotorSpeedResponse.proto</summary> public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; static StubMotorSpeedResponseReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChxTdHViTW90b3JTcGVlZFJlc3BvbnNlLnByb3RvEg9UYW5nby5QTVIuU3R1", "YnMiOQoWU3R1Yk1vdG9yU3BlZWRSZXNwb25zZRIQCghNb3Rvcl9JRBgBIAEo", "DRINCgVTcGVlZBgCIAEoAUIbChljb20udHdpbmUudGFuZ28ucG1yLnN0dWJz", "YgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Stubs.StubMotorSpeedResponse), global::Tango.PMR.Stubs.StubMotorSpeedResponse.Parser, new[]{ "MotorID", "Speed" }, null, null, null) })); } #endregion } #region Messages public sealed partial class StubMotorSpeedResponse : pb::IMessage<StubMotorSpeedResponse> { private static readonly pb::MessageParser<StubMotorSpeedResponse> _parser = new pb::MessageParser<StubMotorSpeedResponse>(() => new StubMotorSpeedResponse()); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser<StubMotorSpeedResponse> Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::Tango.PMR.Stubs.StubMotorSpeedResponseReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StubMotorSpeedResponse() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StubMotorSpeedResponse(StubMotorSpeedResponse other) : this() { motorID_ = other.motorID_; speed_ = other.speed_; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public StubMotorSpeedResponse Clone() { return new StubMotorSpeedResponse(this); } /// <summary>Field number for the "Motor_ID" field.</summary> public const int MotorIDFieldNumber = 1; private uint motorID_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public uint MotorID { get { return motorID_; } set { motorID_ = value; } } /// <summary>Field number for the "Speed" field.</summary> public const int SpeedFieldNumber = 2; private double speed_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public double Speed { get { return speed_; } set { speed_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as StubMotorSpeedResponse); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(StubMotorSpeedResponse other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (MotorID != other.MotorID) return false; if (Speed != other.Speed) return false; return true; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (MotorID != 0) hash ^= MotorID.GetHashCode(); if (Speed != 0D) hash ^= Speed.GetHashCode(); return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (MotorID != 0) { output.WriteRawTag(8); output.WriteUInt32(MotorID); } if (Speed != 0D) { output.WriteRawTag(17); output.WriteDouble(Speed); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (MotorID != 0) { size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MotorID); } if (Speed != 0D) { size += 1 + 8; } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(StubMotorSpeedResponse other) { if (other == null) { return; } if (other.MotorID != 0) { MotorID = other.MotorID; } if (other.Speed != 0D) { Speed = other.Speed; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: input.SkipLastField(); break; case 8: { MotorID = input.ReadUInt32(); break; } case 17: { Speed = input.ReadDouble(); break; } } } } } #endregion } #endregion Designer generated code