Commit Graph

301 Commits

Author SHA1 Message Date
Xiang Xiao
9473434587 Ensure the kernel component don't call userspace API
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-03-01 09:23:09 +09:00
Gustavo Henrique Nihei
55d66f60a3 drivers: Fix typos reported by codespell 2021-02-25 18:57:18 -08:00
Jiuzhu Dong
936ce77d21 driver/sensor: gets the capacity of the hardware fifo
to hold the number of events

Change-Id: I58a9ad07913c7b189e1fd229ab22e91e220e01f6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-24 15:26:15 -03:00
Jiuzhu Dong
46ea549630 driver/sensor: Fetch(with O_NONBLOCK) will directly return.
when sensor is disable.

Change-Id: I02c02aa447ee0b0d681082b4209ecd36e10f2547
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-24 15:26:15 -03:00
Jiuzhu Dong
54ea96da6b driver/sensor: replace lower->buffer_size with lower->buffer_number
more efficient

Change-Id: I0823b10248caf75e4dd6a5086ad230ba4a7298f6
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-02-24 15:26:15 -03:00
buyuer
a2c79bed20 Add fakesensor driver.
This driver can read sensor data from csv file.

Signed-off-by: buyuer <dingddding@163.com>
2021-02-11 09:28:55 -08:00
Alin Jerpelea
bdb4b344a8 drivers: sensors: bmi160.c: nxstyle fixes
Nxstyle fixes to pass CI

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-01-26 05:11:58 -08:00
Alin Jerpelea
f22683a0a6 drivers: replace licenses with Apache 2.0
This change is a license change to Apache 2.0 license.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-01-26 05:11:58 -08:00
Matias N
76cc5c36e4 bmp280: convert to common sensor interface 2021-01-18 21:08:34 -03:00
Matias N
42b6c665da sensor: change set_interval to use a value, not a pointer to value 2021-01-18 21:08:34 -03:00
Matias N
1b8e9312dc bmp280: minor fixes
Fixed a minor typo, a missing break in switch (gave error while
actually did the right thing) and added settable I2C frequency
2021-01-18 17:36:10 -03:00
ligd
f63db66382 mqueue: add file_mq_xx for kernel use
Change-Id: Ida12f5938388cca2f233a4cde90277a218033645
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-01-05 02:40:43 -06:00
Xiang Xiao
c647faa117 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-31 09:37:29 +01:00
Xiang Xiao
0defe43282 OS internal function should indicate the error by return negative value
instead to change errno value by calling set_errno

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-12-31 09:37:29 +01:00
YAMAMOTO Takashi
a0c7a14fed drivers/sensors/bmp180.c: Fix syslog formats 2020-12-05 08:13:32 -06:00
YAMAMOTO Takashi
5c871c6f47 drivers/sensors/bmp180.c: Appease nxstyle 2020-12-05 08:13:32 -06:00
YAMAMOTO Takashi
e3617dd8fb drivers/sensors/ina219.c: Fix a syslog format 2020-12-05 08:13:32 -06:00
YAMAMOTO Takashi
41f22bdba0 drivers/sensors/ina219.c: Appease nxstyle 2020-12-05 08:13:32 -06:00
YAMAMOTO Takashi
f5a5ec2d81 drivers/sensors/lm75.c: Fix syslog format 2020-11-30 05:28:17 -06:00
YAMAMOTO Takashi
a9ae7edb95 drivers/sensors/lm75.c: Appease nxstyle 2020-11-30 05:28:17 -06:00
YAMAMOTO Takashi
aa294546f4 drivers/sensors/xen1210.c: Fix syslog formats 2020-11-30 05:28:17 -06:00
YAMAMOTO Takashi
52d539d201 drivers/sensors/xen1210.c: Appease nxstyle 2020-11-30 05:28:17 -06:00
YAMAMOTO Takashi
53a3d652b5 drivers/sensors/max31855.c: Fix a syslog format 2020-11-27 23:38:40 -06:00
YAMAMOTO Takashi
6a9a3d05d8 drivers/sensors/max31855.c: Appease nxstyle 2020-11-27 23:38:40 -06:00
Augusto Fraga Giachero
ffcedfd971 Remove copyright from headers 2020-11-25 05:13:46 -08:00
Augusto Fraga Giachero
6a43daa67e Update licenses to Apache 2.0 2020-11-25 05:13:46 -08:00
YAMAMOTO Takashi
f8da954e7c drivers/sensors/sensor.c: Fix a syslog format 2020-11-24 22:31:33 -08:00
dongjiuzhu
148afd9548 driver/sensors: support custom type of sensor.
For examples, the custom sensor could define:
struct custem_event_s
{
  uint64_t timestamp;
  int16_t adc[8];
};
struct sensor_lowerhalf_s g_lower =
{
 .buffer_size = 1024,
};
sensor_custom_register(lower, "/dev/sensor/custom0", sizeof(struct custem_event_s));

Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-24 13:23:15 -03:00
dongjiuzhu
8f9ca79ffc driver/sensor rc: use mm/circbuf manage intermediate buffer
N/A

