magneto12 2.0.0.0
magneto12.h File Reference

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

#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  magneto12_t
 Magneto 12 Click context object. More...
 
struct  magneto12_cfg_t
 Magneto 12 Click configuration object. More...
 

Macros

#define MAGNETO12_ADC_RESOLUTION   0x0FFF
 Magneto 12 ADC setting.
 
#define MAGNETO12_VREF_5V   5.0
 
#define MAGNETO12_FULL_CIRCLE   360.0
 
#define MAGNETO12_SATURATION_ERROR   0.04
 
#define MAGNETO12_SET_DEV_ADDR   0x4D
 Magneto 12 device address setting.
 
#define MAGNETO12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  magneto12_drv_t { MAGNETO12_DRV_SEL_ADC , MAGNETO12_DRV_SEL_I2C }
 Magneto 12 Click driver selector. More...
 
enum  magneto12_return_value_t { MAGNETO12_OK = 0 , MAGNETO12_ERROR = -1 }
 Magneto 12 Click return value data. More...
 

Functions

void magneto12_cfg_setup (magneto12_cfg_t *cfg)
 Magneto 12 configuration object setup function.
 
void magneto12_drv_interface_selection (magneto12_cfg_t *cfg, magneto12_drv_t drv_sel)
 Magneto 12 driver interface setup function.
 
err_t magneto12_init (magneto12_t *ctx, magneto12_cfg_t *cfg)
 Magneto 12 initialization function.
 
err_t magneto12_read_raw_adc (magneto12_t *ctx, uint16_t *raw_adc)
 Magneto 12 read raw ADC value function.
 
err_t magneto12_read_voltage (magneto12_t *ctx, float *voltage)
 Magneto 12 read voltage level function.
 
err_t magneto12_set_vref (magneto12_t *ctx, float vref)
 Magneto 12 set vref function.
 
err_t magneto12_read_angle (magneto12_t *ctx, float *angle)
 Magneto 12 read angle function.
 

Detailed Description

This file contains API for Magneto 12 Click Driver.

Enumeration Type Documentation

◆ magneto12_drv_t

Magneto 12 Click driver selector.

Selects target driver interface of Magneto 12 Click driver.

Enumerator
MAGNETO12_DRV_SEL_ADC 

ADC driver descriptor.

MAGNETO12_DRV_SEL_I2C 

I2C driver descriptor.

◆ magneto12_return_value_t

Magneto 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
MAGNETO12_OK 
MAGNETO12_ERROR