beautypg.com

IBASE MRS-801-RE User Manual

Page 86

background image

78

MRS-801-RE User Manual

#ifndef _I2CBUSSES_H

#define _I2CBUSSES_H

#include

struct i2c_adap {

int nr;

char *name;

const char *funcs;

const char *algo;

};

struct i2c_adap *gather_i2c_busses(void);

void free_adapters(struct i2c_adap *adapters);

int lookup_i2c_bus(const char *i2cbus_arg);

int parse_i2c_address(const char *address_arg);

int open_i2c_dev(int i2cbus, char *filename, size_t size, int quiet);

int set_slave_addr(int file, int address, int force);

#define MISSING_FUNC_FMT "Error: Adapter does not have %s capability\n"

#endif

/*

util.c - helper functions

*/

#include

#include "util.h"

/* Return 1 if we should continue, 0 if we should abort */

int user_ack(int def)

{

char s[2];

int ret;