objc

drivers_envirophat.h
Go to the documentation of this file.
1 
11 #pragma once
12 #include <drivers/drivers_bme280.h>
13 #include <drivers/drivers_lsm303.h>
15 #include <runtime-hw/hw.h>
16 #include <stdbool.h>
17 #include <stdint.h>
18 
20 // TYPES
21 
31 typedef struct driver_envirophat_t {
38 
40 // LIFECYCLE
41 
51 
58 
60 // PROPERTIES
61 
68 void driver_envirophat_set_led(driver_envirophat_t *driver, bool state);
69 
71 // COLOR SENSOR
72 
81  driver_tcs3472_rgbc_t *data);
82 
84 // ACCELEROMETER / MAGNETOMETER
85 
94  driver_lsm303_vec3_t *data);
95 
105  driver_lsm303_vec3_t *data);
106 
114 bool driver_envirophat_read_temp(driver_envirophat_t *driver, float *temp);
115 
117 // BME280 ENVIRONMENTAL SENSOR
118 
128  driver_bme280_data_t *data);
LSM303D driver instance.
bool driver_envirophat_read_color(driver_envirophat_t *driver, driver_tcs3472_rgbc_t *data)
Read RGBC color data from the TCS3472 sensor.
BME280 measurement data.
struct driver_envirophat_t driver_envirophat_t
Enviro pHAT sensor driver structure.
driver_tcs3472_t tcs3472
TCS3472 color sensor.
3-axis vector data structure
void driver_envirophat_finalize(driver_envirophat_t *driver)
Finalize and release a Enviro pHAT driver.
TCS3472 RGBC color data.
TCS3472 RGB Color Sensor Driver.
bool driver_envirophat_read_mag(driver_envirophat_t *driver, driver_lsm303_vec3_t *data)
Read magnetometer data from the LSM303 sensor.
Hardware interface abstraction layer.
bool driver_envirophat_read_accel(driver_envirophat_t *driver, driver_lsm303_vec3_t *data)
Read accelerometer data from the LSM303 sensor.
I2C adapter.
Definition: i2c.h:28
bool driver_envirophat_init(driver_envirophat_t *driver)
Initialize a Enviro pHAT driver using the I2C interface.
LSM303D 3D Accelerometer and Magnetometer Driver.
bool driver_envirophat_read_environmental(driver_envirophat_t *driver, driver_bme280_data_t *data)
Read environmental data from BME280 sensor.
BME280 driver instance.
bool driver_envirophat_read_temp(driver_envirophat_t *driver, float *temp)
Read temperature from the LSM303 sensor.
TCS3472 sensor driver structure.
BME280 Temperature, Pressure, and Humidity Sensor Driver.
driver_lsm303_t lsm303
LSM303 accelerometer/magnetometer.
void driver_envirophat_set_led(driver_envirophat_t *driver, bool state)
Set the state of the Enviro pHAT LED.
hw_i2c_t i2c
I2C bus handle.
Enviro pHAT sensor driver structure.
hw_gpio_t led
LED GPIO pin.
GPIO logical pin structure.
Definition: gpio.h:60
driver_bme280_t bme280
BME280 environmental sensor.