PebbleOS v4.47.0-1362-gd278268fe
Loading...
Searching...
No Matches
pbl_sensor_ops Struct Reference

Driver operations. More...

#include <driver.h>

Data Fields

int(* init )(const struct pbl_sensor *sensor)
 Optional.
 
int(* read )(const struct pbl_sensor *sensor, enum pbl_sensor_type type, struct pbl_sensor_frame *frame)
 Fill frame with the latest values of type, and maybe other types it measures.
 
int(* attr_set )(const struct pbl_sensor *sensor, enum pbl_sensor_type type, enum pbl_sensor_attr attr, int32_t *val)
 Optional.
 
int(* attr_get )(const struct pbl_sensor *sensor, enum pbl_sensor_type type, enum pbl_sensor_attr attr, int32_t *val)
 Optional.
 
int(* set_event )(const struct pbl_sensor *sensor, enum pbl_sensor_event_type type, bool on)
 Optional.
 
int(* event_attr_set )(const struct pbl_sensor *sensor, enum pbl_sensor_event_type type, enum pbl_sensor_event_attr attr, int32_t *val)
 Optional.
 
int(* event_attr_get )(const struct pbl_sensor *sensor, enum pbl_sensor_event_type type, enum pbl_sensor_event_attr attr, int32_t *val)
 Optional.
 
int(* attr_get_avail )(const struct pbl_sensor *sensor, enum pbl_sensor_type type, enum pbl_sensor_attr attr, struct pbl_sensor_attr_avail *avail)
 Optional.
 
int(* flush )(const struct pbl_sensor *sensor)
 Optional.
 
void(* buf_ready )(const struct pbl_sensor *sensor)
 Optional.
 

Detailed Description

Driver operations.

Called with the device lock held, only for the types and events the device declares. See the class functions for their semantics.

Field Documentation

◆ attr_get

int(* pbl_sensor_ops::attr_get) (const struct pbl_sensor *sensor, enum pbl_sensor_type type, enum pbl_sensor_attr attr, int32_t *val)

Optional.

Get an attribute.

◆ attr_get_avail

int(* pbl_sensor_ops::attr_get_avail) (const struct pbl_sensor *sensor, enum pbl_sensor_type type, enum pbl_sensor_attr attr, struct pbl_sensor_attr_avail *avail)

Optional.

Get the values an attribute takes; they stay valid.

◆ attr_set

int(* pbl_sensor_ops::attr_set) (const struct pbl_sensor *sensor, enum pbl_sensor_type type, enum pbl_sensor_attr attr, int32_t *val)

Optional.

Set an attribute, writing back the value applied.

◆ buf_ready

void(* pbl_sensor_ops::buf_ready) (const struct pbl_sensor *sensor)

Optional.

A batch buffer is free again after pbl_sensor_buf_alloc() found none: read what was left queued in the hardware. Called from the high priority system work queue.

◆ event_attr_get

int(* pbl_sensor_ops::event_attr_get) (const struct pbl_sensor *sensor, enum pbl_sensor_event_type type, enum pbl_sensor_event_attr attr, int32_t *val)

Optional.

Get an event attribute.

◆ event_attr_set

int(* pbl_sensor_ops::event_attr_set) (const struct pbl_sensor *sensor, enum pbl_sensor_event_type type, enum pbl_sensor_event_attr attr, int32_t *val)

Optional.

Set an event attribute, writing back the value applied.

◆ flush

int(* pbl_sensor_ops::flush) (const struct pbl_sensor *sensor)

Optional.

Report the frames queued in the hardware.

◆ init

int(* pbl_sensor_ops::init) (const struct pbl_sensor *sensor)

Optional.

Bring the hardware up. Returns 0, -ENODEV if the part does not answer, or a negative errno.

◆ read

int(* pbl_sensor_ops::read) (const struct pbl_sensor *sensor, enum pbl_sensor_type type, struct pbl_sensor_frame *frame)

Fill frame with the latest values of type, and maybe other types it measures.

◆ set_event

int(* pbl_sensor_ops::set_event) (const struct pbl_sensor *sensor, enum pbl_sensor_event_type type, bool on)

Optional.

Enable or disable the detection of an event.


The documentation for this struct was generated from the following file: