Browse Source

drivers: use const device descriptor

master
Alexandre Abadie 5 years ago
parent
commit
317716419c
  1. 6
      drivers/adt7310/adt7310.c
  2. 16
      drivers/adxl345/adxl345.c
  3. 30
      drivers/at30tse75x/at30tse75x.c
  4. 2
      drivers/bh1750fvi/bh1750fvi.c
  5. 20
      drivers/bmp180/bmp180.c
  6. 32
      drivers/bmx280/bmx280.c
  7. 2
      drivers/dht/dht.c
  8. 10
      drivers/dsp0401/dsp0401.c
  9. 12
      drivers/dynamixel/dynamixel.c
  10. 12
      drivers/feetech/feetech.c
  11. 32
      drivers/hd44780/hd44780.c
  12. 6
      drivers/hdc1000/hdc1000.c
  13. 6
      drivers/hih6130/hih6130.c
  14. 16
      drivers/ina220/ina220.c
  15. 6
      drivers/include/adt7310.h
  16. 16
      drivers/include/adxl345.h
  17. 22
      drivers/include/at30tse75x.h
  18. 2
      drivers/include/bh1750fvi.h
  19. 8
      drivers/include/bmp180.h
  20. 6
      drivers/include/bmx280.h
  21. 2
      drivers/include/dht.h
  22. 6
      drivers/include/dsp0401.h
  23. 12
      drivers/include/dynamixel.h
  24. 12
      drivers/include/feetech.h
  25. 16
      drivers/include/hd44780.h
  26. 6
      drivers/include/hdc1000.h
  27. 2
      drivers/include/hih6130.h
  28. 12
      drivers/include/ina220.h
  29. 2
      drivers/include/io1_xplained.h
  30. 6
      drivers/include/isl29020.h
  31. 8
      drivers/include/isl29125.h
  32. 6
      drivers/include/jc42.h
  33. 6
      drivers/include/l3g4200d.h
  34. 12
      drivers/include/lis3dh.h
  35. 8
      drivers/include/lis3mdl.h
  36. 2
      drivers/include/lpd8808.h
  37. 8
      drivers/include/lps331ap.h
  38. 10
      drivers/include/lsm303dlhc.h
  39. 6
      drivers/include/lsm6dsl.h
  40. 12
      drivers/include/mag3110.h
  41. 14
      drivers/include/mma8x5x.h
  42. 12
      drivers/include/mpl3115a2.h
  43. 8
      drivers/include/mpu9150.h
  44. 4
      drivers/include/mq3.h
  45. 78
      drivers/include/nrf24l01p.h
  46. 22
      drivers/include/pcd8544.h
  47. 2
      drivers/include/pir.h
  48. 2
      drivers/include/pn532.h
  49. 2
      drivers/include/rgbled.h
  50. 2
      drivers/include/servo.h
  51. 14
      drivers/include/si70xx.h
  52. 6
      drivers/include/srf02.h
  53. 9
      drivers/include/srf08.h
  54. 6
      drivers/include/tcs37727.h
  55. 10
      drivers/include/tmp006.h
  56. 2
      drivers/include/tsl2561.h
  57. 2
      drivers/include/veml6070.h
  58. 2
      drivers/io1_xplained/io1_xplained.c
  59. 6
      drivers/isl29020/isl29020.c
  60. 8
      drivers/isl29125/isl29125.c
  61. 10
      drivers/jc42/jc42.c
  62. 6
      drivers/l3g4200d/l3g4200d.c
  63. 12
      drivers/lis3dh/lis3dh.c
  64. 8
      drivers/lis3mdl/lis3mdl.c
  65. 6
      drivers/lpd8808/lpd8808.c
  66. 8
      drivers/lps331ap/lps331ap.c
  67. 10
      drivers/lsm303dlhc/lsm303dlhc.c
  68. 6
      drivers/lsm6dsl/lsm6dsl.c
  69. 12
      drivers/mag3110/mag3110.c
  70. 20
      drivers/mma8x5x/mma8x5x.c
  71. 12
      drivers/mpl3115a2/mpl3115a2.c
  72. 16
      drivers/mpu9150/mpu9150.c
  73. 4
      drivers/mq3/mq3.c
  74. 78
      drivers/nrf24l01p/nrf24l01p.c
  75. 32
      drivers/pcd8544/pcd8544.c
  76. 2
      drivers/pir/pir.c
  77. 10
      drivers/pn532/pn532.c
  78. 2
      drivers/rgbled/rgbled.c
  79. 2
      drivers/servo/servo.c
  80. 16
      drivers/si70xx/si70xx.c
  81. 6
      drivers/srf02/srf02.c
  82. 6
      drivers/srf08/srf08.c
  83. 8
      drivers/tcs37727/tcs37727.c
  84. 10
      drivers/tmp006/tmp006.c
  85. 18
      drivers/tsl2561/tsl2561.c
  86. 4
      drivers/uart_half_duplex/include/uart_half_duplex.h
  87. 8
      drivers/uart_half_duplex/uart_half_duplex.c
  88. 2
      drivers/veml6070/veml6070.c

6
drivers/adt7310/adt7310.c

