C-Libs/ALS31313.h
2021-07-01 11:55:32 +00:00

38 lines
659 B
C

/*
* ALS31313.h
*
* Created on: 8 Apr 2021
* Author: angoosh
*/
#ifndef ALS31313_H_
#define ALS31313_H_
#include "chip.h"
#include "main.h"
#include "debug.h"
#include "I2C.h"
#include <math.h>
typedef enum {
READ = 0,
WRITE = 1
} ACCESS;
typedef enum {
XY = 0,
XZ = 1,
YZ = 2
} AXIS_PAIR;
#define HALL_I2C_ADDR 0x60
#define LSB_GAUSS 1
void Enable_Setting_Modification();
uint32_t Modify_Hall_EEPROM_Settings(int setting, uint32_t value, ACCESS rw);
uint32_t Modify_Hall_Register_Settings(int setting, uint32_t value, ACCESS rw);
int readHallData(int *xyz, float *temp);
double readDegrees(AXIS_PAIR pair);
#endif /* ALS31313_H_ */