mrangle 2.0.0.0
|
API for configuring and manipulating MR Angle Click driver. More...
Topics | |
MR Angle MikroBUS Map | |
MikroBUS pin mapping of MR Angle Click driver. | |
Functions | |
void | mrangle_cfg_setup (mrangle_cfg_t *cfg) |
MR Angle configuration object setup function. | |
err_t | mrangle_init (mrangle_t *ctx, mrangle_cfg_t *cfg) |
MR Angle initialization function. | |
void | mrangle_default_cfg (mrangle_t *ctx) |
MR Angle default configuration function. | |
void | mrangle_powerdown_mode (mrangle_t *ctx, mrangle_powerdown_mode_value_t pd_mode) |
MR Angle powerdown mode function. | |
void | mrangle_output_mode (mrangle_t *ctx, mrangle_output_mode_value_t output_mode) |
MR Angle output mode function. | |
err_t | mrangle_generic_write (mrangle_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
MR Angle data writing function. | |
err_t | mrangle_generic_read (mrangle_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
MR Angle data reading function. | |
err_t | mrangle_get_adc_sin (mrangle_t *ctx, uint16_t *sin_adc) |
MR Angle get ADC sine function. | |
err_t | mrangle_get_sin (mrangle_t *ctx, float *sin) |
MR Angle get sine function. | |
err_t | mrangle_get_adc_cos (mrangle_t *ctx, uint16_t *cos_adc) |
MR Angle get ADC cosine function. | |
err_t | mrangle_get_cos (mrangle_t *ctx, float *cos) |
MR Angle get cosine function. | |
err_t | mrangle_get_adc_temp (mrangle_t *ctx, uint16_t *temp_adc) |
MR Angle get ADC temperature function. | |
err_t | mrangle_get_temperature (mrangle_t *ctx, float *temperature) |
MR Angle get temperature function. | |
err_t | mrangle_get_angle (mrangle_t *ctx, float *angle) |
MR Angle get angle function. | |
API for configuring and manipulating MR Angle Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void mrangle_cfg_setup | ( | mrangle_cfg_t * | cfg | ) |
MR Angle configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See mrangle_cfg_t object definition for detailed explanation. |
void mrangle_default_cfg | ( | mrangle_t * | ctx | ) |
MR Angle default configuration function.
This function executes a default configuration of MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
err_t mrangle_generic_read | ( | mrangle_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
MR Angle data reading function.
This function reads a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_generic_write | ( | mrangle_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
MR Angle data writing function.
This function writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_get_adc_cos | ( | mrangle_t * | ctx, |
uint16_t * | cos_adc ) |
MR Angle get ADC cosine function.
This function reads a cosine ADC value of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[out] | cos_adc | : Pointer to the memory location of the structure where data be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_get_adc_sin | ( | mrangle_t * | ctx, |
uint16_t * | sin_adc ) |
MR Angle get ADC sine function.
This function reads a sine ADC value of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[out] | sin_adc | : Pointer to the memory location of the structure where data be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_get_adc_temp | ( | mrangle_t * | ctx, |
uint16_t * | temp_adc ) |
MR Angle get ADC temperature function.
This function reads a temperature ADC value of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[out] | temp_adc | : Pointer to the memory location of the structure where data be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_get_angle | ( | mrangle_t * | ctx, |
float * | angle ) |
MR Angle get angle function.
This function reads a angle data ( degree ) of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[out] | angle | : Pointer to the memory location of the structure where data be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_get_cos | ( | mrangle_t * | ctx, |
float * | cos ) |
MR Angle get cosine function.
This function reads a cosine ADC value and calculate cosine output signal amplitude of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[out] | cos | : Pointer to the memory location of the structure where data be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_get_sin | ( | mrangle_t * | ctx, |
float * | sin ) |
MR Angle get sine function.
This function reads a sine ADC value and calculate sine output signal amplitude of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[out] | sin | : Pointer to the memory location of the structure where data be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_get_temperature | ( | mrangle_t * | ctx, |
float * | temperature ) |
MR Angle get temperature function.
This function reads a temperature data ( degree Celsius ) of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[out] | temperature | : Pointer to the memory location of the structure where data be stored. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t mrangle_init | ( | mrangle_t * | ctx, |
mrangle_cfg_t * | cfg ) |
MR Angle initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See mrangle_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void mrangle_output_mode | ( | mrangle_t * | ctx, |
mrangle_output_mode_value_t | output_mode ) |
MR Angle output mode function.
This function output mode switches to the desired device output mode sine and cosine output mode or temperature output mode of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[in] | output_mode | : Enum values for data output mode. |
void mrangle_powerdown_mode | ( | mrangle_t * | ctx, |
mrangle_powerdown_mode_value_t | pd_mode ) |
MR Angle powerdown mode function.
This function powerdown mode switches the device into Power-down mode or Power-up mode of the KMZ60 Angle sensor with integrated amplifier on the MR Angle click board™.
[in] | ctx | : Click context object. See mrangle_t object definition for detailed explanation. |
[in] | pd_mode | : Enum values for powerdown mode. |