Commit Graph

376 Commits

Author SHA1 Message Date
Petro Karashchenko
68902d8732 pid_t: unify usage of special task IDs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-22 21:22:32 +08:00
Alin Jerpelea
660da04204 drivers: sensors: exclude BSD components from build
Unless ALLOW_BSD_COMPONENTS is enabled support will not be built

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-24 22:48:47 +08:00
Xiang Xiao
d7fe0127b0 Replece clock_gettime(CLOCK_REALTIME) with clock_systime_timespec if suitable
it's better to call the kernrel api insteaad user space api in kernel

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-24 01:06:36 +08:00
Xiang Xiao
43f57240e0 Replece clock_gettime(CLOCK_MONOTONIC) with clock_systime_timespec
it's better to call the kernrel api insteaad user space api in kernel

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-24 01:06:36 +08:00
Alin Jerpelea
1dada85b52 drivers: Giorgio Gross : update licenses to Apache
Gregory Nutt has submitted the SGA
Giorgio Gross has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-23 12:06:54 +01:00
Xiang Xiao
f1ed349dd9 sched/clock: Remove CLOCK_MONOTONIC option from Kconfig
here is the reason:
1.clock_systime_timespec(core function) always exist regardless the setting
2.CLOCK_MONOTONIC is a foundamental clock type required by many places

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-23 01:21:26 +08:00
Xiang Xiao
1d1bdd85a3 Remove the double blank line from source files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-20 20:10:14 +01:00
Petro Karashchenko
41c95da594 register_driver: fix driver modes accross the code
State of problem:
 - Some drivers that do not support write operations (does not
   have write handler or ioctl do not perform any write actions)
   are registered with write permissions
 - Some drivers that do not support read operation (does not
   have read handler or ioctl do not perform any read actions)
   are registered with read permissions
 - Some drivers are registered with execute permissions

Solution:
 - Iterate code where register_driver() is used and change 'mode'
   parameter to reflect the actual read/write operations executed
   by a driver
 - Remove execute permissions from 'mode' parameter

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-02-16 16:15:29 +08:00
Xiang Xiao
4c167b0729 Correct the code alignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-01 21:22:21 -03:00
liucheng5
764fc7ef5e fix: sensor: ppg of dual- and quad-channel sensor types
Some PPG devices have 4 ADCs to output quad-channel PPG values while some of them only have 2 ADCs to output dual-channel PPG.
To deal the case above, the type PPGD(PPG of Dual-channel) takes the place of former type PPG, which also have 2-channel PPG outputs. Type PPGQ (PPG of Quad-channel) is new for 4-ADC-PPG. Both types have contained new data "gain" to indicate ADC gains of each PPG channel, for the reason that the gains may vary during automatical optical adjustments.

Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
2022-01-28 14:07:46 +08:00
chao.an
c50d39060b drivers/sensors: fix Kconfig warning
drivers/sensors/Kconfig:590:warning: defaults for choice values not supported

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-24 23:52:56 +08:00
Alan C. Assis
d8163803d1 sensors: Add support to MS5611 Barometer 2022-01-24 10:23:45 +08:00
Alan C. Assis
d664385784 Move MS58xx CRC-4 to include/ it will be used by other sensors 2022-01-24 10:23:45 +08:00
Petro Karashchenko
a743fed63d file_operations: get back C89 compatible initializer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-11 02:14:00 +08:00
Petro Karashchenko
c7d3a674fd drivers/sensors/as5048b: fix lower half init issue
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-03 11:38:44 +08:00
Petro Karashchenko
3ccb657dc2 nuttx: remove space befone newline in logs
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-27 21:01:19 -06:00
Diego Herranz
e6bd444fd3 drivers/sensors/isl29023.c: fix compilation error and warnings
- "op_mode" instead of "mode" (compilation error)
- CONFIG_ISL29023_I2C_FREQUENCY instead of CONFIG_LM75_I2C_FREQUENCY
(probably a leftover)
- Fix a couple of format warnings: now using PRIu32
- Also minor comment changes
2021-12-22 20:44:52 -06:00
Diego Herranz
34c7bec0dc drivers/sensors/hdc1008: fix formatting after decimal point
Modulo operation used to calculate digits after decimal point,
but if that result is <10, a leading zero wasn't added, giving a
wrong value.
2021-12-17 23:36:38 -06:00
Diego Herranz
1fe41381d5 drivers/sensors/hdc1008: include signal.h
Fix implicit declaration warning of nxsig_usleep.
2021-12-17 23:36:38 -06:00
Jiuzhu Dong
153254a496 sensor: reset interval,latency and circbuf when sensor is closed
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-12-17 23:36:07 -06:00
Petro Karashchenko
51a2db6ffc Kconfig: improve uniformity
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-14 07:32:48 -06:00
songnannan
550d2bff32 feature: sensor: add set calibration interface for sensor driver.
Add standard sensor interface for setting calibartiion value.

