270 lines
3.8 KiB
C
270 lines
3.8 KiB
C
|
|
#include "DSP281x_Device.h"
|
|
|
|
#include "vector.h"
|
|
#include "v_rotor.h"
|
|
//#include "xp_rotation_sensor.h"
|
|
#include "log_to_mem.h"
|
|
#include "main_matlab.h"
|
|
#include "xp_project.h"
|
|
|
|
// #define PROJECT_DEFAULTS2 {
|
|
// (void (*)(Uint32))project_read_all_pbus2 \
|
|
// }
|
|
// typedef struct TS_project{
|
|
// void (*read_all_pbus)();
|
|
// } T_project2;
|
|
|
|
|
|
T_project project = {0};
|
|
|
|
#pragma DATA_SECTION(modbus_table_in,".logs");
|
|
MODBUS_REG_STRUCT modbus_table_in[1024];
|
|
|
|
|
|
#pragma DATA_SECTION(modbus_table_out,".logs");
|
|
MODBUS_REG_STRUCT modbus_table_out[1024];
|
|
|
|
FLAG f;
|
|
WINDING a;
|
|
EDRK edrk = EDRK_DEFAULT;
|
|
|
|
//T_rotation_sensor rotation_sensor = T_CDS_ROTATION_SENSOR_DEFAULTS;
|
|
int Unites[128][256];
|
|
|
|
|
|
_iq temperature_limit_koeff = _IQ(1.0);
|
|
|
|
|
|
void project_read_all_pbus2()
|
|
{
|
|
|
|
}
|
|
|
|
#pragma DATA_SECTION(logpar, ".fast_vars1");
|
|
LOGSPARAMS logpar = LOGSPARAMS_DEFAULTS;
|
|
int LOAG[10];
|
|
float logpar_matlab[50];
|
|
|
|
#pragma DATA_SECTION(break_result_1,".fast_vars");
|
|
_iq break_result_1 = 0;
|
|
|
|
#pragma DATA_SECTION(break_result_2,".fast_vars");
|
|
_iq break_result_2 = 0;
|
|
|
|
#pragma DATA_SECTION(break_result_3,".fast_vars");
|
|
_iq break_result_3 = 0;
|
|
|
|
#pragma DATA_SECTION(break_result_4,".fast_vars");
|
|
_iq break_result_4 = 0;
|
|
|
|
//void read_in_sensor_line1(T_cds_in_rotation_sensor *rs){
|
|
//
|
|
//}
|
|
//
|
|
//void read_in_sensor_line2(T_cds_in_rotation_sensor *rs){
|
|
//
|
|
//}
|
|
//void read_command_reg(T_cds_in_rotation_sensor *rs){
|
|
//
|
|
//}
|
|
//void write_command_reg(T_cds_in_rotation_sensor *rs){
|
|
//
|
|
//}
|
|
//void tune_sampling_time(T_rotation_sensor *rs){
|
|
//
|
|
//}
|
|
//void wait_for_registers_updated(T_cds_in_rotation_sensor *rs){
|
|
//
|
|
//}
|
|
//void read_direction_in_plane(T_cds_in_rotation_sensor *rs){
|
|
//
|
|
//}
|
|
//void sensor_set(T_rotation_sensor *rs)
|
|
//{
|
|
//
|
|
//}
|
|
//void sensor_read(T_rotation_sensor *rs)
|
|
//{
|
|
//
|
|
//}
|
|
//void update_sensors_data(T_rotation_sensor *rs)
|
|
//{
|
|
// // rs->in_plane.write.regs.comand_reg.bit.update_registers = 1;
|
|
// // write_command_reg(&rs->in_plane);
|
|
//// rs->in_plane.write.regs.comand_reg.bit.update_registers = 0;
|
|
//}
|
|
//void angle_sensor_read(T_cds_angle_sensor *as)
|
|
//{}
|
|
//
|
|
//void angle_plane_set(T_cds_angle_sensor *rs)
|
|
//{}
|
|
//void in_plane_set(T_cds_in_rotation_sensor* rs)
|
|
//{}
|
|
//
|
|
//void in_sensor_read1(T_cds_in_rotation_sensor *rs)
|
|
//{}
|
|
//
|
|
//void in_sensor_read2(T_cds_in_rotation_sensor *rs)
|
|
//{}
|
|
|
|
|
|
|
|
|
|
// unsigned int BWC_Started()
|
|
// {
|
|
|
|
// }
|
|
|
|
void inc_RS_timeout_cicle(void)
|
|
{
|
|
|
|
}
|
|
|
|
void inc_CAN_timeout_cicle(void)
|
|
{
|
|
|
|
}
|
|
|
|
void pause_1000(void)
|
|
{
|
|
|
|
}
|
|
|
|
int xerror(unsigned int er_ID, void* CallBackRef)
|
|
{
|
|
};
|
|
unsigned int ReadMemory(unsigned long addr)
|
|
{
|
|
return (*(volatile int *)(addr));
|
|
}
|
|
|
|
|
|
void WriteMemory(unsigned long addr, unsigned int data)
|
|
{
|
|
(*(volatile int *)( addr )) = data;
|
|
}
|
|
|
|
void start_pwm(void)
|
|
{
|
|
// mPWM_a = 1;
|
|
// mPWM_b = 1;
|
|
}
|
|
|
|
void stop_pwm(void)
|
|
{
|
|
// mPWM_a = 0;
|
|
// mPWM_b = 0;
|
|
|
|
// svgen_set_time_keys_closed(&svgen_pwm24_1);
|
|
// svgen_set_time_keys_closed(&svgen_pwm24_2);
|
|
// WriteMemory(ADR_TK_MASK_0, 0xFFFF);
|
|
// WriteMemory(ADR_PWM_START_STOP, 0x8000);
|
|
}
|
|
void start_break_pwm() {
|
|
|
|
}
|
|
|
|
|
|
void stop_break_pwm() {
|
|
|
|
}
|
|
|
|
void start_pwm_b() {
|
|
|
|
}
|
|
void start_pwm_a() {
|
|
|
|
}
|
|
void stop_pwm_b() {
|
|
|
|
}
|
|
void stop_pwm_a() {
|
|
|
|
}
|
|
|
|
void fillADClogs() {
|
|
|
|
}
|
|
void break_resistor_managment_calc(){
|
|
|
|
}
|
|
|
|
|
|
void break_resistor_managment_init(){
|
|
|
|
}
|
|
|
|
|
|
void break_resistor_managment_update(){
|
|
|
|
}
|
|
|
|
|
|
void break_resistor_recup_calc(){
|
|
|
|
}
|
|
|
|
|
|
void break_resistor_set_closed(){
|
|
|
|
}
|
|
|
|
|
|
void DetectI_Out_BreakFase(){
|
|
|
|
}
|
|
|
|
|
|
void test_mem_limit(){
|
|
|
|
}
|
|
|
|
|
|
void set_start_mem(){
|
|
|
|
}
|
|
|
|
|
|
void getFastLogs(){
|
|
|
|
}
|
|
|
|
|
|
//void detect_I_M_overload{
|
|
//
|
|
// }
|
|
|
|
|
|
void sync_inc_error(){
|
|
|
|
}
|
|
|
|
|
|
void optical_bus_read(){
|
|
|
|
}
|
|
|
|
|
|
void optical_bus_write(void){
|
|
|
|
}
|
|
|
|
|
|
void init_flag_a(void)
|
|
{
|
|
|
|
unsigned int i = 0;
|
|
int *pStr = (int*)&f;
|
|
for (i = 0; i < sizeof(f) / sizeof(int); i++) {
|
|
*(pStr + i) = 0;
|
|
}
|
|
|
|
*pStr = (int*)&a;
|
|
for (i = 0; i < sizeof(a) / sizeof(int); i++) {
|
|
*(pStr + i) = 0;
|
|
}
|
|
|
|
|
|
}
|