@ -185,7 +185,7 @@ int adt7310_set_config(adt7310_t *dev, uint8_t config)
return adt7310_write_reg(dev, ADT7310_REG_CONFIG, ADT7310_REG_SIZE_CONFIG, &config);
}
int16_t adt7310_read_raw(adt7310_t *dev)
int16_t adt7310_read_raw(const adt7310_t *dev)
{
int status;
int16_t raw;
@ -201,7 +201,7 @@ int16_t adt7310_read_raw(adt7310_t *dev)
return raw;
}
int32_t adt7310_read(adt7310_t *dev)
int32_t adt7310_read(const adt7310_t *dev)
{
int16_t raw = adt7310_read_raw(dev);
if (raw == INT16_MIN) {
@ -214,7 +214,7 @@ int32_t adt7310_read(adt7310_t *dev)
return ((((int32_t)raw) * 1000) >> ADT7310_VALUE_FRAC_BITS);
}
float adt7310_read_float(adt7310_t *dev)
float adt7310_read_float(const adt7310_t *dev)
{
int16_t raw = adt7310_read_raw(dev);
if (raw == INT16_MIN) {

16
drivers/adxl345/adxl345.c

@ -80,7 +80,7 @@ int adxl345_init(adxl345_t *dev, adxl345_params_t* params)
return ADXL345_OK;
}
void adxl345_read(adxl345_t *dev, adxl345_data_t *data)
void adxl345_read(const adxl345_t *dev, adxl345_data_t *data)
{
int8_t result[6];
@ -95,7 +95,7 @@ void adxl345_read(adxl345_t *dev, adxl345_data_t *data)
data->z = (((result[5] << 8)+result[4]) * dev->scale_factor);
}
void adxl345_set_interrupt(adxl345_t *dev)
void adxl345_set_interrupt(const adxl345_t *dev)
{
assert(dev);
@ -135,7 +135,7 @@ void adxl345_set_interrupt(adxl345_t *dev)
i2c_release(BUS);
}
void adxl345_set_measure(adxl345_t *dev)
void adxl345_set_measure(const adxl345_t *dev)
{
uint8_t reg;
@ -150,7 +150,7 @@ void adxl345_set_measure(adxl345_t *dev)
i2c_release(BUS);
}
void adxl345_set_standby(adxl345_t *dev)
void adxl345_set_standby(const adxl345_t *dev)
{
uint8_t reg;
@ -165,7 +165,7 @@ void adxl345_set_standby(adxl345_t *dev)
i2c_release(BUS);
}
void adxl345_set_sleep(adxl345_t *dev)
void adxl345_set_sleep(const adxl345_t *dev)
{
uint8_t reg;
@ -180,7 +180,7 @@ void adxl345_set_sleep(adxl345_t *dev)
i2c_release(BUS);
}
void adxl345_set_autosleep(adxl345_t *dev)
void adxl345_set_autosleep(const adxl345_t *dev)
{
uint8_t reg;
@ -195,7 +195,7 @@ void adxl345_set_autosleep(adxl345_t *dev)
i2c_release(BUS);
}
void adxl345_set_bandwidth_rate(adxl345_t *dev, uint8_t bw_rate)
void adxl345_set_bandwidth_rate(const adxl345_t *dev, uint8_t bw_rate)
{
uint8_t reg;
@ -210,7 +210,7 @@ void adxl345_set_bandwidth_rate(adxl345_t *dev, uint8_t bw_rate)
i2c_release(BUS);
}
void adxl345_set_fifo_mode(adxl345_t *dev, uint8_t mode,
void adxl345_set_fifo_mode(const adxl345_t *dev, uint8_t mode,
uint8_t output, uint8_t value)
{
uint8_t reg;

30
drivers/at30tse75x/at30tse75x.c

@ -35,7 +35,7 @@ static inline float temperature_to_float(uint16_t temp)
return temp_int + (frac_multiplier * AT30TSE75X_FRACTIONAL_BASE);
}
static int at30tse75x_get_register(at30tse75x_t* dev, uint8_t reg, uint16_t* data)
static int at30tse75x_get_register(const at30tse75x_t *dev, uint8_t reg, uint16_t* data)
{
i2c_acquire(dev->i2c);
xtimer_spin(AT30TSE75X_BUS_FREE_TIME_TICKS);
@ -49,7 +49,7 @@ static int at30tse75x_get_register(at30tse75x_t* dev, uint8_t reg, uint16_t* dat
return 0;
}
static int at30tse75x_set_register(at30tse75x_t* dev, uint8_t reg, uint16_t* data)
static int at30tse75x_set_register(const at30tse75x_t *dev, uint8_t reg, uint16_t *data)
{
i2c_acquire(dev->i2c);
xtimer_spin(AT30TSE75X_BUS_FREE_TIME_TICKS);
@ -63,7 +63,7 @@ static int at30tse75x_set_register(at30tse75x_t* dev, uint8_t reg, uint16_t* dat
return 0;
}
static int at30tse75x_reset(at30tse75x_t* dev)
static int at30tse75x_reset(const at30tse75x_t *dev)
{
i2c_acquire(dev->i2c);
xtimer_spin(AT30TSE75X_BUS_FREE_TIME_TICKS);
@ -77,7 +77,7 @@ static int at30tse75x_reset(at30tse75x_t* dev)
return 0;
}
int at30tse75x_get_config(at30tse75x_t* dev, uint8_t* data)
int at30tse75x_get_config(const at30tse75x_t *dev, uint8_t *data)
{
i2c_acquire(dev->i2c);
xtimer_spin(AT30TSE75X_BUS_FREE_TIME_TICKS);
@ -91,7 +91,7 @@ int at30tse75x_get_config(at30tse75x_t* dev, uint8_t* data)
return 0;
}
int at30tse75x_set_config(at30tse75x_t* dev, uint8_t data)
int at30tse75x_set_config(const at30tse75x_t *dev, uint8_t data)
{
i2c_acquire(dev->i2c);
xtimer_spin(AT30TSE75X_BUS_FREE_TIME_TICKS);
@ -105,7 +105,7 @@ int at30tse75x_set_config(at30tse75x_t* dev, uint8_t data)
return 0;
}
int at30tse75x_set_resolution(at30tse75x_t* dev, at30tse75x_resolution_t resolution)
int at30tse75x_set_resolution(const at30tse75x_t *dev, at30tse75x_resolution_t resolution)
{
uint8_t config;
@ -128,7 +128,7 @@ int at30tse75x_set_resolution(at30tse75x_t* dev, at30tse75x_resolution_t resolut
return 0;
}
int at30tse75x_set_mode(at30tse75x_t* dev, at30tse75x_mode_t mode)
int at30tse75x_set_mode(const at30tse75x_t *dev, at30tse75x_mode_t mode)
{
uint8_t config;
if(at30tse75x_get_config(dev, &config) != 0) {
@ -159,7 +159,7 @@ int at30tse75x_set_mode(at30tse75x_t* dev, at30tse75x_mode_t mode)
return 0;
}
int at30tse75x_set_alarm_polarity(at30tse75x_t* dev, at30tse75x_alarm_polatity_t polarity)
int at30tse75x_set_alarm_polarity(const at30tse75x_t *dev, at30tse75x_alarm_polatity_t polarity)
{
uint8_t config;
if(at30tse75x_get_config(dev, &config) != 0) {
@ -184,7 +184,7 @@ int at30tse75x_set_alarm_polarity(at30tse75x_t* dev, at30tse75x_alarm_polatity_t
return 0;
}
int at30tse75x_set_fault_tolerance(at30tse75x_t* dev, at30tse75x_fault_tolerance_t tolerance)
int at30tse75x_set_fault_tolerance(const at30tse75x_t *dev, at30tse75x_fault_tolerance_t tolerance)
{
if(tolerance < AT30TSE75X_ALARM_AFTER_1 ||
tolerance > AT30TSE75X_ALARM_AFTER_6) {
@ -206,19 +206,19 @@ int at30tse75x_set_fault_tolerance(at30tse75x_t* dev, at30tse75x_fault_tolerance
return 0;
}
int at30tse75x_set_limit_low(at30tse75x_t* dev, int8_t t_low)
int at30tse75x_set_limit_low(const at30tse75x_t *dev, int8_t t_low)
{
uint16_t tmp = (t_low << 8) | (0x00);
return at30tse75x_set_register(dev, AT30TSE75X_REG__LIMIT_LOW, &tmp);
}
int at30tse75x_set_limit_high(at30tse75x_t* dev, int8_t t_high)
int at30tse75x_set_limit_high(const at30tse75x_t *dev, int8_t t_high)
{
uint16_t tmp = (t_high << 8) | (0x00);
return at30tse75x_set_register(dev, AT30TSE75X_REG__LIMIT_HIGH, &tmp);
}
int at30tse75x_save_config(at30tse75x_t* dev)
int at30tse75x_save_config(const at30tse75x_t *dev)
{
i2c_acquire(dev->i2c);
xtimer_spin(AT30TSE75X_BUS_FREE_TIME_TICKS);
@ -232,7 +232,7 @@ int at30tse75x_save_config(at30tse75x_t* dev)
return 0;
}
int at30tse75x_restore_config(at30tse75x_t* dev)
int at30tse75x_restore_config(const at30tse75x_t *dev)
{
i2c_acquire(dev->i2c);
xtimer_spin(AT30TSE75X_BUS_FREE_TIME_TICKS);
@ -246,7 +246,7 @@ int at30tse75x_restore_config(at30tse75x_t* dev)
return 0;
}
int at30tse75x_get_temperature(at30tse75x_t* dev, float* temperature)
int at30tse75x_get_temperature(const at30tse75x_t *dev, float *temperature)
{
uint16_t tmp;
uint8_t config;
@ -282,7 +282,7 @@ int at30tse75x_get_temperature(at30tse75x_t* dev, float* temperature)
return 0;
}
int at30tse75x_init(at30tse75x_t* dev, i2c_t i2c, i2c_speed_t speed, uint8_t addr)
int at30tse75x_init(at30tse75x_t *dev, i2c_t i2c, i2c_speed_t speed, uint8_t addr)
{
uint8_t config;

2
drivers/bh1750fvi/bh1750fvi.c

@ -49,7 +49,7 @@ int bh1750fvi_init(bh1750fvi_t *dev, bh1750fvi_params_t *params)
return BH1750FVI_OK;
}
uint16_t bh1750fvi_sample(bh1750fvi_t *dev)
uint16_t bh1750fvi_sample(const bh1750fvi_t *dev)
{
uint32_t tmp;
uint8_t raw[2];

20
drivers/bmp180/bmp180.c

@ -35,9 +35,9 @@
#define OVERSAMPLING (dev->params.oversampling)
/* Internal function prototypes */
static int _read_ut(bmp180_t *dev, int32_t *ut);
static int _read_up(bmp180_t *dev, int32_t *up);
static int _compute_b5(bmp180_t *dev, int32_t ut, int32_t *b5);
static int _read_ut(const bmp180_t *dev, int32_t *ut);
static int _read_up(const bmp180_t *dev, int32_t *up);
static int _compute_b5(const bmp180_t *dev, int32_t ut, int32_t *b5);
/*---------------------------------------------------------------------------*
* BMP180 Core API *
@ -109,7 +109,7 @@ int bmp180_init(bmp180_t *dev, const bmp180_params_t *params)
return 0;
}
int16_t bmp180_read_temperature(bmp180_t *dev)
int16_t bmp180_read_temperature(const bmp180_t *dev)
{
int32_t ut, b5;
/* Acquire exclusive access */
@ -127,7 +127,7 @@ int16_t bmp180_read_temperature(bmp180_t *dev)
return (int16_t)((b5 + 8) >> 4);
}
uint32_t bmp180_read_pressure(bmp180_t *dev)
uint32_t bmp180_read_pressure(const bmp180_t *dev)
{
int32_t ut = 0, up = 0, x1, x2, x3, b3, b5, b6, p;
uint32_t b4, b7;
@ -168,14 +168,14 @@ uint32_t bmp180_read_pressure(bmp180_t *dev)
return (uint32_t)(p + ((x1 + x2 + 3791) >> 4));
}
int16_t bmp180_altitude(bmp180_t *dev, uint32_t pressure_0)
int16_t bmp180_altitude(const bmp180_t *dev, uint32_t pressure_0)
{
uint32_t p = bmp180_read_pressure(dev);
return (int16_t)(44330.0 * (1.0 - pow((double)p / pressure_0, 0.1903)));;
}
uint32_t bmp180_sealevel_pressure(bmp180_t *dev, int16_t altitude)
uint32_t bmp180_sealevel_pressure(const bmp180_t *dev, int16_t altitude)
{
uint32_t p = bmp180_read_pressure(dev);
@ -186,7 +186,7 @@ uint32_t bmp180_sealevel_pressure(bmp180_t *dev, int16_t altitude)
/* Internal functions */
/*------------------------------------------------------------------------------------*/
static int _read_ut(bmp180_t *dev, int32_t *output)
static int _read_ut(const bmp180_t *dev, int32_t *output)
{
/* Read UT (Uncompsensated Temperature value) */
uint8_t ut[2] = {0};
@ -205,7 +205,7 @@ static int _read_ut(bmp180_t *dev, int32_t *output)
return 0;
}
static int _read_up(bmp180_t *dev, int32_t *output)
static int _read_up(const bmp180_t *dev, int32_t *output)
{
/* Read UP (Uncompsensated Pressure value) */
uint8_t up[3] = {0};
@ -241,7 +241,7 @@ static int _read_up(bmp180_t *dev, int32_t *output)
return 0;
}
static int _compute_b5(bmp180_t *dev, int32_t ut, int32_t *output)
static int _compute_b5(const bmp180_t *dev, int32_t ut, int32_t *output)
{
int32_t x1, x2;
x1 = (ut - dev->calibration.ac6) * dev->calibration.ac5 >> 15;

32
drivers/bmx280/bmx280.c

@ -33,11 +33,11 @@
#include "debug.h"
static int read_calibration_data(bmx280_t* dev);
static int do_measurement(bmx280_t* dev);
static uint8_t get_ctrl_meas(bmx280_t* dev);
static uint8_t get_status(bmx280_t* dev);
static uint8_t read_u8_reg(bmx280_t* dev, uint8_t reg);
static void write_u8_reg(bmx280_t* dev, uint8_t reg, uint8_t b);
static int do_measurement(const bmx280_t* dev);
static uint8_t get_ctrl_meas(const bmx280_t* dev);
static uint8_t get_status(const bmx280_t* dev);
static uint8_t read_u8_reg(const bmx280_t* dev, uint8_t reg);
static void write_u8_reg(const bmx280_t* dev, uint8_t reg, uint8_t b);
static uint16_t get_uint16_le(const uint8_t *buffer, size_t offset);
static int16_t get_int16_le(const uint8_t *buffer, size_t offset);
@ -98,13 +98,13 @@ int bmx280_init(bmx280_t* dev, const bmx280_params_t* params)
* Returns temperature in DegC, resolution is 0.01 DegC.
* t_fine carries fine temperature as global value
*/
int16_t bmx280_read_temperature(bmx280_t* dev)
int16_t bmx280_read_temperature(const bmx280_t* dev)
{
if (do_measurement(dev) < 0) {
return INT16_MIN;
}
bmx280_calibration_t *cal = &dev->calibration; /* helper variable */
const bmx280_calibration_t *cal = &dev->calibration; /* helper variable */
/* Read the uncompensated temperature */
int32_t adc_T = (((uint32_t)measurement_regs[3 + 0]) << 12) |
@ -133,9 +133,9 @@ int16_t bmx280_read_temperature(bmx280_t* dev)
/*
* Returns pressure in Pa
*/
uint32_t bmx280_read_pressure(bmx280_t *dev)
uint32_t bmx280_read_pressure(const bmx280_t *dev)
{
bmx280_calibration_t *cal = &dev->calibration; /* helper variable */
const bmx280_calibration_t *cal = &dev->calibration; /* helper variable */
/* Read the uncompensated pressure */
int32_t adc_P = (((uint32_t)measurement_regs[0 + 0]) << 12) |
@ -173,9 +173,9 @@ uint32_t bmx280_read_pressure(bmx280_t *dev)
}
#if defined(MODULE_BME280)
uint16_t bme280_read_humidity(bmx280_t *dev)
uint16_t bme280_read_humidity(const bmx280_t *dev)
{
bmx280_calibration_t *cal = &dev->calibration; /* helper variable */
const bmx280_calibration_t *cal = &dev->calibration; /* helper variable */
/* Read the uncompensated pressure */
int32_t adc_H = (((uint32_t)measurement_regs[6 + 0]) << 8) |
@ -293,7 +293,7 @@ static int read_calibration_data(bmx280_t* dev)
/**
* @brief Start a measurement and read the registers
*/
static int do_measurement(bmx280_t* dev)
static int do_measurement(const bmx280_t* dev)
{
/*
* If settings has FORCED mode, then the device go to sleep after
@ -330,17 +330,17 @@ static int do_measurement(bmx280_t* dev)
return 0;
}
static uint8_t get_ctrl_meas(bmx280_t* dev)
static uint8_t get_ctrl_meas(const bmx280_t* dev)
{
return read_u8_reg(dev, BMX280_CTRL_MEAS_REG);
}
static uint8_t get_status(bmx280_t* dev)
static uint8_t get_status(const bmx280_t* dev)
{
return read_u8_reg(dev, BMX280_STAT_REG);
}
static uint8_t read_u8_reg(bmx280_t* dev, uint8_t reg)
static uint8_t read_u8_reg(const bmx280_t* dev, uint8_t reg)
{
uint8_t b;
/* Assuming device is correct, it should return 1 (nr bytes) */
@ -348,7 +348,7 @@ static uint8_t read_u8_reg(bmx280_t* dev, uint8_t reg)
return b;
}
static void write_u8_reg(bmx280_t* dev, uint8_t reg, uint8_t b)
static void write_u8_reg(const bmx280_t* dev, uint8_t reg, uint8_t b)
{
/* Assuming device is correct, it should return 1 (nr bytes) */
(void)i2c_write_reg(dev->params.i2c_dev, dev->params.i2c_addr, reg, b);

2
drivers/dht/dht.c

@ -80,7 +80,7 @@ int dht_init(dht_t *dev, const dht_params_t *params)
return DHT_OK;
}
int dht_read(dht_t *dev, int16_t *temp, int16_t *hum)
int dht_read(const dht_t *dev, int16_t *temp, int16_t *hum)
{
uint8_t csum, sum;
uint16_t raw_hum, raw_temp;

10
drivers/dsp0401/dsp0401.c

@ -146,7 +146,7 @@ static const uint8_t dsp0401_charmap[][2] = {
{ 0x00, 0x00 }, /* 127: */
};
static void _shift_char(dsp0401_t *dev, uint8_t c)
static void _shift_char(const dsp0401_t *dev, uint8_t c)
{
/* Unsupported chars not displayed */
if ((c < CHAR_MAP_MIN) || (c > CHAR_MAP_MAX)) {
@ -162,7 +162,7 @@ static void _shift_char(dsp0401_t *dev, uint8_t c)
}
}
static void _latch(dsp0401_t *dev)
static void _latch(const dsp0401_t *dev)
{
xtimer_usleep(LATCH_DELAY);
gpio_set(LAT);
@ -208,7 +208,7 @@ int dsp0401_init(dsp0401_t *dev, const dsp0401_params_t *params)
return DSP0401_OK;
}
void dsp0401_display_text(dsp0401_t *dev, char *text)
void dsp0401_display_text(const dsp0401_t *dev, char *text)
{
unsigned text_len = strlen(text);
for (unsigned i = 0 ; i < MOD_COUNT * 4; ++i) {
@ -222,7 +222,7 @@ void dsp0401_display_text(dsp0401_t *dev, char *text)
_latch(dev);
}
void dsp0401_clear_text(dsp0401_t *dev)
void dsp0401_clear_text(const dsp0401_t *dev)
{
/* each module has 4 alphanumeric displays */
for (unsigned i = 0; i < MOD_COUNT * 4; ++i) {
@ -231,7 +231,7 @@ void dsp0401_clear_text(dsp0401_t *dev)
_latch(dev);
}
void dsp0401_scroll_text(dsp0401_t *dev, char *text, uint16_t delay)
void dsp0401_scroll_text(const dsp0401_t *dev, char *text, uint16_t delay)
{
dsp0401_clear_text(dev);

12
drivers/dynamixel/dynamixel.c

@ -49,7 +49,7 @@ int dynamixel_ping(uart_half_duplex_t *stream, dynamixel_id_t id)
return DYNAMIXEL_OK;
}
int dynamixel_write(dynamixel_t *device, dynamixel_addr_t reg, const uint8_t *data, size_t length)
int dynamixel_write(const dynamixel_t *device, dynamixel_addr_t reg, const uint8_t *data, size_t length)
{
uart_half_duplex_set_tx(device->stream);
if (device->stream->size < length) {
@ -70,17 +70,17 @@ int dynamixel_write(dynamixel_t *device, dynamixel_addr_t reg, const uint8_t *da
return DYNAMIXEL_OK;
}
int dynamixel_write8(dynamixel_t *device, dynamixel_addr_t reg, uint8_t value)
int dynamixel_write8(const dynamixel_t *device, dynamixel_addr_t reg, uint8_t value)
{
return dynamixel_write(device, reg, &value, 1);
}
int dynamixel_write16(dynamixel_t *device, dynamixel_addr_t reg, uint16_t value)
int dynamixel_write16(const dynamixel_t *device, dynamixel_addr_t reg, uint16_t value)
{
return dynamixel_write(device, reg, (uint8_t*)&value, 2);
}
int dynamixel_read(dynamixel_t *device, dynamixel_addr_t reg, uint8_t *data, size_t length)
int dynamixel_read(const dynamixel_t *device, dynamixel_addr_t reg, uint8_t *data, size_t length)
{
uart_half_duplex_set_tx(device->stream);
if (device->stream->size < length) {
@ -113,12 +113,12 @@ int dynamixel_read(dynamixel_t *device, dynamixel_addr_t reg, uint8_t *data, siz
return DYNAMIXEL_OK;
}
int dynamixel_read8(dynamixel_t *device, dynamixel_addr_t reg, uint8_t *value)
int dynamixel_read8(const dynamixel_t *device, dynamixel_addr_t reg, uint8_t *value)
{
return dynamixel_read(device, reg, value, 1);
}
int dynamixel_read16(dynamixel_t *device, dynamixel_addr_t reg, uint16_t *value)
int dynamixel_read16(const dynamixel_t *device, dynamixel_addr_t reg, uint16_t *value)
{
return dynamixel_read(device, reg, (uint8_t*)value, 2);
}

12
drivers/feetech/feetech.c

@ -53,7 +53,7 @@ int feetech_ping(uart_half_duplex_t *stream, feetech_id_t id)
return FEETECH_OK;
}
int feetech_write(feetech_t *device, feetech_addr_t reg, const uint8_t *data, size_t length)
int feetech_write(const feetech_t *device, feetech_addr_t reg, const uint8_t *data, size_t length)
{
uart_half_duplex_set_tx(device->stream);
if (device->stream->size < length) {
@ -74,18 +74,18 @@ int feetech_write(feetech_t *device, feetech_addr_t reg, const uint8_t *data, si
return FEETECH_OK;
}
int feetech_write8(feetech_t *device, feetech_addr_t reg, uint8_t value)
int feetech_write8(const feetech_t *device, feetech_addr_t reg, uint8_t value)
{
return feetech_write(device, reg, &value, 1);
}
int feetech_write16(feetech_t *device, feetech_addr_t reg, uint16_t value)
int feetech_write16(const feetech_t *device, feetech_addr_t reg, uint16_t value)
{
value = htons(value);
return feetech_write(device, reg, (uint8_t*)&value, 2);
}
int feetech_read(feetech_t *device, feetech_addr_t reg, uint8_t *data, size_t length)
int feetech_read(const feetech_t *device, feetech_addr_t reg, uint8_t *data, size_t length)
{
uart_half_duplex_set_tx(device->stream);
if (device->stream->size < length) {
@ -118,12 +118,12 @@ int feetech_read(feetech_t *device, feetech_addr_t reg, uint8_t *data, size_t le
return FEETECH_OK;
}
int feetech_read8(feetech_t *device, feetech_addr_t reg, uint8_t *value)
int feetech_read8(const feetech_t *device, feetech_addr_t reg, uint8_t *value)
{
return feetech_read(device, reg, value, 1);
}
int feetech_read16(feetech_t *device, feetech_addr_t reg, uint16_t *value)
int feetech_read16(const feetech_t *device, feetech_addr_t reg, uint16_t *value)
{
const int ret = feetech_read(device, reg, (uint8_t*)value, 2);
if (ret == FEETECH_OK) {

32
drivers/hd44780/hd44780.c

@ -30,10 +30,10 @@
#include "hd44780.h"
#include "hd44780_internal.h"
static inline void _command(hd44780_t *dev, uint8_t value);
static void _pulse(hd44780_t *dev);
static void _send(hd44780_t *dev, uint8_t value, uint8_t mode);
static void _write_bits(hd44780_t *dev, uint8_t bits, uint8_t value);
static inline void _command(const hd44780_t *dev, uint8_t value);
static void _pulse(const hd44780_t *dev);
static void _send(const hd44780_t *dev, uint8_t value, uint8_t mode);
static void _write_bits(const hd44780_t *dev, uint8_t bits, uint8_t value);
/**
* @brief Send a command to the display
@ -41,7 +41,7 @@ static void _write_bits(hd44780_t *dev, uint8_t bits, uint8_t value);
* @param[in] dev device descriptor of display to initialize
* @param[in] value the command
*/
static inline void _command(hd44780_t *dev, uint8_t value)
static inline void _command(const hd44780_t *dev, uint8_t value)
{
_send(dev, value, HD44780_OFF);
}
@ -51,7 +51,7 @@ static inline void _command(hd44780_t *dev, uint8_t value)
*
* @param[in] dev device descriptor of display to initialize
*/
static void _pulse(hd44780_t *dev)
static void _pulse(const hd44780_t *dev)
{
gpio_clear(dev->p.enable);
xtimer_usleep(HD44780_PULSE_WAIT_SHORT);
@ -68,7 +68,7 @@ static void _pulse(hd44780_t *dev)
* @param[in] value the data value, either char or command
* @param[in] state send state, to distinguish chars and commands
*/
static void _send(hd44780_t *dev, uint8_t value, hd44780_state_t state)
static void _send(const hd44780_t *dev, uint8_t value, hd44780_state_t state)
{
(state == HD44780_ON) ? gpio_set(dev->p.rs) : gpio_clear(dev->p.rs);
/* if RW pin is available, set it to LOW */
@ -85,7 +85,7 @@ static void _send(hd44780_t *dev, uint8_t value, hd44780_state_t state)
}
}
static void _write_bits(hd44780_t *dev, uint8_t bits, uint8_t value)
static void _write_bits(const hd44780_t *dev, uint8_t bits, uint8_t value)
{
for (unsigned i = 0; i < bits; ++i) {
if ((value >> i) & 0x01) {
@ -190,19 +190,19 @@ int hd44780_init(hd44780_t *dev, const hd44780_params_t *params)
return 0;
}
void hd44780_clear(hd44780_t *dev)
void hd44780_clear(const hd44780_t *dev)
{
_command(dev, HD44780_CLEARDISPLAY);
xtimer_usleep(HD44780_CMD_WAIT);
}
void hd44780_home(hd44780_t *dev)
void hd44780_home(const hd44780_t *dev)
{
_command(dev, HD44780_RETURNHOME);
xtimer_usleep(HD44780_CMD_WAIT);
}
void hd44780_set_cursor(hd44780_t *dev, uint8_t col, uint8_t row)
void hd44780_set_cursor(const hd44780_t *dev, uint8_t col, uint8_t row)
{
if (row >= dev->p.rows) {
row = dev->p.rows - 1;
@ -243,12 +243,12 @@ void hd44780_blink(hd44780_t *dev, hd44780_state_t state)
_command(dev, HD44780_DISPLAYCONTROL | dev->ctrl);
}
void hd44780_scroll_left(hd44780_t *dev)
void hd44780_scroll_left(const hd44780_t *dev)
{
_command(dev, HD44780_CURSORSHIFT | HD44780_DISPLAYMOVE | HD44780_MOVELEFT);
}
void hd44780_scroll_right(hd44780_t *dev) {
void hd44780_scroll_right(const hd44780_t *dev) {
_command(dev, HD44780_CURSORSHIFT | HD44780_DISPLAYMOVE | HD44780_MOVERIGHT);
}
@ -275,7 +275,7 @@ void hd44780_autoscroll(hd44780_t *dev, hd44780_state_t state)
_command(dev, HD44780_ENTRYMODESET | dev->mode);
}
void hd44780_create_char(hd44780_t *dev, uint8_t location, uint8_t charmap[])
void hd44780_create_char(const hd44780_t *dev, uint8_t location, uint8_t charmap[])
{
location &= 0x7; /* 8 locations (0-7) possible */
_command(dev, HD44780_SETCGRAMADDR | (location << 3));
@ -284,12 +284,12 @@ void hd44780_create_char(hd44780_t *dev, uint8_t location, uint8_t charmap[])
}
}
void hd44780_write(hd44780_t *dev, uint8_t value)
void hd44780_write(const hd44780_t *dev, uint8_t value)
{
_send(dev, value, HD44780_ON);
}
void hd44780_print(hd44780_t *dev, const char *data )
void hd44780_print(const hd44780_t *dev, const char *data )
{
while (*data != '\0') {
hd44780_write(dev, *data++);

6
drivers/hdc1000/hdc1000.c

@ -76,7 +76,7 @@ int hdc1000_init(hdc1000_t *dev, const hdc1000_params_t *params)
return HDC1000_OK;
}
int hdc1000_trigger_conversion(hdc1000_t *dev)
int hdc1000_trigger_conversion(const hdc1000_t *dev)
{
int status = HDC1000_OK;
assert(dev);
@ -95,7 +95,7 @@ int hdc1000_trigger_conversion(hdc1000_t *dev)
return status;
}
int hdc1000_get_results(hdc1000_t *dev, int16_t *temp, int16_t *hum)
int hdc1000_get_results(const hdc1000_t *dev, int16_t *temp, int16_t *hum)
{
int status = HDC1000_OK;
assert(dev);
@ -124,7 +124,7 @@ int hdc1000_get_results(hdc1000_t *dev, int16_t *temp, int16_t *hum)
return status;
}
int hdc1000_read(hdc1000_t *dev, int16_t *temp, int16_t *hum)
int hdc1000_read(const hdc1000_t *dev, int16_t *temp, int16_t *hum)
{
if (hdc1000_trigger_conversion(dev) != HDC1000_OK) {
return HDC1000_BUSERR;

6
drivers/hih6130/hih6130.c

@ -55,7 +55,7 @@ enum {
#define MEASUREMENT_DELAY (50*1000)
/** @brief Trigger a new measurement on the sensor */
static inline int hih6130_measurement_request(hih6130_t *dev)
static inline int hih6130_measurement_request(const hih6130_t *dev)
{
i2c_acquire(dev->i2c);
@ -77,7 +77,7 @@ void hih6130_init(hih6130_t *dev, i2c_t i2c, uint8_t address)
dev->addr = address;
}
static inline int hih6130_get_humidity_temperature_raw(hih6130_t *dev, uint16_t *humidity_raw, uint16_t *temperature_raw)
static inline int hih6130_get_humidity_temperature_raw(const hih6130_t *dev, uint16_t *humidity_raw, uint16_t *temperature_raw)
{
int status;
uint8_t buf[HIH6130_FULL_DATA_LENGTH];
@ -109,7 +109,7 @@ static inline int hih6130_get_humidity_temperature_raw(hih6130_t *dev, uint16_t
return status;
}
int hih6130_get_humidity_temperature_float(hih6130_t *dev,
int hih6130_get_humidity_temperature_float(const hih6130_t *dev,
float *relative_humidity_percent, float *temperature_celsius)
{
uint16_t hum_raw, temp_raw;

16
drivers/ina220/ina220.c

@ -31,7 +31,7 @@
#include "debug.h"
/** @brief Read one 16 bit register from a INA220 device and swap byte order, if necessary. */
static int ina220_read_reg(ina220_t *dev, uint8_t reg, uint16_t *out)
static int ina220_read_reg(const ina220_t *dev, uint8_t reg, uint16_t *out)
{
union {
uint8_t c[2];
@ -50,7 +50,7 @@ static int ina220_read_reg(ina220_t *dev, uint8_t reg, uint16_t *out)
}
/** @brief Write one 16 bit register to a INA220 device and swap byte order, if necessary. */
static int ina220_write_reg(ina220_t *dev, uint8_t reg, uint16_t in)
static int ina220_write_reg(const ina220_t *dev, uint8_t reg, uint16_t in)
{
union {
uint8_t c[2];
@ -78,32 +78,32 @@ int ina220_init(ina220_t *dev, i2c_t i2c, uint8_t address)
return 0;
}
int ina220_set_calibration(ina220_t *dev, uint16_t calibration)
int ina220_set_calibration(const ina220_t *dev, uint16_t calibration)
{
return ina220_write_reg(dev, INA220_REG_CALIBRATION, calibration);
}
int ina220_set_config(ina220_t *dev, uint16_t config)
int ina220_set_config(const ina220_t *dev, uint16_t config)
{
return ina220_write_reg(dev, INA220_REG_CONFIGURATION, config);
}
int ina220_read_shunt(ina220_t *dev, int16_t *voltage)
int ina220_read_shunt(const ina220_t *dev, int16_t *voltage)
{
return ina220_read_reg(dev, INA220_REG_SHUNT_VOLTAGE, (uint16_t *)voltage);
}
int ina220_read_bus(ina220_t *dev, int16_t *voltage)
int ina220_read_bus(const ina220_t *dev, int16_t *voltage)
{
return ina220_read_reg(dev, INA220_REG_BUS_VOLTAGE, (uint16_t *)voltage);
}
int ina220_read_current(ina220_t *dev, int16_t *current)
int ina220_read_current(const ina220_t *dev, int16_t *current)
{
return ina220_read_reg(dev, INA220_REG_CURRENT, (uint16_t *)current);
}
int ina220_read_power(ina220_t *dev, int16_t *power)
int ina220_read_power(const ina220_t *dev, int16_t *power)
{
return ina220_read_reg(dev, INA220_REG_POWER, (uint16_t *)power);
}

6
drivers/include/adt7310.h

@ -139,7 +139,7 @@ int adt7310_init(adt7310_t *dev, spi_t spi, spi_clk_t clk, gpio_t cs);
* @return raw sensor value on success
* @return INT16_MIN on error
*/
int16_t adt7310_read_raw(adt7310_t *dev);
int16_t adt7310_read_raw(const adt7310_t *dev);
/**
* @brief Read temperature value from sensor and convert to milli-degrees Celsius.
@ -151,7 +151,7 @@ int16_t adt7310_read_raw(adt7310_t *dev);
* @return temperature in milli-degrees Celsius
* @return INT32_MIN on errors
*/
int32_t adt7310_read(adt7310_t *dev);
int32_t adt7310_read(const adt7310_t *dev);
/**
* @brief Read temperature value from sensor and convert to degrees Celsius.
@ -161,7 +161,7 @@ int32_t adt7310_read(adt7310_t *dev);
* @return floating point representation of temperature in degrees Celsius
* @return NaN on errors
*/
float adt7310_read_float(adt7310_t *dev);
float adt7310_read_float(const adt7310_t *dev);
#ifdef __cplusplus
}

16
drivers/include/adxl345.h

@ -181,42 +181,42 @@ int adxl345_init(adxl345_t *dev, adxl345_params_t* params);
* @param[in] dev device descriptor of accelerometer
* @param[out] data the current acceleration data [in mg]
*/
void adxl345_read(adxl345_t *dev, adxl345_data_t *data);
void adxl345_read(const adxl345_t *dev, adxl345_data_t *data);
/**
* @brief set ADXL345's interrupts configuration
*
* @param[in] dev device descriptor of accelerometer
*/
void adxl345_set_interrupt(adxl345_t *dev);
void adxl345_set_interrupt(const adxl345_t *dev);
/**
* @brief set ADXL345's measure mode
*
* @param[in] dev device descriptor of accelerometer
*/
void adxl345_set_measure(adxl345_t *dev);
void adxl345_set_measure(const adxl345_t *dev);
/**
* @brief Set standby mode
*
* @param[in] dev device descriptor of accelerometer
*/
void adxl345_set_standby(adxl345_t *dev);
void adxl345_set_standby(const adxl345_t *dev);
/**
* @brief Set sleep mode
*
* @param[in] dev device descriptor of accelerometer
*/
void adxl345_set_sleep(adxl345_t *dev);
void adxl345_set_sleep(const adxl345_t *dev);
/**
* @brief Set autosleep mode
*
* @param[in] dev device descriptor of accelerometer
*/
void adxl345_set_autosleep(adxl345_t *dev);
void adxl345_set_autosleep(const adxl345_t *dev);
/**
* @brief Set bandwidth rate
@ -224,7 +224,7 @@ void adxl345_set_autosleep(adxl345_t *dev);
* @param[in] dev device descriptor of accelerometer
* @param[in] bw_rate new datarate
*/
void adxl345_set_bandwidth_rate(adxl345_t *dev, uint8_t bw_rate);
void adxl345_set_bandwidth_rate(const adxl345_t *dev, uint8_t bw_rate);
/**
* @brief Set fifo mode with its configuration.
@ -234,7 +234,7 @@ void adxl345_set_bandwidth_rate(adxl345_t *dev, uint8_t bw_rate);
* @param[in] output set trigger output
* @param[in] value set trigger's value
*/
void adxl345_set_fifo_mode(adxl345_t *dev, uint8_t mode,
void adxl345_set_fifo_mode(const adxl345_t *dev, uint8_t mode,
uint8_t output, uint8_t value);
#ifdef __cplusplus

22
drivers/include/at30tse75x.h

@ -188,7 +188,7 @@ int at30tse75x_init(at30tse75x_t* dev, i2c_t i2c, i2c_speed_t speed, uint8_t add
* @return 0 on success
* @return -1 on error
*/
int at30tse75x_save_config(at30tse75x_t* dev);
int at30tse75x_save_config(const at30tse75x_t* dev);
/**
* @brief Restore configuration register from non-volatile backup register
@ -198,7 +198,7 @@ int at30tse75x_save_config(at30tse75x_t* dev);
* @return 0 on success
* @return -1 on error
*/
int at30tse75x_restore_config(at30tse75x_t* dev);
int at30tse75x_restore_config(const at30tse75x_t* dev);
/**
* @brief Get content of configuration register
@ -209,7 +209,7 @@ int at30tse75x_restore_config(at30tse75x_t* dev);
* @return 0 on success
* @return -1 on error
*/
int at30tse75x_get_config(at30tse75x_t* dev, uint8_t* data);
int at30tse75x_get_config(const at30tse75x_t* dev, uint8_t* data);
/**
* @brief Set content of configuration register
@ -220,7 +220,7 @@ int at30tse75x_get_config(at30tse75x_t* dev, uint8_t* data);
* @return 0 on success
* @return -1 on error
*/
int at30tse75x_set_config(at30tse75x_t* dev, uint8_t data);
int at30tse75x_set_config(const at30tse75x_t* dev, uint8_t data);
/**
* @brief Set temperature resolution
@ -232,7 +232,7 @@ int at30tse75x_set_config(at30tse75x_t* dev, uint8_t data);
* @return -1 on error
* @return -2 on bad user input
*/
int at30tse75x_set_resolution(at30tse75x_t* dev, at30tse75x_resolution_t resolution);
int at30tse75x_set_resolution(const at30tse75x_t* dev, at30tse75x_resolution_t resolution);
/**
* @brief Set operation mode
@ -244,7 +244,7 @@ int at30tse75x_set_resolution(at30tse75x_t* dev, at30tse75x_resolution_t resolut
* @return -1 on device error
* @return -2 on bad user input
*/
int at30tse75x_set_mode(at30tse75x_t* dev, at30tse75x_mode_t mode);
int at30tse75x_set_mode(const at30tse75x_t* dev, at30tse75x_mode_t mode);
/**
* @brief Set polarity of ALERT pin
@ -256,7 +256,7 @@ int at30tse75x_set_mode(at30tse75x_t* dev, at30tse75x_mode_t mode);
* @return -1 on device error
* @return -2 on bad user input
*/
int at30tse75x_set_alarm_polarity(at30tse75x_t* dev, at30tse75x_alarm_polatity_t polarity);
int at30tse75x_set_alarm_polarity(const at30tse75x_t* dev, at30tse75x_alarm_polatity_t polarity);
/**
* @brief Set tolerance to outlying measurements
@ -268,7 +268,7 @@ int at30tse75x_set_alarm_polarity(at30tse75x_t* dev, at30tse75x_alarm_polatity_t
* @return -1 on device error
* @return -2 on bad user input
*/
int at30tse75x_set_fault_tolerance(at30tse75x_t* dev, at30tse75x_fault_tolerance_t tolerance);
int at30tse75x_set_fault_tolerance(const at30tse75x_t* dev, at30tse75x_fault_tolerance_t tolerance);
/**
* @brief Set T_Low limit
@ -280,7 +280,7 @@ int at30tse75x_set_fault_tolerance(at30tse75x_t* dev, at30tse75x_fault_tolerance
* @return -1 on device error
* @return -2 on bad user input
*/
int at30tse75x_set_limit_low(at30tse75x_t* dev, int8_t t_low);
int at30tse75x_set_limit_low(const at30tse75x_t* dev, int8_t t_low);
/**
* @brief Set T_High limit
@ -291,7 +291,7 @@ int at30tse75x_set_limit_low(at30tse75x_t* dev, int8_t t_low);
* @return 0 on success
* @return -1 on error
*/
int at30tse75x_set_limit_high(at30tse75x_t* dev, int8_t t_high);
int at30tse75x_set_limit_high(const at30tse75x_t* dev, int8_t t_high);
/**
* @brief Get measured temperature
@ -302,7 +302,7 @@ int at30tse75x_set_limit_high(at30tse75x_t* dev, int8_t t_high);
* @return 0 on success
* @return -1 on error
*/
int at30tse75x_get_temperature(at30tse75x_t* dev, float* temperature);
int at30tse75x_get_temperature(const at30tse75x_t* dev, float* temperature);
#ifdef __cplusplus
}

2
drivers/include/bh1750fvi.h

@ -95,7 +95,7 @@ int bh1750fvi_init(bh1750fvi_t *dev, bh1750fvi_params_t *params);
*
* @return ambient light intensity in LUX
*/
uint16_t bh1750fvi_sample(bh1750fvi_t *dev);
uint16_t bh1750fvi_sample(const bh1750fvi_t *dev);
#ifdef __cplusplus
}

8
drivers/include/bmp180.h

@ -104,7 +104,7 @@ int bmp180_init(bmp180_t *dev, const bmp180_params_t *params);
*
* @return Temperature in d°C
*/
int16_t bmp180_read_temperature(bmp180_t *dev);
int16_t bmp180_read_temperature(const bmp180_t *dev);
/**
* @brief Read pressure value from the given BMP180 device, returned in Pa
@ -113,7 +113,7 @@ int16_t bmp180_read_temperature(bmp180_t *dev);
*
* @return Pressure in Pa
*/
uint32_t bmp180_read_pressure(bmp180_t *dev);
uint32_t bmp180_read_pressure(const bmp180_t *dev);
/**
* @brief Compute altitude, returned in m.
@ -123,7 +123,7 @@ uint32_t bmp180_read_pressure(bmp180_t *dev);
*
* @return Altitude in m
*/
int16_t bmp180_altitude(bmp180_t *dev, uint32_t pressure_0);
int16_t bmp180_altitude(const bmp180_t *dev, uint32_t pressure_0);
/**
* @brief Compute pressure at sea level, returned in Pa.
@ -133,7 +133,7 @@ int16_t bmp180_altitude(bmp180_t *dev, uint32_t pressure_0);
*
* @return Pressure at sea level in Pa
*/
uint32_t bmp180_sealevel_pressure(bmp180_t *dev, int16_t altitude);
uint32_t bmp180_sealevel_pressure(const bmp180_t *dev, int16_t altitude);
#ifdef __cplusplus
}

6
drivers/include/bmx280.h

@ -183,7 +183,7 @@ int bmx280_init(bmx280_t* dev, const bmx280_params_t* params);
* @returns The temperature in centi Celsius. In case of an error
* it returns INT16_MIN.
*/
int16_t bmx280_read_temperature(bmx280_t* dev);
int16_t bmx280_read_temperature(const bmx280_t* dev);
/**
* @brief Read air pressure value from the given BMX280 device, returned in PA
@ -195,7 +195,7 @@ int16_t bmx280_read_temperature(bmx280_t* dev);
*
* @returns The air pressure in Pa
*/
uint32_t bmx280_read_pressure(bmx280_t *dev);
uint32_t bmx280_read_pressure(const bmx280_t *dev);
#if defined(MODULE_BME280)
/**
@ -208,7 +208,7 @@ uint32_t bmx280_read_pressure(bmx280_t *dev);
*
* @returns Humidity in centi %RH (i.e. the percentage times 100)
*/
uint16_t bme280_read_humidity(bmx280_t *dev);
uint16_t bme280_read_humidity(const bmx280_t *dev);
#endif
#ifdef __cplusplus

2
drivers/include/dht.h

@ -116,7 +116,7 @@ int dht_init(dht_t *dev, const dht_params_t *params);
* @return -1 on checksum error
* @return -2 on parsing error
*/
int dht_read(dht_t *dev, int16_t *temp, int16_t *hum);
int dht_read(const dht_t *dev, int16_t *temp, int16_t *hum);
#ifdef __cplusplus
}

6
drivers/include/dsp0401.h

@ -83,14 +83,14 @@ int dsp0401_init(dsp0401_t *dev, const dsp0401_params_t *params);
* @param[in] dev Device descriptor of the DSP0401 device
* @param[in] text The text to display
*/
void dsp0401_display_text(dsp0401_t *dev, char *text);
void dsp0401_display_text(const dsp0401_t *dev, char *text);
/**
* @brief Clear the text displayed on the DSP0401
*
* @param[in] dev Device descriptor of the DSP0401 device
*/
void dsp0401_clear_text(dsp0401_t *dev);
void dsp0401_clear_text(const dsp0401_t *dev);
/**
* @brief Scroll the given text on the DSP0401
@ -99,7 +99,7 @@ void dsp0401_clear_text(dsp0401_t *dev);
* @param[in] text The text to scroll on the display
* @param[in] delay Delay in ms between each horizontal move
*/
void dsp0401_scroll_text(dsp0401_t *dev, char *text, uint16_t delay);
void dsp0401_scroll_text(const dsp0401_t *dev, char *text, uint16_t delay);