/* * -------------------------------------------------------------------------------------- * Company : 江苏中信博新能源科技股份有限公司上海子公司 2020-2021 版权所有 * -------------------------------------------------------------------------------------- * file Name : lib_of_tracker.c * Description : lib-h * -------------------------------------------------------------------------------------- * Tool Versions : uVision V5.29.0.0 * Target Device : STM32F103|GD32F103 * -------------------------------------------------------------------------------------- * Engineer : tangtao * Revision : V0.0 * Created Date : 2021.09.18 * -------------------------------------------------------------------------------------- * Engineer : * Revision : * Modified Date : * Additional Comments : * -------------------------------------------------------------------------------------- */ /************************************************* Function : CRC16() Description : CRC16 Input : *buf, number Output : crc16 Return : unsigned short Engineer : tangtao Revision : V0.0 Modified Date : 2021.09.18 Additional Comments : *************************************************/ unsigned short CRC16_HalfWord(unsigned short *buf, unsigned short num_of_bytes); /************************************************* Function : CRC16_Byte() Description : CRC16_Byte Input : *buf, number Output : crc16 Return : unsigned short Engineer : tangtao Revision : V0.0 Modified Date : 2021.09.18 Additional Comments : *************************************************/ unsigned short CRC16_Byte(unsigned char *buf, unsigned short num_of_bytes); /************************************************* Function : delay_ms() Description : delay_ms Input : time Output : null Return : null Engineer : tangtao Revision : V0.0 Modified Date : 2021.09.23 Additional Comments : *************************************************/ void delay_ms(unsigned short time); /************************************************* Function : CalcAngle() Description : CalcAngle Input : Gx, Ay, Az, Gx_offset Output : angle Return : angle Engineer : tangtao Revision : V0.0 Modified Date : 2021.09.23 Additional Comments : *************************************************/ float CalcAngle(float Gx, float Ay, float Az, float Gx_offset); /************************************************* Function : KalmanFilter() Description : Kalman Input : correct value, angle Output : angle Return : angle Engineer : tangtao Revision : V0.0 Modified Date : 2021.09.23 Additional Comments : *************************************************/ float KalmanFilter(float angle_rate,float accel_angle); /************************************************* Function : Get_Kelvin_Temperature() Description : Get Kelvin Temperature Input : Rntc Output : temperature Return : temperature Engineer : tangtao Revision : V0.0 Modified Date : 2021.09.26 Additional Comments : *************************************************/ float Get_Kelvin_Temperature(float Rntc);