ambient23 2.1.0.0
ambient23.h File Reference

This file contains API for Ambient 23 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  ambient23_t
 Ambient 23 Click context object. More...
 
struct  ambient23_cfg_t
 Ambient 23 Click configuration object. More...
 

Macros

#define AMBIENT23_REG_CONFIG   0x00
 Ambient 23 description register.
 
#define AMBIENT23_REG_WHITE_DATA   0x04
 
#define AMBIENT23_REG_ALS_DATA   0x05
 
#define AMBIENT23_REG_DEVICE_ID   0x09
 
#define AMBIENT23_GAIN_1   0x0000u
 Ambient 23 gain setting.
 
#define AMBIENT23_GAIN_2   0x0800u
 
#define AMBIENT23_GAIN_4   0x1800u
 
#define AMBIENT23_GAIN_MSK   0x1800u
 
#define AMBIENT23_DATA_GAIN_1   0x0000u
 Ambient 23 data gain setting.
 
#define AMBIENT23_DATA_GAIN_2   0x2000u
 
#define AMBIENT23_DATA_GAIN_MASK   0x2000u
 
#define AMBIENT23_SDO_SHUTDOWN_ON   0x8000u
 Ambient 23 shutdown setting.
 
#define AMBIENT23_SDO_SHUTDOWN_OFF   0x0000u
 
#define AMBIENT23_SHUTDOWN_ON   0x0001u
 
#define AMBIENT23_SHUTDOWN_OFF   0x0000u
 
#define AMBIENT23_TRIGGER_ON   0x0004u
 Ambient 23 trigger setting.
 
#define AMBIENT23_TRIGGER_OFF   0x0000u
 
#define AMBIENT23_AUTO_FORCE_MODE   0x0800u
 Ambient 23 force mode setting.
 
#define AMBIENT23_MANUAL_FORCE_MODE   0x0000u
 
#define AMBIENT23_INTEGRATION_50_MS   0x0000u
 Ambient 23 integration time setting.
 
#define AMBIENT23_INTEGRATION_100_MS   0x0010u
 
#define AMBIENT23_INTEGRATION_200_MS   0x0020u
 
#define AMBIENT23_INTEGRATION_400_MS   0x0030u
 
#define AMBIENT23_INTEGRATION_800_MS   0x0040u
 
#define AMBIENT23_INTEGRATION_TIME_MSK   0x0070u
 
#define AMBIENT23_CONFIG_DEF_VAL   0x0100u
 Ambient 23 config register value.
 
#define AMBIENT23_PART_ID   0x35
 Ambient 23 device ID.
 
#define AMBIENT23_TYPICAL_RESOLUTION   0.27264f
 Ambient 23 typical resolution value.
 
#define AMBIENT23_DEVICE_ADDRESS   0x10
 Ambient 23 device address setting.
 
#define AMBIENT23_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ambient23_return_value_t { AMBIENT23_OK = 0 , AMBIENT23_ERROR = -1 }
 Ambient 23 Click return value data. More...
 

Functions

void ambient23_cfg_setup (ambient23_cfg_t *cfg)
 Ambient 23 configuration object setup function.
 
err_t ambient23_init (ambient23_t *ctx, ambient23_cfg_t *cfg)
 Ambient 23 initialization function.
 
err_t ambient23_default_cfg (ambient23_t *ctx)
 Ambient 23 default configuration function.
 
err_t ambient23_generic_write (ambient23_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Ambient 23 I2C writing function.
 
err_t ambient23_generic_read (ambient23_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Ambient 23 I2C reading function.
 
err_t ambient23_reg_write (ambient23_t *ctx, uint8_t reg, uint16_t data_in)
 Ambient 23 register data writing function.
 
err_t ambient23_reg_read (ambient23_t *ctx, uint8_t reg, uint16_t *data_out)
 Ambient 23 register reading function.
 
err_t ambient23_calculate_res (ambient23_t *ctx, float *conversion_mul)
 Ambient 23 get conversion data function.
 
err_t ambient23_read_light_data (ambient23_t *ctx, float *light_data)
 Ambient 23 get light data function.
 

Detailed Description

This file contains API for Ambient 23 Click Driver.

Enumeration Type Documentation

◆ ambient23_return_value_t

Ambient 23 Click return value data.

Predefined enum values for driver return values.

Enumerator
AMBIENT23_OK 
AMBIENT23_ERROR