-
Notifications
You must be signed in to change notification settings - Fork 5
/
melexis.h
46 lines (33 loc) · 875 Bytes
/
melexis.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
MELEXIS.h - MELEXIS library
For interfacing with the MLX90363 triaxis hall effect sensor
by Travis Howse <[email protected]>
2012. License, GPL v2 or later
*/
#ifndef MELEXIS_h
#define MELEXIS_h
#include <inttypes.h>
class MELEXIS
{
public:
int16_t get_x();
int16_t get_y();
int16_t get_z();
uint8_t get_diag();
uint16_t get_diag_0();
uint16_t get_diag_1();
uint8_t get_roll();
uint8_t poll();
uint8_t diag_poll();
uint8_t do_SPI();
uint8_t reboot();
void send_NOP();
uint16_t set_eeprom(uint16_t addr, uint8_t offset, uint8_t length, uint16_t data);
uint16_t get_eeprom(uint16_t addr, uint8_t offset, uint8_t length);
uint16_t get_eeprom_word(uint16_t addr, uint8_t offset, uint8_t length);
uint16_t get_EE_Key(uint16_t addr);
MELEXIS(uint8_t selectPin);
private:
bool do_checksum(uint8_t* message);
};
#endif