Signed-off-by: songnannan <songnannan@xiaomi.com>
2021-11-19 11:55:40 +01:00
Xiang Xiao
8e42f368ee sensors/wtgahrs2: Fix syslog format warning
sensors/wtgahrs2.c: In function 'wtgahrs2_gps_data':
Error: sensors/wtgahrs2.c:332:14: error: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
  332 |       sninfo("Time : %llu utc_time: %llu\n",
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  333 |              rtdata->gps.timestamp, rtdata->gps.time_utc);
      |              ~~~~~~~~~~~~~~~~~~~~~
      |                         |
      |                         uint64_t {aka long unsigned int}
sensors/wtgahrs2.c:332:25: note: format string is defined here
  332 |       sninfo("Time : %llu utc_time: %llu\n",
      |                      ~~~^
      |                         |
      |                         long long unsigned int
      |                      %lu
In file included from sensors/wtgahrs2.c:37:
Error: sensors/wtgahrs2.c:332:14: error: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]
  332 |       sninfo("Time : %llu utc_time: %llu\n",
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  333 |              rtdata->gps.timestamp, rtdata->gps.time_utc);
      |                                     ~~~~~~~~~~~~~~~~~~~~
      |                                                |
      |                                                uint64_t {aka long unsigned int}
sensors/wtgahrs2.c:332:40: note: format string is defined here
  332 |       sninfo("Time : %llu utc_time: %llu\n",
      |                                     ~~~^
      |                                        |
      |                                        long long unsigned int
      |                                     %lu

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-11-18 09:58:51 -03:00
buyuer
fa90a3dfd4 Optimized GPS sensor and add gps satellite sensor.
Signed-off-by: buyuer <dingddding@163.com>
2021-11-17 08:59:40 -06:00
songnannan
1799994f2c feature: sensor: Add sensor type ots.
Add ots sensor type for ots sensor.

Signed-off-by: songnannan <songnannan@xiaomi.com>
2021-11-16 14:51:57 -03:00
Alin Jerpelea
643d6153f2 drivers: Haltian Ltd: update licenses to Apache
Gregory Nutt has submitted the SGA
Haltian Ltd has submitted the SGA
Hexagon AB has submitted the SGA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-11-15 06:49:32 -06:00
raiden00pl
bf23abfbd5 drivers/qencoder: add an interface to configure the encoder index pin position 2021-11-07 03:52:48 -06:00
Jiuzhu Dong
f1f0bcc521 driver/sensor: support new sensor type:ECG,PPG,Imdepance
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-20 09:55:18 -05:00
丁欣童
26fedb2770 fakesensor: transform ddmm.mmmm to dd.mmmmmm.
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-20 09:55:18 -05:00
Jiuzhu Dong
5ee16ee684 driver/sensor: support sensor_ops: selftest
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-10-10 08:28:49 -03:00
Alin Jerpelea
978c03df43 drivers: Omni Hoverboards: update licenses to Apache
Gregory Nutt has submitted the SGA
Omni Hoverboards has submitted the SGA
Paul Alexander Patience  has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-28 04:37:38 -07:00
Alin Jerpelea
48f92e6f1d author: Bill Gatliff : update licenses to Apache
Gregory Nutt has submitted the SGA
Bill Gatliff has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-16 21:56:08 -05:00
Alin Jerpelea
7b61de3a25 author: Augusto Fraga Giachero : update licenses to Apache
Gregory Nutt has submitted the SGA

Augusto Fraga Giachero has submitted the ICLA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-15 15:57:55 +08:00
Alin Jerpelea
0f8c8f20dc drivers: author: Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA
as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-15 11:56:41 +08:00
Alin Jerpelea
df088c39f0 author: Anthony Merlino : update licenses to Apache
Verge Aero has submitted the SGA

Anthony Merlino has submitted the SGA

Gregory Nutt has submitted the SGA

Sebastien Lorquet has submitted the ICLA

as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-09-06 20:38:14 +08:00
daviepeng
60b6199120 fix nxstyle 2021-08-30 02:52:30 +08:00
daviepeng
c7cda607f4 Adds driver for msa301 sensore module 2021-08-30 02:52:30 +08:00
yangjiukui
19beb307dd sensor: fix the bug that lsm6dsl selftest is invalid in nuttx.
Modified the logic of the selftest according to the ST manual.

Signed-off-by: yangjiukui <yangjiukui@xiaomi.com>
Change-Id: Id55139abf173728de4647533b26f7ab5e9a6b1fe
2021-08-28 17:35:10 -03:00
raiden00pl
b30f5e146d drivers/sensors: add an upper half 3-phase Hall effect sensor driver 2021-08-19 08:19:38 -07:00
SPRESENSE
38bfadbeb9 drivers/sensors/bmp280.c: Correct bmp280 driver
There were some mistakes in porting to the common sensors, and they
caused the following problems.

- Hardfault by bmp280_set_interval
- Read data always zero
2021-08-18 23:22:21 -07:00
raiden00pl
dca8c65331 drivers/qencoder: add command to set the maximum encoder position 2021-08-10 11:19:05 -03:00
Jiuzhu Dong
7837a21e4e sensor: directly return -ENOTSUP without the set_interval or batch
implementation for lowerhalf driver.

Change-Id: I7b02e0331e5f8b89b39896049a9e24ce30116f8a
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-07-25 23:29:55 -07:00
buyuer
0d36b2d889 Fakesensor: support gps by read nema csv.
Currently, can only analyze GGA statement.

Signed-off-by: buyuer <dingddding@163.com>
2021-07-15 02:25:32 -07:00
Nathan Hartman
ee81b5a1d5 drivers/sensors/hyt271: Fix typos in comments and identifier
drivers/sensors/hyt271.c:

    * struct hyt271_dev_s: Identifier "lock_measure_cylce" was
      misspelled. Fix to "lock_measure_cycle" and update all instances
      in the file.

    * hyt271_mr(), hyt271_cmd(), hyt271_change_addr(),
      hyt271_measure_read(), hyt271_thread(): Update instances of the
      renamed "lock_measure_cycle" variable and fix various typos in
      comments.
2021-07-01 12:43:18 -05:00
buyuer
82f57bd3f9 driver/fakesensor: fix bugs.
1.fix crash casued by closing the handle during the reading.
2.fix set_interval fail sometime:When fakesensor was activated, csv file is not opened timely, so
the sensor->interval that set_interval() seted will be coverd by
interval form csv file.

Signed-off-by: buyuer <dingddding@163.com>
2021-07-01 01:34:45 -05:00
Xiang Xiao
2e54df0f35 Don't include assert.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-03 08:36:03 -07:00
Xiang Xiao
d7f96003cf Don't include debug.h from public header file
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-06-01 06:42:02 +09:00
Alin Jerpelea
13e4f9b6b2 drivers: update licenses to Apache
Gregory Nutt is the copyright holder for those files and he has submitted the
SGA as a result we can migrate the licenses to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-05-31 02:58:08 -05:00
Diego Herranz
a1c4ba379f drivers/sensors/hdc1008: add missing break
It was not possible to use the HDC1008_MEAS_T_AND_RH
operation mode since it was running the default case too.
2021-05-07 21:19:14 -03:00
Brennan Ashton
2c91805d8f boards/stm32f7: Add i2c and mpu60x0 support to nucleo-144 2021-05-04 10:17:44 -03:00