ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
#include "ruuvi_driver_enabled_modules.h"
#include "ruuvi_driver_error.h"
#include "ruuvi_interface_i2c.h"
#include "ruuvi_interface_yield.h"
#include "sensirion_arch_config.h"
#include "sensirion_common.h"
#include "sensirion_i2c.h"
#include "shtc1.h"
#include <string.h>
Go to the source code of this file.
Functions | |
int16_t | sensirion_i2c_select_bus (uint8_t bus_idx) |
void | sensirion_i2c_init (void) |
void | sensirion_i2c_release (void) |
int8_t | sensirion_i2c_read (uint8_t address, uint8_t *data, uint16_t count) |
int8_t | sensirion_i2c_write (uint8_t address, const uint8_t *data, uint16_t count) |
void sensirion_i2c_init | ( | void | ) |
Driver file does not know about the board configuration, use ri_i2c_init instead.
Definition at line 72 of file ruuvi_interface_i2c_shtcx.c.
int8_t sensirion_i2c_read | ( | uint8_t | address, |
uint8_t * | data, | ||
uint16_t | count | ||
) |
Execute one read transaction on the I2C bus, reading a given number of bytes. If the device does not acknowledge the read command, an error shall be returned.
address | 7-bit I2C address to read from |
data | pointer to the buffer where the data is to be stored |
count | number of bytes to read from I2C and store in the buffer |
Definition at line 96 of file ruuvi_interface_i2c_shtcx.c.
void sensirion_i2c_release | ( | void | ) |
Release all resources initialized by sensirion_i2c_init().
Definition at line 80 of file ruuvi_interface_i2c_shtcx.c.
int16_t sensirion_i2c_select_bus | ( | uint8_t | bus_idx | ) |
Select the current i2c bus by index. All following i2c operations will be directed at that bus.
THE IMPLEMENTATION IS OPTIONAL ON SINGLE-BUS SETUPS (all sensors on the same bus)
bus_idx | Bus index to select |
Definition at line 62 of file ruuvi_interface_i2c_shtcx.c.
int8_t sensirion_i2c_write | ( | uint8_t | address, |
const uint8_t * | data, | ||
uint16_t | count | ||
) |
Execute one write transaction on the I2C bus, sending a given number of bytes. The bytes in the supplied buffer must be sent to the given address. If the slave device does not acknowledge any of the bytes, an error shall be returned.
address | 7-bit I2C address to write to |
data | pointer to the buffer containing the data to write |
count | number of bytes to read from the buffer and send over I2C |
Definition at line 114 of file ruuvi_interface_i2c_shtcx.c.