/*
 * VEML6031X00.h
 *
 * Created  : 20 August 2021
 * Modified : 13 June 2023
 * Author   : HWanyusof
 * Version	: 1.2
 */

//Define Slave Address
#define Slave_1

//VEML6031X00 has 2 Slave Addresses
#ifdef Slave_1
#define VEML6031X00_Slave_Address 0x29
#endif

#ifdef Slave_2
#define VEML6031X00_Slave_Address 0x10
#endif


//Register Addresses (Page 8 Table "Command Register Format" Datasheet)
#define VEML6031X00_ALS_CONF_0		0x00
#define VEML6031X00_ALS_CONF_1		0x01
#define VEML6031X00_ALS_WH_L		0x04
#define VEML6031X00_ALS_WH_H		0x05
#define VEML6031X00_ALS_WL_L	    0x06
#define VEML6031X00_ALS_WL_H	    0x07
#define VEML6031X00_ALS_DATA_L	    0x10
#define VEML6031X00_ALS_DATA_H	    0x11
#define VEML6031X00_IR_DATA_L	    0x12
#define VEML6031X00_IR_DATA_H	    0x13
#define VEML6031X00_ID_L		    0x14
#define VEML6031X00_ID_H		    0x15
#define VEML6031X00_ALS_INT		    0x17

//Command Register: ALS_CONF_0 (Page 8 Table 1 Datasheet))
#define VEML6031X00_ALS_IT_3_125ms	0x00<<4
#define VEML6031X00_ALS_IT_6_25ms	0x01<<4
#define VEML6031X00_ALS_IT_12_5ms	0x02<<4
#define VEML6031X00_ALS_IT_25ms     0x03<<4
#define VEML6031X00_ALS_IT_50ms	    0x04<<4
#define VEML6031X00_ALS_IT_100ms	0x05<<4
#define VEML6031X00_ALS_IT_200ms	0x06<<4
#define VEML6031X00_ALS_IT_400ms	0x07<<4
#define VEML6031X00_ALS_AUTO		0x00<<3
#define VEML6031X00_ALS_AF_EN		0x01<<3
#define VEML6031X00_ALS_TRIG_DIS	0x00<<2
#define VEML6031X00_ALS_TRIG_EN	    0x01<<2
#define VEML6031X00_ALS_INT_EN	    0x01<<1
#define VEML6031X00_ALS_INT_DIS     0x00<<1
#define VEML6031X00_SD_ON			0x00<<0
#define VEML6031X00_SD_OFF			0x01<<0

//Command Register: ALS_CONF_1 (Page 9 Table 2 Datasheet))
#define VEML6031X00_ALS_IR_SD_ON	0x00<<7
#define VEML6031X00_ALS_IR_SD_OFF	0x01<<7
#define VEML6031X00_PD_DIV4_FULL  	0x00<<6
#define VEML6031X00_PD_DIV4_QUARTER 0x01<<6
#define VEML6031X00_ALS_GAIN_x1	    0x00<<3
#define VEML6031X00_ALS_GAIN_x2  	0x01<<3
#define VEML6031X00_ALS_GAIN_x0_66  0x02<<3
#define VEML6031X00_ALS_GAIN_x0_5	0x03<<3
#define VEML6031X00_ALS_PERS_1		0x00<<1
#define VEML6031X00_ALS_PERS_2		0x01<<1
#define VEML6031X00_ALS_PERS_4		0x02<<1
#define VEML6031X00_ALS_PERS_8		0x03<<1
#define VEML6031X00_ALS_CAL_OFF  	0x00<<0
#define VEML6031X00_ALS_CAL_ON 	    0x01<<0
