From 27c282a58ad55ad6bced8ec979cf5f84780db80e Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 29 Oct 2021 11:37:03 +0200 Subject: [PATCH] include/industry/foc/*/foc_angle.h: add a field with angle type --- include/industry/foc/fixed16/foc_angle.h | 4 +++- include/industry/foc/float/foc_angle.h | 4 +++- include/industry/foc/foc_common.h | 9 +++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/industry/foc/fixed16/foc_angle.h b/include/industry/foc/fixed16/foc_angle.h index 02abb0d32..28fad7a52 100644 --- a/include/industry/foc/fixed16/foc_angle.h +++ b/include/industry/foc/fixed16/foc_angle.h @@ -30,6 +30,7 @@ #include #include "industry/foc/fixed16/foc_handler.h" +#include "industry/foc/foc_common.h" /**************************************************************************** * Public Type Definition @@ -49,7 +50,8 @@ struct foc_angle_in_b16_s struct foc_angle_out_b16_s { - b16_t angle; + uint8_t type; /* Angle type */ + b16_t angle; /* Agnle */ }; /* Forward declaration */ diff --git a/include/industry/foc/float/foc_angle.h b/include/industry/foc/float/foc_angle.h index 2076dfa04..1ffb53416 100644 --- a/include/industry/foc/float/foc_angle.h +++ b/include/industry/foc/float/foc_angle.h @@ -30,6 +30,7 @@ #include #include "industry/foc/float/foc_handler.h" +#include "industry/foc/foc_common.h" /**************************************************************************** * Public Type Definition @@ -49,7 +50,8 @@ struct foc_angle_in_f32_s struct foc_angle_out_f32_s { - float angle; + uint8_t type; /* Angle type */ + float angle; /* Angle */ }; /* Forward declaration */ diff --git a/include/industry/foc/foc_common.h b/include/industry/foc/foc_common.h index d474e9cb0..fa50f5dab 100644 --- a/include/industry/foc/foc_common.h +++ b/include/industry/foc/foc_common.h @@ -71,6 +71,15 @@ enum foc_ramp_mode_e RAMP_MODE_NORMAL = 3, /* Normal operation */ }; +/* Angle handler type */ + +enum foc_angle_type_e +{ + FOC_ANGLE_TYPE_INVALID = 0, /* Reserved */ + FOC_ANGLE_TYPE_ELE = 1, /* Electrical angle */ + FOC_ANGLE_TYPE_MECH = 2, /* Mechanical angle */ +}; + /**************************************************************************** * Public Function Prototypes ****************************************************************************/