PicoLowLevel
Loading...
Searching...
No Matches
ams_as5048b.h File Reference
#include <WProgram.h>
#include <math.h>
#include <Wire.h>
#include "Debug.h"
Include dependency graph for ams_as5048b.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  AMS_AS5048B
 

Macros

#define ANGLE_READ_ERROR   -1000
 
#define AS5048_ADDRESS   0x40
 
#define AS5048B_PROG_REG   0x03
 
#define AS5048B_ADDR_REG   0x15
 
#define AS5048B_ZEROMSB_REG   0x16
 
#define AS5048B_ZEROLSB_REG   0x17
 
#define AS5048B_GAIN_REG   0xFA
 
#define AS5048B_DIAG_REG   0xFB
 
#define AS5048B_MAGNMSB_REG   0xFC
 
#define AS5048B_MAGNLSB_REG   0xFD
 
#define AS5048B_ANGLMSB_REG   0xFE
 
#define AS5048B_ANGLLSB_REG   0xFF
 
#define AS5048B_RESOLUTION   16384.0
 
#define EXP_MOVAVG_N   5
 
#define EXP_MOVAVG_LOOP   1
 
#define U_RAW   1
 
#define U_TRN   2
 
#define U_DEG   3
 
#define U_RAD   4
 
#define U_GRAD   5
 
#define U_MOA   6
 
#define U_SOA   7
 
#define U_MILNATO   8
 
#define U_MILSE   9
 
#define U_MILRU   10
 

Detailed Description

Author
SOSAndroid.fr (E. Ha.)

HISTORY

v1.0 - First release v1.0.1 - Typo to allow compiling on Codebender.cc (Math.h vs math.h) v1.0.2 - Small bug fix and improvement by @DavidHowlett

Library to interface the AS5048B magnetic rotary encoder from AMS over the I2C bus

LICENSE

Software License Agreement (BSD License)

Copyright (c) 2013, SOSAndroid.fr (E. Ha.) All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ ANGLE_READ_ERROR

#define ANGLE_READ_ERROR   -1000

◆ AS5048_ADDRESS

#define AS5048_ADDRESS   0x40

◆ AS5048B_ADDR_REG

#define AS5048B_ADDR_REG   0x15

◆ AS5048B_ANGLLSB_REG

#define AS5048B_ANGLLSB_REG   0xFF

◆ AS5048B_ANGLMSB_REG

#define AS5048B_ANGLMSB_REG   0xFE

◆ AS5048B_DIAG_REG

#define AS5048B_DIAG_REG   0xFB

◆ AS5048B_GAIN_REG

#define AS5048B_GAIN_REG   0xFA

◆ AS5048B_MAGNLSB_REG

#define AS5048B_MAGNLSB_REG   0xFD

◆ AS5048B_MAGNMSB_REG

#define AS5048B_MAGNMSB_REG   0xFC

◆ AS5048B_PROG_REG

#define AS5048B_PROG_REG   0x03

◆ AS5048B_RESOLUTION

#define AS5048B_RESOLUTION   16384.0

◆ AS5048B_ZEROLSB_REG

#define AS5048B_ZEROLSB_REG   0x17

◆ AS5048B_ZEROMSB_REG

#define AS5048B_ZEROMSB_REG   0x16

◆ EXP_MOVAVG_LOOP

#define EXP_MOVAVG_LOOP   1

◆ EXP_MOVAVG_N

#define EXP_MOVAVG_N   5

◆ U_DEG

#define U_DEG   3

◆ U_GRAD

#define U_GRAD   5

◆ U_MILNATO

#define U_MILNATO   8

◆ U_MILRU

#define U_MILRU   10

◆ U_MILSE

#define U_MILSE   9

◆ U_MOA

#define U_MOA   6

◆ U_RAD

#define U_RAD   4

◆ U_RAW

#define U_RAW   1

◆ U_SOA

#define U_SOA   7

◆ U_TRN

#define U_TRN   2