ambient5 2.0.0.0
ambient5.h File Reference

This file contains API for Ambient 5 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  ambient5_t
 Click ctx object definition. More...
 
struct  ambient5_cfg_t
 Click configuration structure definition. More...
 

Macros

#define AMBIENT5_DEVICE_ADDRESS   0x10
 
#define AMBIENT5_MAP_MIKROBUS(cfg, mikrobus)
 
#define AMBIENT5_RETVAL   uint8_t
 
#define AMBIENT5_OK   0x00
 
#define AMBIENT5_INIT_ERROR   0xFF
 
#define AMBIENT5_CONFIGURATION   0x00
 
#define AMBIENT5_HIGH_THRESHOLD   0x01
 
#define AMBIENT5_LOW_THRESHOLD   0x02
 
#define AMBIENT5_POWER_SAVING_MODE   0x03
 
#define AMBIENT5_HIGH_RESOLUTION_OUTPUT_DATA   0x04
 
#define AMBIENT5_WHITE_CHANNEL_OUTPUT_DATA   0x05
 
#define AMBIENT5_INTERRUPT_STATUS   0x06
 
#define AMBIENT5_GAIN_x1   0x0000
 
#define AMBIENT5_GAIN_x2   0x0800
 
#define AMBIENT5_GAIN_x1_8   0x1000
 
#define AMBIENT5_GAIN_x1_4   0x1800
 
#define AMBIENT5_INTEGRATION_TIME_25ms   0x0300
 
#define AMBIENT5_INTEGRATION_TIME_50ms   0x0200
 
#define AMBIENT5_INTEGRATION_TIME_100ms   0x0000
 
#define AMBIENT5_INTEGRATION_TIME_200ms   0x0040
 
#define AMBIENT5_INTEGRATION_TIME_400ms   0x0080
 
#define AMBIENT5_INTEGRATION_TIME_800ms   0x00C0
 
#define AMBIENT5_PERSISTANCE_PROTECT_NUMBER_1   0x0000
 
#define AMBIENT5_PERSISTANCE_PROTECT_NUMBER_2   0x0010
 
#define AMBIENT5_PERSISTANCE_PROTECT_NUMBER_4   0x0020
 
#define AMBIENT5_PERSISTANCE_PROTECT_NUMBER_8   0x0030
 
#define AMBIENT5_INTERRUPT_DISABLE   0x0000
 
#define AMBIENT5_INTERRUPT_ENABLE   0x0002
 
#define AMBIENT5_POWER_ON   0x0000
 
#define AMBIENT5_SHUT_DOWN   0x0001
 
#define AMBIENT5_MODE_1   0x0000
 
#define AMBIENT5_MODE_2   0x0002
 
#define AMBIENT5_MODE_3   0x0004
 
#define AMBIENT5_MODE_4   0x0006
 
#define AMBIENT5_POWER_SAVING_MODE_DISABLE   0x0000
 
#define AMBIENT5_POWER_SAVING_MODE_ENABLE   0x0001
 

Functions

void ambient5_cfg_setup (ambient5_cfg_t *cfg)
 Config Object Initialization function.
 
AMBIENT5_RETVAL ambient5_init (ambient5_t *ctx, ambient5_cfg_t *cfg)
 Initialization function.
 
void ambient5_default_cfg (ambient5_t *ctx)
 Default configuration function.
 
void ambient5_set_register (ambient5_t *ctx, uint8_t reg_addr, uint16_t reg_value)
 Set register function.
 
uint16_t ambient5_get_register (ambient5_t *ctx, uint8_t reg)
 Get register function.
 
float ambient5_get_resolution (ambient5_t *ctx)
 Get resolution.
 
uint16_t ambient5_get_refresh_time (ambient5_t *ctx)
 Get refresh time.
 
float ambient5_get_high_resolution_light_level (ambient5_t *ctx)
 Get high resolution light level.
 
float ambient5_get_white_channel_light_level (ambient5_t *ctx)
 Get white channel light level.
 
void ambient5_set_low_light_level_threshold (ambient5_t *ctx, float low_light_level_threshold)
 Set low light level threshold.
 
void ambient5_set_high_light_level_threshold (ambient5_t *ctx, float high_light_level_threshold)
 Set high light level threshold.
 
void ambient5_power_on (ambient5_t *ctx)
 Set high light level threshold.
 
uint8_t ambient5_checkIntPin (ambient5_t *ctx)
 Checking INT pin state.
 

Detailed Description

This file contains API for Ambient 5 Click driver.