Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions drivers/sensors/bmp280.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ static int bmp280_putreg8(FAR struct bmp280_dev_s *priv, uint8_t regaddr,
/* Sensor methods */

static int bmp280_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
static int bmp280_activate(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
bool enable);
static int bmp280_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR char *buffer, size_t buflen);

/****************************************************************************
Expand Down Expand Up @@ -504,6 +507,7 @@ static uint32_t bmp280_compensate_press(FAR struct bmp280_dev_s *priv,
****************************************************************************/

static int bmp280_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
{
FAR struct bmp280_dev_s *priv = container_of(lower,
Expand Down Expand Up @@ -557,6 +561,7 @@ static int bmp280_set_interval(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int bmp280_activate(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
bool enable)
{
FAR struct bmp280_dev_s *priv = container_of(lower,
Expand Down Expand Up @@ -591,6 +596,7 @@ static int bmp280_activate(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int bmp280_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR char *buffer, size_t buflen)
{
FAR struct bmp280_dev_s *priv = container_of(lower,
Expand Down
21 changes: 15 additions & 6 deletions drivers/sensors/ds18b20.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,20 @@ struct ds18b20_dev_s
/* Sensor functions */

static int ds18b20_active(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
bool enabled);

static int ds18b20_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR char *buffer, size_t buflen);

static int ds18b20_control(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
int cmd, unsigned long arg);

#ifdef CONFIG_SENSORS_DS18B20_POLL
static int ds18b20_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
#endif

Expand Down Expand Up @@ -623,16 +627,18 @@ static int ds18b20_measure_read(FAR struct ds18b20_dev_s *dev,
* conversion.
*
* Parameter:
* lower - Pointer to lower half sensor driver instance
* buffer - Pointer to the buffer for reading data
* buflen - Size of the buffer
* lower - Pointer to lower half sensor driver instance.
* filep - The pointer of file, represents each user using the sensor.
* buffer - Pointer to the buffer for reading data.
* buflen - Size of the buffer.
*
* Return:
* OK - on success
****************************************************************************/

static int ds18b20_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR char *buffer, size_t buflen)
FAR struct file *filep,
FAR char *buffer, size_t buflen)
{
int ret;
struct ds18b20_sensor_data_s data;
Expand Down Expand Up @@ -673,7 +679,8 @@ static int ds18b20_fetch(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int ds18b20_control(FAR struct sensor_lowerhalf_s *lower,
int cmd, unsigned long arg)
FAR struct file *filep,
int cmd, unsigned long arg)
{
int ret;
struct ds18b20_dev_s *priv = (FAR struct ds18b20_dev_s *)lower;
Expand Down Expand Up @@ -740,6 +747,7 @@ static int ds18b20_control(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int ds18b20_active(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
bool enabled)
{
#ifdef CONFIG_SENSORS_DS18B20_POLL
Expand Down Expand Up @@ -778,7 +786,8 @@ static int ds18b20_active(FAR struct sensor_lowerhalf_s *lower,

#ifdef CONFIG_SENSORS_DS18B20_POLL
static int ds18b20_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR unsigned long *period_us)
FAR struct file *filep,
FAR unsigned long *period_us)
{
FAR struct ds18b20_dev_s *priv = (FAR struct ds18b20_dev_s *)lower;
priv->interval = *period_us;
Expand Down
9 changes: 7 additions & 2 deletions drivers/sensors/fakesensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ struct fakesensor_s
****************************************************************************/

static int fakesensor_activate(FAR struct sensor_lowerhalf_s *lower,
bool sw);
FAR struct file *filep, bool sw);
static int fakesensor_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
static int fakesensor_batch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *latency_us);
static void fakesensor_push_event(FAR struct sensor_lowerhalf_s *lower);
static int fakesensor_thread(int argc, char** argv);
Expand Down Expand Up @@ -213,7 +215,8 @@ static inline void fakesensor_read_gps(FAR struct fakesensor_s *sensor)
sizeof(struct sensor_gps));
}

static int fakesensor_activate(FAR struct sensor_lowerhalf_s *lower, bool sw)
static int fakesensor_activate(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep, bool sw)
{
FAR struct fakesensor_s *sensor = container_of(lower,
struct fakesensor_s, lower);
Expand All @@ -234,6 +237,7 @@ static int fakesensor_activate(FAR struct sensor_lowerhalf_s *lower, bool sw)
}

static int fakesensor_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
{
FAR struct fakesensor_s *sensor = container_of(lower,
Expand All @@ -243,6 +247,7 @@ static int fakesensor_set_interval(FAR struct sensor_lowerhalf_s *lower,
}

static int fakesensor_batch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *latency_us)
{
FAR struct fakesensor_s *sensor = container_of(lower,
Expand Down
17 changes: 12 additions & 5 deletions drivers/sensors/hyt271.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,19 @@ struct hyt271_dev_s
/* Sensor functions */

static int hyt271_active(FAR struct sensor_lowerhalf_s *lower,
bool enabled);
FAR struct file *filep, bool enabled);

static int hyt271_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR char *buffer, size_t buflen);

static int hyt271_control(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
int cmd, unsigned long arg);

#ifdef CONFIG_SENSORS_HYT271_POLL
static int hyt271_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
#endif

Expand Down Expand Up @@ -601,15 +604,17 @@ static int hyt271_measure_read(FAR struct hyt271_dev_s *dev,
* conversion.
*
* Parameter:
* lower - Pointer to lower half sensor driver instance
* buffer - Pointer to the buffer for reading data
* buflen - Size of the buffer
* lower - Pointer to lower half sensor driver instance.
* filep - The pointer of file, represents each user using the sensor.
* buffer - Pointer to the buffer for reading data.
* buflen - Size of the buffer.
*
* Return:
* OK - on success
****************************************************************************/

static int hyt271_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR char *buffer, size_t buflen)
{
int ret;
Expand Down Expand Up @@ -664,6 +669,7 @@ static int hyt271_fetch(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int hyt271_control(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
int cmd, unsigned long arg)
{
int ret;
Expand Down Expand Up @@ -712,7 +718,7 @@ static int hyt271_control(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int hyt271_active(FAR struct sensor_lowerhalf_s *lower,
bool enabled)
FAR struct file *filep, bool enabled)
{
#ifdef CONFIG_SENSORS_HYT271_POLL
bool start_thread = false;
Expand Down Expand Up @@ -751,6 +757,7 @@ static int hyt271_active(FAR struct sensor_lowerhalf_s *lower,

#ifdef CONFIG_SENSORS_HYT271_POLL
static int hyt271_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
{
FAR struct hyt271_sensor_s *priv = (FAR struct hyt271_sensor_s *)lower;
Expand Down
6 changes: 4 additions & 2 deletions drivers/sensors/l3gd20.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ static void l3gd20_read_temperature(FAR struct l3gd20_dev_s *dev,
static int l3gd20_interrupt_handler(int irq, FAR void *context,
FAR void *arg);
static int l3gd20_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable);
FAR struct file *filep, bool enable);
#if CONFIG_SENSORS_L3GD20_BUFFER_SIZE > 0
static void l3gd20_worker(FAR void *arg);
#else
static int l3gd20_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR char *buffer, size_t buflen);
#endif

Expand Down Expand Up @@ -403,6 +404,7 @@ static void l3gd20_worker(FAR void *arg)
****************************************************************************/

static int l3gd20_fetch(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR char *buffer, size_t buflen)
{
FAR struct l3gd20_dev_s *priv = container_of(lower,
Expand All @@ -427,7 +429,7 @@ static int l3gd20_fetch(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int l3gd20_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable)
FAR struct file *filep, bool enable)
{
FAR struct l3gd20_dev_s *priv = container_of(lower,
FAR struct l3gd20_dev_s,
Expand Down
6 changes: 4 additions & 2 deletions drivers/sensors/ms5611.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ static unsigned long ms5611_curtime(void);
/* Sensor methods */

static int ms5611_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us);
static int ms5611_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable);
FAR struct file *filep, bool enable);

#if 0 /* Please read below */
static int ms5611_fetch(FAR struct sensor_lowerhalf_s *lower,
Expand Down Expand Up @@ -540,6 +541,7 @@ static uint32_t ms5611_compensate_press(FAR struct ms5611_dev_s *priv,
****************************************************************************/

static int ms5611_set_interval(FAR struct sensor_lowerhalf_s *lower,
FAR struct file *filep,
FAR unsigned long *period_us)
{
FAR struct ms5611_dev_s *priv = container_of(lower,
Expand All @@ -555,7 +557,7 @@ static int ms5611_set_interval(FAR struct sensor_lowerhalf_s *lower,
****************************************************************************/

static int ms5611_activate(FAR struct sensor_lowerhalf_s *lower,
bool enable)
FAR struct file *filep, bool enable)
{
bool start_thread = false;
struct ms5611_dev_s *priv = (FAR struct ms5611_dev_s *)lower;
Expand Down
Loading