|
Infineon One Point Calibration Library
1.0.1
|
#include "onecalib.h"
Go to the source code of this file.
Functions | |
| void | ONECALIB_InitSensorData (uint32_t sinP_in_LSB, uint32_t cosP_in_LSB, uint32_t sinN_in_LSB, uint32_t cosN_in_LSB) |
| Function used for ANALOG_SENSOR_DATA_t data assignment. More... | |
| void | ONECALIB_InitCalibData (CALIB_DATA_t *calib_param) |
| Function used for CALIB_DATA_t data initialization. The pointer of type CALIB_DATA_t will be used to store calibration parameters. More... | |
| float64_t | ONECALIB_GetAngle (const CALIB_DATA_t *calib_param) |
| Calculates the calibrated angle if calibration has been performed, else the uncalibrated angle. More... | |
| float64_t | ONECALIB_GetUncalibAngle (void) |
| Calculates the uncalibrated angle. More... | |
| float64_t | ONECALIB_GetCalibAngle (const CALIB_DATA_t *calib_param) |
| Calculates the calibrated angle. More... | |
| void | ONECALIB_CalibrationFindParam (CALIB_DATA_t *calib_param, bool rotate_CW, bool rotate_CCW) |
| This function is used to extract the calibration parameters. It should called until calib_param.full_calibration_performed is true. To extract the correct rotation, the input parameter rotate_CW should be true until calib_param.rotation_data_CW.calibration_done is true(while the magnet is spinning in CW direction). Same for the CCW direction. While calib_param.full_calibration_performed is false only the differential uncalibrated angle is available. More... | |
| void ONECALIB_CalibrationFindParam | ( | CALIB_DATA_t * | calib_param, |
| bool | rotate_CW, | ||
| bool | rotate_CCW | ||
| ) |
This function is used to extract the calibration parameters. It should called until calib_param.full_calibration_performed is true. To extract the correct rotation, the input parameter rotate_CW should be true until calib_param.rotation_data_CW.calibration_done is true(while the magnet is spinning in CW direction). Same for the CCW direction. While calib_param.full_calibration_performed is false only the differential uncalibrated angle is available.
This function will extract the maximum, minimum voltage levels, amplitude, offset, and orthogonality. Based on the found values, it will calculate the necessary calibration parameters.
Usage example:
| [in] | calib_param | is a pointer of type CALIB_DATA_t, this structure holds the current sensor calibration parameters. |
| [in] | rotate_CW | is a bool that is true if the rotation is in clockwise direction. |
| [in] | rotate_CCW | is a bool that is true if the rotation is in counter-clockwise direction. |
Definition at line 468 of file onecalib.c.
References ROTATION_DATA_STORE::calibration_done, and CALIB_DATA::rotation_data_CW.
| float64_t ONECALIB_GetAngle | ( | const CALIB_DATA_t * | calib_param | ) |
Calculates the calibrated angle if calibration has been performed, else the uncalibrated angle.
This function checks the stored calibration parameters and returns a angle value, no matter if the calibration procedure has been performed.
| [in] | calib_param | is a pointer of type CALIB_DATA_t, this structure holds the current sensor calibration parameters. |
Definition at line 372 of file onecalib.c.
| float64_t ONECALIB_GetCalibAngle | ( | const CALIB_DATA_t * | calib_param | ) |
Calculates the calibrated angle.
Don't use this if the calibration procedure has not been performed. This function dosen't check the stored calibration parameters and returns the calibrated angle value.
| [in] | calib_param | is a pointer of type CALIB_DATA_t, this structure holds the current sensor calibration parameters. |
Definition at line 414 of file onecalib.c.
| float64_t ONECALIB_GetUncalibAngle | ( | void | ) |
Calculates the uncalibrated angle.
This function uses differential sensor data to extract the angle.
Definition at line 397 of file onecalib.c.
| void ONECALIB_InitCalibData | ( | CALIB_DATA_t * | calib_param | ) |
Function used for CALIB_DATA_t data initialization. The pointer of type CALIB_DATA_t will be used to store calibration parameters.
This function must be called once before ONECALIB_CalibrationFindParam(..).
| [in] | calib_param | is a pointer of type CALIB_DATA_t. |
Definition at line 301 of file onecalib.c.
| void ONECALIB_InitSensorData | ( | uint32_t | sinP_in_LSB, |
| uint32_t | cosP_in_LSB, | ||
| uint32_t | sinN_in_LSB, | ||
| uint32_t | cosN_in_LSB | ||
| ) |
Function used for ANALOG_SENSOR_DATA_t data assignment.
This function must be called after the data readout.
The initialized pointer will be used in the angle calculation and calibration process.
| [in] | cosP_in_LSB | is the sensor value in LSB corresponding to the positive cosinus. |
| [in] | cosN_in_LSB | is the sensor value in LSB corresponding to the negative cosinus. |
| [in] | sinP_in_LSB | is the sensor value in LSB corresponding to the positive sinus. |
| [in] | sinN_in_LSB | is the sensor value in LSB corresponding to the negative sinus. |
Definition at line 242 of file onecalib.c.
1.8.14