magneto14 2.1.0.0
|
API for configuring and manipulating Magneto 14 Click driver. More...
Topics | |
Magneto 14 Registers List | |
List of registers of Magneto 14 Click driver. | |
Magneto 14 Registers Settings | |
Settings for registers of Magneto 14 Click driver. | |
Magneto 14 MikroBUS Map | |
MikroBUS pin mapping of Magneto 14 Click driver. | |
Magneto14_cmd | |
Functions | |
void | magneto14_cfg_setup (magneto14_cfg_t *cfg) |
Magneto 14 configuration object setup function. | |
err_t | magneto14_init (magneto14_t *ctx, magneto14_cfg_t *cfg) |
Magneto 14 initialization function. | |
err_t | magneto14_default_cfg (magneto14_t *ctx) |
Magneto 14 default configuration function. | |
err_t | magneto14_write_reg (magneto14_t *ctx, uint8_t cmd, uint8_t reg, uint8_t data_in) |
Magneto 14 data writing function. | |
err_t | magneto14_read_reg (magneto14_t *ctx, uint8_t cmd, uint8_t reg, uint8_t *data_out) |
Magneto 14 data reading function. | |
err_t | magneto14_get_angle_raw_data (magneto14_t *ctx, uint16_t *raw_data) |
Magneto 14 gets the angle raw data function. | |
err_t | magneto14_get_angle (magneto14_t *ctx, float *angle) |
Magneto 14 gets the angular position function. | |
err_t | magneto14_set_mag_field_thd (magneto14_t *ctx, uint8_t mglt, uint8_t mght) |
Magneto 14 sets the magnetic field threshold function. | |
err_t | magneto14_get_field_strength (magneto14_t *ctx, uint8_t *field_strength) |
Magneto 14 gets the magnetic field strength function. | |
void | magneto14_set_pwm_pin (magneto14_t *ctx, uint8_t pwm_state) |
Magneto 14 set PWM pin function. | |
uint8_t | magneto14_get_mgh (magneto14_t *ctx) |
Magneto 14 gets the MGH function. | |
API for configuring and manipulating Magneto 14 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void magneto14_cfg_setup | ( | magneto14_cfg_t * | cfg | ) |
Magneto 14 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneto14_cfg_t object definition for detailed explanation. |
err_t magneto14_default_cfg | ( | magneto14_t * | ctx | ) |
Magneto 14 default configuration function.
This function executes a default configuration of Magneto 14 click board.
[in] | ctx | : Click context object. See magneto14_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto14_get_angle | ( | magneto14_t * | ctx, |
float * | angle ) |
Magneto 14 gets the angular position function.
This function reads an angular position in degrees of the MagAlpha MA735, Contactless Digital Angle Sensor on the Magneto 14 Click board™.
[in] | ctx | : Click context object. See magneto14_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 magneto14_get_angle_raw_data | ( | magneto14_t * | ctx, |
uint16_t * | raw_data ) |
Magneto 14 gets the angle raw data function.
This function reads a 16-bit angle raw data of the MagAlpha MA735, Contactless Digital Angle Sensor on the Magneto 14 Click board™.
[in] | ctx | : Click context object. See magneto14_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. err_t magneto14_get_field_strength | ( | magneto14_t * | ctx, |
uint8_t * | field_strength ) |
Magneto 14 gets the magnetic field strength function.
This function reads a magnetic field strength detection of the MagAlpha MA735, Contactless Digital Angle Sensor on the Magneto 14 Click board™.
[in] | ctx | : Click context object. See magneto14_t object definition for detailed explanation. |
[out] | field_strength | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t magneto14_get_mgh | ( | magneto14_t * | ctx | ) |
Magneto 14 gets the MGH function.
This function gets states of the MGH ( INT ) pin to indicate the magnetic field strength of the MagAlpha MA735, Contactless Digital Angle Sensor on the Magneto 14 Click board™.
[in] | ctx | : Click context object. See magneto14_t object definition for detailed explanation. |
0
- MGHT level OK, 1
- Magnetic field strength above the MGHT level. err_t magneto14_init | ( | magneto14_t * | ctx, |
magneto14_cfg_t * | cfg ) |
Magneto 14 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneto14_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneto14_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto14_read_reg | ( | magneto14_t * | ctx, |
uint8_t | cmd, | ||
uint8_t | reg, | ||
uint8_t * | data_out ) |
Magneto 14 data reading function.
This function reads a data byte from the selected register of the selected command by using SPI serial interface.
[in] | ctx | : Click context object. See magneto14_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 magneto14_set_mag_field_thd | ( | magneto14_t * | ctx, |
uint8_t | mglt, | ||
uint8_t | mght ) |
Magneto 14 sets the magnetic field threshold function.
This function sets the magnetic field's high and low thresholds of the MagAlpha MA735, Contactless Digital Angle Sensor on the Magneto 14 Click board™.
[in] | ctx | : Click context object. See magneto14_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. void magneto14_set_pwm_pin | ( | magneto14_t * | ctx, |
uint8_t | pwm_state ) |
Magneto 14 set PWM pin function.
This function sets the PWM pin logic state of the MagAlpha MA735, Contactless Digital Angle Sensor on the Magneto 14 Click board™.
[in] | ctx | : Click context object. See magneto14_t object definition for detailed explanation. |
[in] | pwm_state | : Logic state of the PWM pin. |
err_t magneto14_write_reg | ( | magneto14_t * | ctx, |
uint8_t | cmd, | ||
uint8_t | reg, | ||
uint8_t | data_in ) |
Magneto 14 data writing function.
This function writes a data byte to the selected register
of the selected command by using SPI serial interface.
[in] | ctx | : Click context object. See magneto14_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.