OpenBIC
OpenSource Bridge-IC
ads1015.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <logging/log.h>
#include "libutil.h"
#include "sensor.h"
#include "ads1015.h"
Include dependency graph for ads1015.c:

Macros

#define MSB_MASK   BIT(15)
 
#define CONVERSION_VAL_MASK   GENMASK(15, 4)
 
#define DEFAULT_CONFIG_VAL   0x8583
 
#define VALUE_MSB_MASK   GENMASK(15, 8)
 
#define VALUE_LSB_MASK   GENMASK(7, 0)
 

Functions

 LOG_MODULE_REGISTER (dev_ads1015)
 
uint8_t ads1015_read (sensor_cfg *cfg, int *reading)
 
uint8_t ads1015_init (sensor_cfg *cfg)
 

Macro Definition Documentation

◆ CONVERSION_VAL_MASK

#define CONVERSION_VAL_MASK   GENMASK(15, 4)

◆ DEFAULT_CONFIG_VAL

#define DEFAULT_CONFIG_VAL   0x8583

◆ MSB_MASK

#define MSB_MASK   BIT(15)

◆ VALUE_LSB_MASK

#define VALUE_LSB_MASK   GENMASK(7, 0)

◆ VALUE_MSB_MASK

#define VALUE_MSB_MASK   GENMASK(15, 8)

Function Documentation

◆ ads1015_init()

uint8_t ads1015_init ( sensor_cfg cfg)
Here is the call graph for this function:

◆ ads1015_read()

uint8_t ads1015_read ( sensor_cfg cfg,
int *  reading 
)
Here is the call graph for this function:

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( dev_ads1015  )