magneto9 2.0.0.0
Magneto 9 Click Driver

API for configuring and manipulating Magneto 9 Click driver. More...

Topics

 Magneto 9 Registers Settings
 Settings for registers of Magneto 9 Click driver.
 
 Magneto 9 MikroBUS Map
 MikroBUS pin mapping of Magneto 9 Click driver.
 

Functions

void magneto9_cfg_setup (magneto9_cfg_t *cfg)
 Magneto 9 configuration object setup function.
 
err_t magneto9_init (magneto9_t *ctx, magneto9_cfg_t *cfg)
 Magneto 9 initialization function.
 
err_t magneto9_read_an_pin_value (magneto9_t *ctx, uint16_t *data_out)
 Magneto 9 read AN pin value function.
 
err_t magneto9_read_an_pin_voltage (magneto9_t *ctx, float *data_out)
 Magneto 9 read AN pin voltage level function.
 
err_t magneto9_read_raw_adc (magneto9_t *ctx, uint16_t *raw_adc)
 Magneto 9 read raw ADC function.
 
err_t magneto9_read_adc_voltage (magneto9_t *ctx, float *voltage)
 Magneto 9 read ADC voltage function.
 
uint8_t magneto9_get_pwm_pin (magneto9_t *ctx)
 Magneto 9 get PWM pin function.
 

Detailed Description

API for configuring and manipulating Magneto 9 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ magneto9_cfg_setup()

void magneto9_cfg_setup ( magneto9_cfg_t * cfg)

Magneto 9 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See magneto9_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ magneto9_get_pwm_pin()

uint8_t magneto9_get_pwm_pin ( magneto9_t * ctx)

Magneto 9 get PWM pin function.

This function returns the PWM pin logic state.

Parameters
[in]ctx: Click context object. See magneto9_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ magneto9_init()

err_t magneto9_init ( magneto9_t * ctx,
magneto9_cfg_t * cfg )

Magneto 9 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See magneto9_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See magneto9_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto9_read_adc_voltage()

err_t magneto9_read_adc_voltage ( magneto9_t * ctx,
float * voltage )

Magneto 9 read ADC voltage function.

This function reads raw 12-bit ADC data and converts it to voltage by using I2C serial interface.

Parameters
[in]ctx: Click context object. See magneto9_t object definition for detailed explanation.
[out]voltage: Calculated ADC voltage.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto9_read_an_pin_value()

err_t magneto9_read_an_pin_value ( magneto9_t * ctx,
uint16_t * data_out )

Magneto 9 read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See magneto9_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ magneto9_read_an_pin_voltage()

err_t magneto9_read_an_pin_voltage ( magneto9_t * ctx,
float * data_out )

Magneto 9 read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See magneto9_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ magneto9_read_raw_adc()

err_t magneto9_read_raw_adc ( magneto9_t * ctx,
uint16_t * raw_adc )

Magneto 9 read raw ADC function.

This function reads raw 12-bit ADC data by using I2C serial interface.

Parameters
[in]ctx: Click context object. See magneto9_t object definition for detailed explanation.
[out]raw_adc: Raw ADC read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.