Initial commit
This commit is contained in:
23
inc/ads1115.h
Normal file
23
inc/ads1115.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef __ADS1115__
|
||||
#define __ADS1115__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <libi2c_bb/i2c_bb.h>
|
||||
|
||||
struct ads1115_dev {
|
||||
struct i2c_bb *i2c_dev;
|
||||
uint8_t i2c_slave_address;
|
||||
};
|
||||
|
||||
struct ads1115_conversation_result {
|
||||
uint16_t raw;
|
||||
float voltage;
|
||||
};
|
||||
|
||||
int ads1115_open(const struct ads1115_dev *ads1115);
|
||||
int ads1115_close(const struct ads1115_dev *ads1115);
|
||||
int ads1115_start_conversation(const struct ads1115_dev *ads1115);
|
||||
int ads1115_read_conversation_result(const struct ads1115_dev *ads1115,
|
||||
struct ads1115_conversation_result *result);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user