aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Include.h
blob: 34410bd29f2f474cadf5a1f6411552cc9d01390c (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
64
65
66
#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 "Common/Utilities/delay.h"
#include "DataDef.h"

#define SYS_CLK_FREQ                120000000

#define PI 3.1415926

#define COMM_MAX_BUFFER_SIZE   6000

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

extern void SysTickHandler(void);

#endif  // INCLUDE_H_
ass="w"> 0x08; Dispenser7Motor.KvalRun = 0x20; Dispenser7Motor.KvalAcc = 0x20; Dispenser7Motor.KvalDec = 0x3ff; Dispenser7Motor.OverCurrentThreshold = 0xF; Dispenser7Motor.StallThreshold = 0x7F; Dispenser7Motor.ThermalCompensationFactor = 0; Dispenser7Motor.LowSpeedOptimization = false; Dispenser7Motor.StSlp = 0x7; Dispenser7Motor.IntSpd = 0x22C5; Dispenser7Motor.FnSlpAcc = 0x15; Dispenser7Motor.FnSlpDec = 0x15; Dispenser7Motor.FsSpd = 0x3ff; UploadHardwareConfigurationRequest uploadHardwareConfigurationRequest = new UploadHardwareConfigurationRequest(); HardwareConfiguration hardwareConfiguration = new HardwareConfiguration(); hardwareConfiguration.Motors.Add(Dispenser7Motor); stubManager.WriteLine("data.data length = " + hardwareConfiguration.CalculateSize()); uploadHardwareConfigurationRequest.HardwareConfiguration = hardwareConfiguration; var response = stubManager.Run<UploadHardwareConfigurationResponse>(uploadHardwareConfigurationRequest); /*Thread.Sleep(5000);*/ var response3 = stubManager.Run<StubValveResponse>("StubValveRequest" ,6, 10, false); var response4 = stubManager.Run<StubMotorRunResponse>("StubMotorRunRequest" ,12, false, 1200); Thread.Sleep(1000); //open valve toward the midtank, stop dispenser 7 //var response3 = stubManager.Run<StubValveResponse>("StubValveRequest" ,6, 10, false); //var response2 = stubManager.Run<StubMotorStopResponse>("StubMotorStopRequest" ,12,2); }