* RETURN VALUE
* Upon successfull completion, returns the number of bytes read. On error, returns a negative
* integer equivalent to errors from glibc.
- * -EBADFD : Device not initialized (-77)
- * -EBUSY : Device or ressource Busy or Arbitration lost (-16)
- * -EAGAIN : Device already in use (-11)
- * -EINVAL : Invalid argument (no cmd_buf, or no inbuff when count > 0) (-22)
- * -EREMOTEIO : Device did not acknowledge (-121)
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine (-5)
*/
int i2c_read(uint8_t bus_num, const void *cmd_buf, size_t cmd_size, const void* ctrl_buf, void* inbuff, size_t count)
{
* RETURN VALUE
* Upon successfull completion, returns the number of bytes written. On error, returns a negative
* integer equivalent to errors from glibc.
- * -EBADFD : Device not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EAGAIN : Device already in use
- * -EINVAL : Invalid argument (buf)
- * -EREMOTEIO : Device did not acknowledge
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int i2c_write(uint8_t bus_num, const void *buf, size_t count, const void* ctrl_buf)
{
* Return value:
* Upon successfull completion, returns 0. On error, returns a negative integer
* equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
#define CONF_BUF_SIZE 7
int bme280_configure(struct bme280_sensor_config* conf)
* Upon successfull completion, returns 0 and the raw sensor values read are placed in the
* provided integer(s). On error, returns a negative integer equivalent to errors from
* glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
#define READ_CMD_SIZE 3
int bme280_sensor_read(struct bme280_sensor_config* conf, uint32_t* pressure, uint32_t* temp, uint16_t* hum)
* Return value(s):
* Upon successfull completion, returns 0 and the temperature read is placed in the
* provided integers. On error, returns a negative integer equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
#define CMD_BUF_SIZE 3
int tmp101_sensor_read(struct tmp101_sensor_config* conf, uint16_t* raw, int* deci_degrees)
* Return value :
* Upon successfull completion, returns 0. On error, returns a negative integer
* equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
#define CONF_BUF_SIZE 4
int tmp101_sensor_config(struct tmp101_sensor_config* conf)
* Upon successfull completion, returns 0 and the luminosity read is placed in the
* provided integer(s). On error, returns a negative integer equivalent to errors from
* glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
#define READ_BUF_SIZE 3
int tsl256x_sensor_read(struct tsl256x_sensor_config* conf, uint16_t* comb, uint16_t* ir, uint32_t* lux)
* Return value:
* Upon successfull completion, returns 0. On error, returns a negative integer
* equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
#define CONF_BUF_SIZE 3
int tsl256x_configure(struct tsl256x_sensor_config* conf)
* Upon successfull completion, returns 0 and the luminosity read is placed in the
* provided integer(s). On error, returns a negative integer equivalent to errors from
* glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int veml6070_sensor_read(struct veml6070_sensor_config* conf, uint16_t* uv_raw)
{
* Return value:
* Upon successfull completion, returns 0. On error, returns a negative integer
* equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
#define CONF_BUF_SIZE 2
int veml6070_configure(struct veml6070_sensor_config* conf)
* RETURN VALUE
* Upon successfull completion, returns the number of bytes read. On error, returns a negative
* integer equivalent to errors from glibc.
- * -EBADFD : Device not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EAGAIN : Device already in use
- * -EINVAL : Invalid argument (buf)
- * -EREMOTEIO : Device did not acknowledge
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int i2c_read(uint8_t bus_num, const void *cmd_buf, size_t cmd_size, const void* ctrl_buf, void* inbuff, size_t count);
* RETURN VALUE
* Upon successfull completion, returns the number of bytes written. On error, returns a negative
* integer equivalent to errors from glibc.
- * -EBADFD : Device not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EAGAIN : Device already in use
- * -EINVAL : Invalid argument (buf)
- * -EREMOTEIO : Device did not acknowledge
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int i2c_write(uint8_t bus_num, const void *buf, size_t count, const void* ctrl_buf);
* Return value:
* Upon successfull completion, returns 0. On error, returns a negative integer
* equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int bme280_configure(struct bme280_sensor_config* conf);
* Upon successfull completion, returns 0 and the raw sensor values read are placed in the
* provided integer(s). On error, returns a negative integer equivalent to errors from
* glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int bme280_sensor_read(struct bme280_sensor_config* conf, uint32_t* temp, uint32_t* pressure, uint16_t* hum);
* Upon successfull completion, returns 0 and the temperature read is placed in the
* provided integer(s). On error, returns a negative integer equivalent to errors from
* glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int tmp101_sensor_read(struct tmp101_sensor_config* conf, uint16_t* raw, int* deci_degrees);
* Return value:
* Upon successfull completion, returns 0. On error, returns a negative integer
* equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int tmp101_sensor_config(struct tmp101_sensor_config* conf);
* Upon successfull completion, returns 0 and the luminosity read is placed in the
* provided integer(s). On error, returns a negative integer equivalent to errors from
* glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int tsl256x_sensor_read(struct tsl256x_sensor_config* conf, uint16_t* comb, uint16_t* ir, uint32_t* lux);
* Return value:
* Upon successfull completion, returns 0. On error, returns a negative integer
* equivalent to errors from glibc.
- * -EBADFD : I2C not initialized
- * -EBUSY : Device or ressource Busy or Arbitration lost
- * -EINVAL : Invalid argument (buf)
- * -ENODEV : No such device
- * -EREMOTEIO : Device did not acknowledge : Any device present ?
- * -EIO : Bad one: Illegal start or stop, or illegal state in i2c state machine
*/
int tsl256x_configure(struct tsl256x_sensor_config* conf);