apds9930: enable sensor before read out sensor data
Changes in library: - enableProximity() function is to enable or disable proximity sensor - enableIlluminance() function is to enable or disable illuminance sensor - run clang-format Changes in example: - proximity and illuminance kernel IIO-based driver init state is power off, require enable before read out sensor data. Sleep time is needed after enable, the sleep time may vary on different platform. - run clang-format Signed-off-by: Lay, Kuan Loon <kuan.loon.lay@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
committed by
Mihai Tudor Panu
parent
40fe6654eb
commit
e64f192fb7
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Author: Lay, Kuan Loon <kuan.loon.lay@intel.com>
|
||||
* Copyright (c) 2015 Intel Corporation.
|
||||
* Copyright (c) 2016 Intel Corporation.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
@@ -75,6 +75,16 @@ class APDS9930
|
||||
* @return Proximity value
|
||||
*/
|
||||
int getProximity();
|
||||
/**
|
||||
* Enable proximity
|
||||
* @param enable state
|
||||
*/
|
||||
bool enableProximity(bool enable);
|
||||
/**
|
||||
* Enable illuminance
|
||||
* @param enable state
|
||||
*/
|
||||
bool enableIlluminance(bool enable);
|
||||
|
||||
private:
|
||||
mraa_iio_context m_iio;
|
||||
|
||||
Reference in New Issue
Block a user