magneticrotary 2.0.0.0

Functions

void magneticrotary_cfg_setup (magneticrotary_cfg_t *cfg)
 Config Object Initialization function.
 
MAGNETICROTARY_RETVAL magneticrotary_init (magneticrotary_t *ctx, magneticrotary_cfg_t *cfg)
 Initialization function.
 
void magneticrotary_generic_transfer (magneticrotary_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint16_t magnrotary_out_volt_adc (magneticrotary_t *ctx, uint8_t cmd_byte, uint16_t pwr_volt)
 ADC Output Voltage Get function.
 
uint16_t magnrotary_read_adc (magneticrotary_t *ctx, uint8_t cmnd_byte)
 ADC Result Read function.
 
double magnrotary_get_field_angle (magneticrotary_t *ctx, uint8_t cmd_byte)
 Magnetic Field Angle Get function.
 

Detailed Description

Function Documentation

◆ magneticrotary_cfg_setup()

void magneticrotary_cfg_setup ( magneticrotary_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ magneticrotary_generic_transfer()

void magneticrotary_generic_transfer ( magneticrotary_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

Generic transfer function.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ magneticrotary_init()

MAGNETICROTARY_RETVAL magneticrotary_init ( magneticrotary_t * ctx,
magneticrotary_cfg_t * cfg )

Initialization function.

Parameters
magneticrotaryClick object.
cfgClick configuration structure.

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

◆ magnrotary_get_field_angle()

double magnrotary_get_field_angle ( magneticrotary_t * ctx,
uint8_t cmd_byte )

Magnetic Field Angle Get function.

Parameters
ctxClick object.
cmd_byteSettings for AD conversion.
Returns
Magnetic field angle

@description This function returns a magnetic field angle calculated to degrees, in the range from -90 to 90 degrees.

◆ magnrotary_out_volt_adc()

uint16_t magnrotary_out_volt_adc ( magneticrotary_t * ctx,
uint8_t cmd_byte,
uint16_t pwr_volt )

ADC Output Voltage Get function.

Parameters
ctxClick object.
cmd_byteSettings for AD conversion.
pwr_voltPower voltage value selection (millivolts).
Returns
ADC output voltage value

@description This function returns ADC voltage value calculated to millivolts, depending on the VDD (power) voltage selection.

◆ magnrotary_read_adc()

uint16_t magnrotary_read_adc ( magneticrotary_t * ctx,
uint8_t cmnd_byte )

ADC Result Read function.

Parameters
ctxClick object.
cmnd_byteSettings for AD conversion.
Returns
Result of conversion

@description This function returns a 12bit result of AD conversion.