Skip to content

Commit 4d07b60

Browse files
John Hutchersonjohnlange2
authored andcommitted
drivers: sensor: updated AS6212 sample
Updated for as6212 sample. added application user callback attribute. Signed-off-by: John Hutcherson <John.Hutcherson9@T-Mobile.com>
1 parent 3f8f6fe commit 4d07b60

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/sensor/tmp108/tmp108.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,16 @@ static int tmp108_attr_set(const struct device *dev,
295295
mode);
296296
break;
297297

298+
case SENSOR_ATTR_USER_CALLBACK:
299+
if (val->val1 > 0) {
300+
if (val->val2) {
301+
/* set application interrupt callback routine */
302+
drv_data->temp_alert_handler =
303+
(sensor_trigger_handler_t)val->val2;
304+
}
305+
}
306+
break;
307+
298308
default:
299309
return -ENOTSUP;
300310
}

include/zephyr/drivers/sensor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,8 @@ enum sensor_attribute {
318318
* to the new sampling frequency.
319319
*/
320320
SENSOR_ATTR_FF_DUR,
321+
/** user application interrupt callback */
322+
SENSOR_ATTR_USER_CALLBACK,
321323
/**
322324
* Number of all common sensor attributes.
323325
*/

0 commit comments

Comments
 (0)