flash based config testing

Dependencies:   mbed

Committer:
bwang
Date:
Thu Mar 02 07:36:56 2017 +0000
Revision:
2:cfc39b0843ae
Parent:
1:df6bbacb7bb9
Child:
3:82c00c8e2cb4
stubs for run/cfg mode

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bwang 0:941e150e78b6 1 #ifndef __CONFIG_H
bwang 0:941e150e78b6 2 #define __CONFIG_H
bwang 0:941e150e78b6 3
bwang 1:df6bbacb7bb9 4 #include "mbed.h"
bwang 1:df6bbacb7bb9 5
bwang 0:941e150e78b6 6 /*---driving---*/
bwang 0:941e150e78b6 7 #define _TORQUE_MODE __int_reg[0]
bwang 0:941e150e78b6 8 #define _MAX_TQPCT_PLUS __float_reg[0]
bwang 0:941e150e78b6 9 #define _MAX_TQPCT_MINUS __float_reg[1]
bwang 0:941e150e78b6 10 #define _TORQUE_MAX __float_reg[2]
bwang 0:941e150e78b6 11 #define _W_MAX __float_reg[3]
bwang 0:941e150e78b6 12
bwang 0:941e150e78b6 13 /*---inverter---*/
bwang 0:941e150e78b6 14 #define _BUS_VOLTAGE __float_reg[4]
bwang 0:941e150e78b6 15 #define _F_SW __float_reg[5]
bwang 0:941e150e78b6 16
bwang 0:941e150e78b6 17 /*---logging---*/
bwang 0:941e150e78b6 18 #define _ENABLE_LOGGING __int_reg[1]
bwang 0:941e150e78b6 19 #define _LOG_FREQUENCY __float_reg[6]
bwang 0:941e150e78b6 20
bwang 0:941e150e78b6 21 /*---loop---*/
bwang 0:941e150e78b6 22 #define _K_LOOP_D __float_reg[7]
bwang 0:941e150e78b6 23 #define _KI_BASE_D __float_reg[8]
bwang 0:941e150e78b6 24
bwang 0:941e150e78b6 25 #define _K_LOOP_Q __float_reg[9]
bwang 0:941e150e78b6 26 #define _KI_BASE_Q __float_reg[10]
bwang 0:941e150e78b6 27
bwang 0:941e150e78b6 28 #define _F_SLOW_LOOP __float_reg[11]
bwang 0:941e150e78b6 29
bwang 0:941e150e78b6 30 #define _INTEGRAL_MAX __float_reg[12]
bwang 0:941e150e78b6 31
bwang 0:941e150e78b6 32 #define _W_FILTER_STRENGTH __float_reg[13]
bwang 0:941e150e78b6 33 #define _DQ_FILTER_STRENGTH __float_reg[14]
bwang 0:941e150e78b6 34 #define _THROTTLE_FILTER_STRENGTH __float_reg[15]
bwang 0:941e150e78b6 35
bwang 0:941e150e78b6 36 #define _KP_D __float_reg[17]
bwang 0:941e150e78b6 37 #define _KI_D __float_reg[18]
bwang 0:941e150e78b6 38
bwang 0:941e150e78b6 39 #define _KP_Q __float_reg[19]
bwang 0:941e150e78b6 40 #define _KI_Q __float_reg[20]
bwang 0:941e150e78b6 41
bwang 0:941e150e78b6 42 #define _SLOW_LOOP_COUNTER __float_reg[21]
bwang 0:941e150e78b6 43
bwang 0:941e150e78b6 44 /*---motor---*/
bwang 0:941e150e78b6 45 #define _POLE_PAIRS __float_reg[22]
bwang 0:941e150e78b6 46 #define _POS_OFFSET __float_reg[23]
bwang 0:941e150e78b6 47 #define _RESOLVER_LOBES __float_reg[24]
bwang 0:941e150e78b6 48 #define _CPR __int_reg[2]
bwang 0:941e150e78b6 49 #define _Ld __float_reg[25]
bwang 0:941e150e78b6 50 #define _Lq __float_reg[26]
bwang 0:941e150e78b6 51 #define _FLUX_LINKAGE __float_reg[27]
bwang 0:941e150e78b6 52 #define _Rs __float_reg[28]
bwang 0:941e150e78b6 53 #define _KT __float_reg[29]
bwang 0:941e150e78b6 54 #define _W_SAFE __float_reg[30]
bwang 0:941e150e78b6 55 #define _W_CRAZY __float_reg[31]
bwang 0:941e150e78b6 56
bwang 0:941e150e78b6 57 /*---rc_throttle---*/
bwang 0:941e150e78b6 58 #define _TH_LIMIT_LOW __int_reg[3]
bwang 0:941e150e78b6 59 #define _TH_LIMIT_HIGH __int_reg[4]
bwang 0:941e150e78b6 60 #define _TH_LIMIT_CRAZY __int_reg[5]
bwang 0:941e150e78b6 61
bwang 0:941e150e78b6 62 /*---table---*/
bwang 0:941e150e78b6 63 #define _ROWS __int_reg[6]
bwang 0:941e150e78b6 64 #define _COLUMNS __int_reg[7]
bwang 0:941e150e78b6 65 #define _W_STEP __float_reg[8]
bwang 0:941e150e78b6 66
bwang 0:941e150e78b6 67 /*internal variables and macros*/
bwang 0:941e150e78b6 68
bwang 0:941e150e78b6 69 extern float __float_reg[];
bwang 0:941e150e78b6 70 extern int __int_reg[];
bwang 0:941e150e78b6 71
bwang 0:941e150e78b6 72 #define DEFAULT(a) _##a = a
bwang 1:df6bbacb7bb9 73 #define FPRINT(a) pc->printf("%s: %f\n", #a, _##a)
bwang 1:df6bbacb7bb9 74 #define DPRINT(a) pc->printf("%s: %d\n", #a, _##a)
bwang 0:941e150e78b6 75
bwang 2:cfc39b0843ae 76 #define MODE_RUN 0
bwang 2:cfc39b0843ae 77 #define MODE_CFG 1
bwang 2:cfc39b0843ae 78
bwang 0:941e150e78b6 79 #endif