magneto9  2.0.0.0
Data Structures | Macros | Enumerations | Functions
magneto9.h File Reference

This file contains API for Magneto 9 Click Driver. More...

#include "mikrosdk_version.h"
#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_analog_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  magneto9_t
 Magneto 9 Click context object. More...
 
struct  magneto9_cfg_t
 Magneto 9 Click configuration object. More...
 

Macros

#define MAGNETO9_SET_DEV_ADDR   0x4D
 Magneto 9 device address setting. More...
 
#define MAGNETO9_ADC_RESOLUTION   0x0FFF
 Magneto 9 ADC setting. More...
 
#define MAGNETO9_VREF_5V   5.0
 
#define MAGNETO9_QUIESCENT_VOUT   2.5
 Magneto 9 magnetic field strength constants. More...
 
#define MAGNETO9_AN_SENSITIVITY_V_PER_G   0.009
 
#define MAGNETO9_GAUSS_TO_MILITESLA   0.1
 
#define MAGNETO9_VOLTAGE_TO_FIELD_STRENGTH(voltage)
 Magneto 9 voltage to magnetic field strength macro. More...
 
#define MAGNETO9_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping. More...
 

Enumerations

enum  magneto9_return_value_t { MAGNETO9_OK = 0, MAGNETO9_ERROR = -1 }
 Magneto 9 Click return value data. More...
 

Functions

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

Detailed Description

This file contains API for Magneto 9 Click Driver.

Enumeration Type Documentation

◆ magneto9_return_value_t

Magneto 9 Click return value data.

Predefined enum values for driver return values.

Enumerator
MAGNETO9_OK 
MAGNETO9_ERROR