20#define JUDGE_AVAILABLE(x, minimum, maximum) if (x > maximum || x < minimum) \
28 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL};
38 buffer[10] = 0xA5A5A5A5UL;
79 fmc_flag_clear(FMC_FLAG_END | FMC_FLAG_WPERR | FMC_FLAG_PGERR);
83 fmc_flag_clear(FMC_FLAG_END | FMC_FLAG_WPERR | FMC_FLAG_PGERR);
100 for (
unsigned char data_cnt = 0; data_cnt < counter; data_cnt++) {
102 fmc_flag_clear(FMC_FLAG_END | FMC_FLAG_WPERR | FMC_FLAG_PGERR);
117 unsigned int *ptrd = (
unsigned int *) addr;
#define FMC_WRITE_START_ADDR
User flash space start address, 1KB user flash.
volatile unsigned short machine_angle_offset
mechanical angle offset, which is used to align the mechanical angle with the zero point of the elect...
#define JUDGE_AVAILABLE(x, minimum, maximum)
determine whether the read-out variable is within the trusted range
unsigned int flash_read_word(unsigned int addr)
read flash word from address
void flash_write_parameters(void)
program all parameters to flash
void flash_read_parameters(void)
read all parameters from flash
void flash_erase_page(void)
erase flash page in last sector
void flash_program_word(unsigned int addr, unsigned int *data, unsigned char counter)
program flash word to address
unsigned char foc_parameter_available_flag
flag variable for FOC parameter availability
volatile unsigned char phase_sequence
motor phase sequence flag variable
main function Header File
unsigned char pid_parameter_available_flag
flag variable for PID parameter availability
volatile PID_Structure_t angle_pid_handler
algorithm handler of PID angle loop
volatile PID_Structure_t speed_pid_handler
algorithm handler of PID speed loop
float ki
integral term coefficient in PID
float kp
proportional term coefficient in PID
float sum_maximum
maximum of anti saturation integral in PID
float kd
differential term coefficient in PID
unsigned int float_to_int32(float data0)
convert floating point numbers to int32 type data
float int32_to_float(unsigned int data0)
convert int32 to floating point numbers type data