ambient  2.0.0.0
Data Structures | Macros | Typedefs | Functions
ambient.h File Reference

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

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_analog_in.h"

Go to the source code of this file.

Data Structures

struct  ambient_t
 Click ctx object definition. More...
 
struct  ambient_cfg_t
 Click configuration structure definition. More...
 

Macros

#define AMBIENT_MAP_MIKROBUS(cfg, mikrobus)   cfg.an_pin = MIKROBUS( mikrobus, MIKROBUS_AN )
 
#define AMBIENT_RETVAL   uint8_t
 
#define AMBIENT_OK   0x00
 
#define AMBIENT_INIT_ERROR   0xFF
 
#define AMBIENT_VCC_5_0   5000
 
#define AMBIENT_VCC_3_3   3300
 
#define AMBIENT_RES_10_BIT   1024
 
#define AMBIENT_RES_12_BIT   4096
 
#define AMBIENT_GAIN   7
 

Typedefs

typedef uint16_t ambient_data_t
 Analog data type. More...
 

Functions

void ambient_cfg_setup (ambient_cfg_t *cfg)
 Config Object Initialization function. More...
 
AMBIENT_RETVAL ambient_init (ambient_t *ctx, ambient_cfg_t *cfg)
 Initialization function. More...
 
ambient_data_t ambient_generic_read (ambient_t *ctx)
 Generic read function. More...
 
uint16_t ambient_calculate_light_intensity (ambient_t *ctx, uint16_t adc_data, uint16_t vcc_val, uint16_t adc_res)
 Calculate light intensity function. More...
 

Detailed Description

This file contains API for Ambient Click driver.