Change-Id: Ifdd8117da9d20ac2f48f04b7b383449e6dd03f06
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-20 05:33:03 -08:00
dongjiuzhu
60d1755e04 drivers: l3gd20 supports the sensor driver model
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-19 18:13:17 -08:00
dongjiuzhu
089b1c17f6 driver/sensor: add fetch api to read sensor data directly
1.use userspace buffer rather than intermediate buffer of upperhalf driver
2.support block and non-block ways.

Change-Id: I1d0cecfaa20ce54961c58713d8f2f8857e349791
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
dongjiuzhu
2cda16b606 driver/sensor: add new feature about sensor driver
1.support for multi-user access
2.support special cmd to control sensor
3.support userspace to set size of intermediate buffer
  by ioctl: SNOIC_SET_BUFFER_SIZE

Change-Id: I9ce3a65b88b12c28388ec397431f1a277b120c2a
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
dongjiuzhu
2482052228 driver/sensor: user specifies device register number
N/A

Change-Id: Idd11461f933dd21b7271cd3ca87a2e33127a9d34
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-11 18:25:22 -08:00
Brennan Ashton
54832f37f2 sim: Initial Linux i2c bus support
This adds the inital wiring for i2c bus support in the sim target
and for Linux host adds the lower half that uses the i2c chardev.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
2020-11-04 23:51:09 -08:00
Yoshinori Sugino
3ac90fca79 Remove tabs and spaces at the end of lines 2020-10-24 09:38:21 +01:00
dongjiuzhu
a3f978da02 sensor/driver: wtgahrs2 by serial interface follow sensor.c/sensor.h
Wtgahrs2 integrates multiple sensor: accel, gyro, mag, baro and gps.

Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-22 10:17:36 -03:00
dongjiuzhu
fa09c6a8bc driver/sensor: add unified management for sensor
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-10-22 10:17:36 -03:00
Xiang Xiao
eb4121ce38 Change all 'Nuttx' to 'NuttX'
Unify the naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-10-20 01:45:06 -07:00
Philippe Coval
cafe24528c sensors: Support fxos8700cq motion I2C sensor
Device is composed of
3-axis, linear accelerometer and 3-axis, magnetometer

It is onboarded in NXP FRDM-K64F SBC.

Change-Id: I405a12cbf2c9994f3bd66e108d2eb8faeee00e18
Bug: https://github.com/apache/incubator-nuttx/issues/1988
Relate-to: https://www.nxp.com/docs/en/data-sheet/FXOS8700CQ.pdf
Forwarded: https://github.com/apache/incubator-nuttx/pull/1989
Signed-off-by: Philippe Coval <rzr@users.sf.net>
2020-10-16 10:10:35 +08:00
raiden00pl
1621305e79 drivers: Changed headers for apache 2.0 license 2020-10-10 12:24:28 -06:00
Ouss4
c98ec2ad3e drivers/sensors/mpu60x0.c: Correct comments. 2020-09-01 18:18:24 -03:00
Xiang Xiao
acca9fcc3b sched/wdog: Remove MAX_WDOGPARMS and related stuff
since the variable arguments are error prone and seldom used.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-14 08:19:50 -06:00
Xiang Xiao
ed786986ed sensors/ak09912: Ensure ak09912_dev_s zero in ak09912_register
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-12 08:27:19 -03:00
Xiang Xiao
a0ce81d659 sched/wdog: Don't dynamically allocate wdog_s
to save the preserved space(1KB) and also avoid the heap overhead

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I694073f68e1bd63960cedeea1ddec441437be025
2020-08-11 12:28:55 -06:00
Xiang Xiao
f618de9c97 Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Xiang Xiao
4c706771c3 sched/wdog: Replace all callback argument from uint32_t to wdparm_t
and alwasy cast the argument of wd_start to wdparm_t

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-08-08 17:30:26 -03:00
Ouss4
701100f6f9 drivers/sensors/mpu60x0: Add I2C support. 2020-06-24 23:30:34 -03:00
Matias Nitsche
53387b53c6 style fixes 2020-06-16 01:01:14 +01:00
Matias Nitsche
6c333d7cbf bmp280: support getting temperature via ioctl() 2020-06-16 01:01:14 +01:00
Xiang Xiao
5eae32577e build: Move INCDIROPT to common place
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-18 15:02:55 -06:00