mrangle 2.0.0.0
mrangle.h File Reference

This file contains API for MR Angle Click Driver. More...

#include "drv_digital_out.h"
#include "drv_spi_master.h"
#include "math.h"

Go to the source code of this file.

Data Structures

struct  mrangle_t
 MR Angle Click context object. More...
 
struct  mrangle_cfg_t
 MR Angle Click configuration object. More...
 

Macros

#define MRANGLE_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  mrangle_return_value_t { MRANGLE_OK = 0 , MRANGLE_ERROR = -1 }
 MR Angle Click return value data. More...
 
enum  mrangle_powerdown_mode_value_t { POWERDOWN_MODE_DISABLE = 0 , POWERDOWN_MODE_ENABLE = 1 }
 MR Angle Click powerdown mode value data. More...
 
enum  mrangle_output_mode_value_t { OUTPUT_MODE_VOUT_SIN_COS = 0 , OUTPUT_MODE_VOUT_TEMP = 1 }
 MR Angle Click output mode value data. More...
 

Functions

void mrangle_cfg_setup (mrangle_cfg_t *cfg)
 MR Angle configuration object setup function.
 
err_t mrangle_init (mrangle_t *ctx, mrangle_cfg_t *cfg)
 MR Angle initialization function.
 
void mrangle_default_cfg (mrangle_t *ctx)
 MR Angle default configuration function.
 
void mrangle_powerdown_mode (mrangle_t *ctx, mrangle_powerdown_mode_value_t pd_mode)
 MR Angle powerdown mode function.
 
void mrangle_output_mode (mrangle_t *ctx, mrangle_output_mode_value_t output_mode)
 MR Angle output mode function.
 
err_t mrangle_generic_write (mrangle_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 MR Angle data writing function.
 
err_t mrangle_generic_read (mrangle_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 MR Angle data reading function.
 
err_t mrangle_get_adc_sin (mrangle_t *ctx, uint16_t *sin_adc)
 MR Angle get ADC sine function.
 
err_t mrangle_get_sin (mrangle_t *ctx, float *sin)
 MR Angle get sine function.
 
err_t mrangle_get_adc_cos (mrangle_t *ctx, uint16_t *cos_adc)
 MR Angle get ADC cosine function.
 
err_t mrangle_get_cos (mrangle_t *ctx, float *cos)
 MR Angle get cosine function.
 
err_t mrangle_get_adc_temp (mrangle_t *ctx, uint16_t *temp_adc)
 MR Angle get ADC temperature function.
 
err_t mrangle_get_temperature (mrangle_t *ctx, float *temperature)
 MR Angle get temperature function.
 
err_t mrangle_get_angle (mrangle_t *ctx, float *angle)
 MR Angle get angle function.
 

Detailed Description

This file contains API for MR Angle Click Driver.

Enumeration Type Documentation

◆ mrangle_output_mode_value_t

MR Angle Click output mode value data.

Predefined enum values for driver output mode values.

Enumerator
OUTPUT_MODE_VOUT_SIN_COS 
OUTPUT_MODE_VOUT_TEMP 

◆ mrangle_powerdown_mode_value_t

MR Angle Click powerdown mode value data.

Predefined enum values for driver powerdown mode values.

Enumerator
POWERDOWN_MODE_DISABLE 
POWERDOWN_MODE_ENABLE 

◆ mrangle_return_value_t

MR Angle Click return value data.

Predefined enum values for driver return values.

Enumerator
MRANGLE_OK 
MRANGLE_ERROR