magneto 2.0.0.0
magneto.h File Reference

This file contains API for MAGNETO Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  magneto_t
 Click ctx object definition. More...
 
struct  magneto_cfg_t
 Click configuration structure definition. More...
 

Macros

#define MAGNETO_MAP_MIKROBUS(cfg, mikrobus)
 
#define MAGNETO_RETVAL   uint8_t
 
#define MAGNETO_OK   0x00
 
#define MAGNETO_INIT_ERROR   0xFF
 
#define MAGNETO_REG_CLEAR_ERROR_FLAG   0x0001
 
#define MAGNETO_REG_PROGRAMMING_CONTROL   0x0003
 
#define MAGNETO_REG_OTP_ZERO_POS_HIGH   0x0016
 
#define MAGNETO_REG_OTP_ZERO_POS_LOW   0x0017
 
#define MAGNETO_REG_DIAG_AGC   0x3FFD
 
#define MAGNETO_REG_MAGNITUDE   0x3FFF
 
#define MAGNETO_REG_ANGLE   0x3FFF
 
#define MAGNETO_CMD_RESET_VALUE   0x0000
 
#define MAGNETO_CMD_SET_VALUE   0xFFFE
 
#define MAGNETO_CMD_MAGNITUDE_VALUE   0x1FFE
 
#define MAGNETO_CMD_PARITY_VALUE   0x000F
 
#define MAGNETO_CMD_READ_COMMAND_BIT   0x4000
 
#define MAGNETO_CMD_HIGH_BYTE   0xFF00
 
#define MAGNETO_CMD_LOW_BYTE   0x00FF
 
#define MAGNETO_FLAG_OK   0
 
#define MAGNETO_FLAG_ERROR   1
 

Functions

void magneto_cfg_setup (magneto_cfg_t *cfg)
 Config Object Initialization function.
 
MAGNETO_RETVAL magneto_init (magneto_t *ctx, magneto_cfg_t *cfg)
 Initialization function.
 
void magneto_generic_transfer (magneto_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint16_t magneto_read_data (magneto_t *ctx, uint16_t address_command)
 16-bit command generic read function.
 
void magneto_write_data (magneto_t *ctx, uint16_t address_command, uint16_t write_data)
 16-bit command generic write function.
 
uint16_t magneto_get_state (magneto_t *ctx)
 Get state function.
 
uint8_t magneto_check_state (magneto_t *ctx)
 Check state function.
 
float magneto_get_angle (magneto_t *ctx)
 Calculate angle function.
 

Detailed Description

This file contains API for MAGNETO Click driver.