magneto13 2.1.0.0
|
API for configuring and manipulating Magneto 13 Click driver. More...
Topics | |
Magneto 13 Registers List | |
List of registers of Magneto 13 Click driver. | |
Magneto 13 Registers Settings | |
Settings for registers of Magneto 13 Click driver. | |
Magneto 13 MikroBUS Map | |
MikroBUS pin mapping of Magneto 13 Click driver. | |
Magneto13_cmd | |
Functions | |
void | magneto13_cfg_setup (magneto13_cfg_t *cfg) |
Magneto 13 configuration object setup function. | |
err_t | magneto13_init (magneto13_t *ctx, magneto13_cfg_t *cfg) |
Magneto 13 initialization function. | |
err_t | magneto13_default_cfg (magneto13_t *ctx) |
Magneto 13 default configuration function. | |
err_t | magneto13_write_reg (magneto13_t *ctx, uint8_t cmd, uint8_t reg, uint8_t data_in) |
Magneto 13 data writing function. | |
err_t | magneto13_read_reg (magneto13_t *ctx, uint8_t cmd, uint8_t reg, uint8_t *data_out) |
Magneto 13 data reading function. | |
err_t | magneto13_get_angle_raw_data (magneto13_t *ctx, uint16_t *raw_data) |
Magneto 13 gets the angle raw data function. | |
err_t | magneto13_get_angle (magneto13_t *ctx, float *angle) |
Magneto 13 gets the angular position function. | |
err_t | magneto13_set_mag_field_thd (magneto13_t *ctx, uint8_t mglt, uint8_t mght) |
Magneto 13 sets the magnetic field threshold function. | |
err_t | magneto13_enable_fld_thd_det (magneto13_t *ctx) |
Magneto 13 enables the magnetic field threshold detection function. | |
err_t | magneto13_get_field_strength (magneto13_t *ctx, uint8_t *field_strength) |
Magneto 13 gets the magnetic field strength function. | |
uint8_t | magneto13_get_error_flag (magneto13_t *ctx) |
Magneto 13 gets the error flag function. | |
uint8_t | magneto13_get_nvm_access_state (magneto13_t *ctx) |
Magneto 13 checks the access to the NVM function. | |
uint8_t | magneto13_get_interrupt (magneto13_t *ctx) |
Magneto 13 gets the interrupt on the angle change state function. | |
API for configuring and manipulating Magneto 13 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void magneto13_cfg_setup | ( | magneto13_cfg_t * | cfg | ) |
Magneto 13 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneto13_cfg_t object definition for detailed explanation. |
err_t magneto13_default_cfg | ( | magneto13_t * | ctx | ) |
Magneto 13 default configuration function.
This function executes a default configuration of Magneto 13 click board.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto13_enable_fld_thd_det | ( | magneto13_t * | ctx | ) |
Magneto 13 enables the magnetic field threshold detection function.
This function activates the magnetic field threshold detection of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto13_get_angle | ( | magneto13_t * | ctx, |
float * | angle ) |
Magneto 13 gets the angular position function.
This function reads an angular position in degrees of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
[out] | angle | : Angle data, degrees [0-360]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto13_get_angle_raw_data | ( | magneto13_t * | ctx, |
uint16_t * | raw_data ) |
Magneto 13 gets the angle raw data function.
This function reads a 16-bit angle raw data of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
[out] | raw_data | : Angle raw data [0-65535]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t magneto13_get_error_flag | ( | magneto13_t * | ctx | ) |
Magneto 13 gets the error flag function.
This function gets states of the error flag ( ERR ) pin of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. err_t magneto13_get_field_strength | ( | magneto13_t * | ctx, |
uint8_t * | field_strength ) |
Magneto 13 gets the magnetic field strength function.
This function reads a magnetic field strength detection of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
[out] | field_strength | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t magneto13_get_interrupt | ( | magneto13_t * | ctx | ) |
Magneto 13 gets the interrupt on the angle change state function.
This function indicates whether the angle change has exceeded the defined threshold of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. uint8_t magneto13_get_nvm_access_state | ( | magneto13_t * | ctx | ) |
Magneto 13 checks the access to the NVM function.
This function indicates whether the chip is busy accessing the NVM of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. err_t magneto13_init | ( | magneto13_t * | ctx, |
magneto13_cfg_t * | cfg ) |
Magneto 13 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneto13_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto13_read_reg | ( | magneto13_t * | ctx, |
uint8_t | cmd, | ||
uint8_t | reg, | ||
uint8_t * | data_out ) |
Magneto 13 data reading function.
This function reads a data byte from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
[in] | cmd | : Command. |
[in] | reg | : Register address |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto13_set_mag_field_thd | ( | magneto13_t * | ctx, |
uint8_t | mglt, | ||
uint8_t | mght ) |
Magneto 13 sets the magnetic field threshold function.
This function sets the magnetic field's high and low thresholds of the MagAlpha MA736, Contactless Digital Angle Sensor on the Magneto 13 Click board™.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
[in] | mglt | : Sets the field strength low threshold. |
[in] | mght | : Sets the field strength high threshold. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto13_write_reg | ( | magneto13_t * | ctx, |
uint8_t | cmd, | ||
uint8_t | reg, | ||
uint8_t | data_in ) |
Magneto 13 data writing function.
This function writes a data byte to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See magneto13_t object definition for detailed explanation. |
[in] | cmd | : Command. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.