|
Infineon OnGoing Calibration Library
1.0.1
|
#include "ongocalib.h"
Go to the source code of this file.
Functions | |
| void | ONGO_InitSensorData (uint32_t sinP_in_LSB, uint32_t cosP_in_LSB, uint32_t sinN_in_LSB, uint32_t cosN_in_LSB) |
| Function used for ONGO_ANALOG_SENSOR_DATA_t data assignment. More... | |
| void | ONGO_InitCalibData (ONGO_CALIB_DATA_t *calib_param, int32_t max_diff_sin_LSB, int32_t max_diff_cos_LSB, int32_t min_diff_sin_LSB, int32_t min_diff_cos_LSB, float64_t sin_45, float64_t cos_45, float64_t sin_135, float64_t cos_135) |
| Function used for ONGO_CALIB_DATA_t data initialization. The pointer of type ONGO_CALIB_DATA_t will be used to store calibration parameters. More... | |
| void | ONGO_InitCalibData2 (ONGO_CALIB_DATA_t *calib_param, int32_t max_SinP_LSB, int32_t max_CosP_LSB, int32_t max_SinN_LSB, int32_t max_CosN_LSB, int32_t min_SinP_LSB, int32_t min_CosP_LSB, int32_t min_SinN_LSB, int32_t min_CosN_LSB, float64_t sin_45, float64_t cos_45, float64_t sin_135, float64_t cos_135) |
| Function used for ONGO_CALIB_DATA_t data initialization. The pointer of type ONGO_CALIB_DATA_t will be used to store calibration parameters. More... | |
| float64_t | ONGO_GetUncalibAngle (void) |
| Calculates the uncalibrated angle. More... | |
| float64_t | ONGO_GetCalibAngle (const ONGO_CALIB_DATA_t *calib_param) |
| Calculates the calibrated angle. More... | |
| void | ONGO_CalibrationFindParam (ONGO_CALIB_DATA_t *calib_param) |
| This function is used to find new calibration parameters. More... | |
| void ONGO_CalibrationFindParam | ( | ONGO_CALIB_DATA_t * | calib_param | ) |
This function is used to find new calibration parameters.
When new calibration parameters have been found, this function will do mathematical calculations, which will take more time for one moment. 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.
| [in] | calib_param | is a pointer of type ONGO_CALIB_DATA_t, this structure holds the current sensor calibration parameters. |
Definition at line 353 of file ongocalib.c.
| float64_t ONGO_GetCalibAngle | ( | const ONGO_CALIB_DATA_t * | calib_param | ) |
Calculates the calibrated angle.
| [in] | calib_param | is a pointer of type ONGO_CALIB_DATA_t, this structure holds the current sensor calibration parameters. |
Definition at line 337 of file ongocalib.c.
| float64_t ONGO_GetUncalibAngle | ( | void | ) |
Calculates the uncalibrated angle.
This function uses differential sensor data to extract the angle.
Definition at line 325 of file ongocalib.c.
| void ONGO_InitCalibData | ( | ONGO_CALIB_DATA_t * | calib_param, |
| int32_t | max_diff_sin_LSB, | ||
| int32_t | max_diff_cos_LSB, | ||
| int32_t | min_diff_sin_LSB, | ||
| int32_t | min_diff_cos_LSB, | ||
| float64_t | sin_45, | ||
| float64_t | cos_45, | ||
| float64_t | sin_135, | ||
| float64_t | cos_135 | ||
| ) |
Function used for ONGO_CALIB_DATA_t data initialization. The pointer of type ONGO_CALIB_DATA_t will be used to store calibration parameters.
This function must be called once before ONGO_CalibrationFindParam(..). Use this or ONGO_InitCalibData2(..).
| [in] | calib_param | is a pointer of type ONGO_CALIB_DATA_t. |
| [in] | max_diff_sin_LSB | is the maximum differential sin signal in LSB. |
| [in] | max_diff_cos_LSB | is the maximum differential cos signal in LSB. |
| [in] | min_diff_sin_LSB | is the minimum differential sin signal in LSB. |
| [in] | min_diff_cos_LSB | is the minimum differential cos signal in LSB. |
| [in] | sin_45 | is the differential sin component in LSB at a 45 deg position. |
| [in] | cos_45 | is the differential cos component in LSB at a 45 deg position. |
| [in] | sin_135 | is the differential sin component in LSB at a 135 deg position. |
| [in] | cos_135 | is the differential cos component in LSB at a 135 deg position. |
Definition at line 200 of file ongocalib.c.
References ONGO_ROTATION_DATA_STORE::angle135found, ONGO_ROTATION_DATA_STORE::angle45found, ONGO_ROTATION_DATA_STORE::maxCos, ONGO_ROTATION_DATA_STORE::maxSin, ONGO_ROTATION_DATA_STORE::minCos, ONGO_ROTATION_DATA_STORE::minSin, ONGO_ROTATION_DATA_STORE::nr_valid_rotations, ONGO_CALIB_DATA::rotation_data, ONGO_ROTATION_DATA_STORE::X135, ONGO_ROTATION_DATA_STORE::X45, ONGO_ROTATION_DATA_STORE::Y135, and ONGO_ROTATION_DATA_STORE::Y45.
| void ONGO_InitCalibData2 | ( | ONGO_CALIB_DATA_t * | calib_param, |
| int32_t | max_SinP_LSB, | ||
| int32_t | max_CosP_LSB, | ||
| int32_t | max_SinN_LSB, | ||
| int32_t | max_CosN_LSB, | ||
| int32_t | min_SinP_LSB, | ||
| int32_t | min_CosP_LSB, | ||
| int32_t | min_SinN_LSB, | ||
| int32_t | min_CosN_LSB, | ||
| float64_t | sin_45, | ||
| float64_t | cos_45, | ||
| float64_t | sin_135, | ||
| float64_t | cos_135 | ||
| ) |
Function used for ONGO_CALIB_DATA_t data initialization. The pointer of type ONGO_CALIB_DATA_t will be used to store calibration parameters.
This function must be called once before ONGO_CalibrationFindParam(..). Use this or ONGO_InitCalibData(..).
| [in] | calib_param | is a pointer of type ONGO_CALIB_DATA_t. |
| [in] | max_SinP_LSB | is the maximum P channel sin signal in LSB. |
| [in] | max_CosP_LSB | is the maximum P channel cos signal in LSB. |
| [in] | max_SinN_LSB | is the maximum N channel sin signal in LSB. |
| [in] | max_CosN_LSB | is the maximum N channel cos signal in LSB. |
| [in] | min_SinP_LSB | is the minimum P channel sin signal in LSB. |
| [in] | min_CosP_LSB | is the minimum P channel cos signal in LSB. |
| [in] | min_SinN_LSB | is the minimum N channel sin signal in LSB. |
| [in] | min_CosN_LSB | is the minimum N channel cos signal in LSB. |
| [in] | sin_45 | is the differential sin component in LSB at a 45 deg position. |
| [in] | cos_45 | is the differential cos component in LSB at a 45 deg position. |
| [in] | sin_135 | is the differential sin component in LSB at a 135 deg position. |
| [in] | cos_135 | is the differential cos component in LSB at a 135 deg position. |
Definition at line 258 of file ongocalib.c.
References ONGO_ROTATION_DATA_STORE::angle135found, ONGO_ROTATION_DATA_STORE::angle45found, ONGO_ROTATION_DATA_STORE::maxCos, ONGO_ROTATION_DATA_STORE::maxSin, ONGO_ROTATION_DATA_STORE::minCos, ONGO_ROTATION_DATA_STORE::minSin, ONGO_ROTATION_DATA_STORE::nr_valid_rotations, ONGO_CALIB_DATA::rotation_data, ONGO_ROTATION_DATA_STORE::X135, ONGO_ROTATION_DATA_STORE::X45, ONGO_ROTATION_DATA_STORE::Y135, and ONGO_ROTATION_DATA_STORE::Y45.
| void ONGO_InitSensorData | ( | uint32_t | sinP_in_LSB, |
| uint32_t | cosP_in_LSB, | ||
| uint32_t | sinN_in_LSB, | ||
| uint32_t | cosN_in_LSB | ||
| ) |
Function used for ONGO_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 164 of file ongocalib.c.
1.8.14