blob: 2827dfe651f716a1b223fef81cb40082a43f0a92 (
plain)
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
|
#include <stdint.h>
#define APDS9151_REG_SIZE_8 0x00
#define APDS9151_REG_SIZE_16 0x40
#define APDS9151_REG_SIZE_32 0x80
#define APDS9151_REG_MAIN_CTRL (0x00 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_PS_LED (0x01 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_PS_PULSES (0x02 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_PS_MEAS_RATE (0x03 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_LS_MEAS_RATE (0x04 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_LS_GAIN (0x05 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_PART_ID (0x06 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_MAIN_STATUS (0x07 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_PS_DATA (0x08 | APDS9151_REG_SIZE_16)
#define APDS9151_REG_LS_DATA_IR (0x0A | APDS9151_REG_SIZE_32)
#define APDS9151_REG_LS_DATA_GREEN (0x0D | APDS9151_REG_SIZE_32)
#define APDS9151_REG_LS_DATA_BLUE (0x10 | APDS9151_REG_SIZE_32)
#define APDS9151_REG_LS_DATA_RED (0x13 | APDS9151_REG_SIZE_32)
#define APDS9151_REG_INT_CFG (0x19 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_INT_PST (0x1A | APDS9151_REG_SIZE_8)
#define APDS9151_REG_PS_THRES_UP (0x1B | APDS9151_REG_SIZE_16)
#define APDS9151_REG_PS_THRES_LOW (0x1D | APDS9151_REG_SIZE_16)
#define APDS9151_REG_PS_CAN (0x1F | APDS9151_REG_SIZE_16)
#define APDS9151_REG_LS_THRES_UP (0x21 | APDS9151_REG_SIZE_32)
#define APDS9151_REG_LS_THRES_LOW (0x24 | APDS9151_REG_SIZE_32)
#define APDS9151_REG_LS_THRES_VAR (0x27 | APDS9151_REG_SIZE_8)
#define APDS9151_REG_MASK 0x3F
int eos_apds9151_reg_read(uint8_t reg, void *data);
int eos_apds9151_reg_write(uint8_t reg, uint32_t data);
|