brazos-trapezoidal
API023MotorControl.h
Go to the documentation of this file.
1
11#ifndef TSP_API023MOTORCONTROL_API023MOTORCONTROL_H_
12#define TSP_API023MOTORCONTROL_API023MOTORCONTROL_H_
13
14#include "Tsp.h"
16#include "mc_types.h"
17//=====================================================================================================================
18//-------------------------------------- PUBLIC (Extern Variables, Constants & Defines) -------------------------------
19//=====================================================================================================================
20
21#define MOTORCONTROL_API 23
22
23
24typedef enum
25{
26 API023_RUN_MOTOR = 1,
27 API023_STOP_MOTOR = 2,
28 API023_GET_DATA = 3,
29 API023_SEND_DATA = 4,
30 API023_PUBLISH_ERROR = 5,
31 API023_RUN_ALGORITHM = 6,
32 API023_ALGORITHM_RESULT = 7,
33 API023_RESET_CTR_VAR = 8,
34 API023_RESET_FLASH_PARAM = 9,
35 API023_CMD_FEEDBACK = 17
36}API023_MOTORCONTROL_TYPE;
37
38typedef enum
39{
40 API023_DATA_SPEEDREF = 0,
41 API023_DATA_SPEEDMEAS = 1,
42 API023_DATA_ACCEL = 2,
43 API023_DATA_BUS_VOLTAGE = 3,
44 API023_DATA_BUS_CURRENT = 4,
45 API023_DATA_IRMS_U = 5,
46 API023_DATA_IRMS_V = 6,
47 API023_DATA_IRMS_W = 7,
48 API023_DATA_INV_TEMP = 8,
49 API023_DATA_MOTOR_TEMP = 9,
50 API023_DATA_MOTOR_RESIST = 10,
51 API023_DATA_MTR_AVG_POWER = 11,
52 API023_DATA_MTR_AVG_CURRENT = 12,
53 API023_DATA_DIGITAL = 13,
54 API023_DATA_MODULATION_INDEX = 14,
55 API023_DATA_POWER_ESTIMATION = 15,
56 API023_DATA_NUM
57}API023_DATA_TYPE;
58
59typedef struct
60{
61 unsigned char byte;
62 struct
63 {
64 unsigned char ismotorrunning :1;
65 unsigned char ismotorattarget :1;
66 unsigned char overtemp1 :1;
67 unsigned char overtemp2 :1;
68 unsigned char unused :4;
69 }bit;
71
72typedef enum
73{
74 API023_SETDIGITAL_RESETPARAM = 0,
75 API023_SETDIGITAL_NUM
76}API023_SETDIGITAL_TYPE;
77
78typedef enum
79{
80 API023_ALGO_RESISTANCE = 0,
81 API023_ALGO_LOADSENSING = 1,
82 API023_ALGO_UNBALANCE = 2,
83 API023_ALGO_INSTABILITY = 3,
84 API023_ALGO_NUM
85}API023_ALGO_TYPE;
86
87typedef enum
88{
89 API023_CMD_NOTDEFINED = 0,
90 API023_CMD_ACCEPTED = 1,
91 API023_CMD_NOTACCEPTED = 2,
92 API023_CMD_WAITING = 3,
93 API023_CMD_NUM
94}API023_CMD_TYPE;
95
96typedef struct
97{
98 API023_DATA_TYPE datatype2send[API023_DATA_NUM];
99 uint8_t numberdata2send;
100 uint16_t datarate;
102
103//=====================================================================================================================
104//-------------------------------------- PUBLIC (Function Prototypes) -------------------------------------------------
105//=====================================================================================================================
109void API023MotorControl__CmdAccepted(uint8_t accepted, API023_MOTORCONTROL_TYPE cmd_id);
110#endif // TSP_API023MOTORCONTROL_API023MOTORCONTROL_H_
111
112
void API023MotorControl__CmdAccepted(uint8_t accepted, API023_MOTORCONTROL_TYPE cmd_id)
Sends the command feedback.
void API023MotorControl__Handler(void)
API0023 Handler.
void API023MotorControl__ReceiveParser(TSP_TYPE *message)
Method to handle the received messages for this API.
void API023MotorControl__Initialize(void)
It Initializes the module API023MotorControl and its variables.
Header file for API023MotorControl_prm.h.c.
Header file of Tsp.
Contains generic typedefs that are able to change in case of different processors.
Definition: Tsp.h:23