Commit Graph

153 Commits

Author SHA1 Message Date
Gregory Nutt
5328e3bafb configs/: CONFIG_QENCODER was renamed to CONFIG_SENSORS_QENCODER: update occurrences in several Kconfig files 2017-11-25 18:46:43 -06:00
Jussi Kivilinna
0ea4d2a11d sensors/lis2dh: fix use of obsolete dbg macro 2017-10-27 06:13:14 -06:00
Jussi Kivilinna
e557c3e8d5 drivers/sensors/lis2dh: fixes for self-test 2017-10-26 09:25:20 -06:00
Alan Carvalho de Assis
0be36a6ac1 drivers/sensors/apds9960.c: Use work_queue to read/process data when receive an IRQ 2017-10-20 08:54:44 -06:00
Jussi Kivilinna
fe9be72bec drivers/sensors/hts221: power-on sensor for loading calibration data 2017-10-20 08:33:44 -06:00
Alan Carvalho de Assis
3268a6ac5f drivers/sensor: Add driver for the APDS-9960 gesture sensor 2017-10-20 06:37:38 -06:00
Sebastien Lorquet
d16d4d5568 The INA219 is a combined voltage and current sensor that can measure up to 26 volts and a current that depends on an external shunt resistor. Connection happens via i2c/smbus and the chip features a power supply rail that is independent from the measured voltage, so it can measure low voltages.
This commit adds a driver for this chip.  Right now it measures bus voltage and current, and does not use the internal calibrated current reading, nor the available power measurement.
2017-10-10 17:03:56 -06:00
Gregory Nutt
4810499d3a Squashed commit of the following:
Replace all calls to sigqueue() in the OS proper with calls to nxsig_queue() to avoid accessing the errno variable.

    sched/signal:  Add nxsig_queue() which is functionally equivalent to sigqueue() except that it does not modify the errno variable.
2017-10-07 10:57:09 -06:00
Gregory Nutt
936df1bcb5 Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
2017-10-06 10:15:01 -06:00
Gregory Nutt
29b5b3667f sched/semaphore: sem_timedwait() is a cancellation point and, hence, cannot be called from within the OS. Created nxsem_timedwait() that is equivalent but does not modify the errno and does not cause cancellation. All calls to sem_timedwait() change to calls to nxsem_timedwait() in the OS. 2017-10-05 07:24:54 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Gregory Nutt
8394f9b60f Squashed commit of the following:
configs/z80sim and xtrs:  Serial driver lower halfs ioctl methods should return a negated errno value, not set the errno variable.

    drivers/wireless:  CC1101 driver not permitted to set errno.

    drivers/sensors:  LIS331DL driver not permitted to set errno.

    drivers/lcd: ILI9341 initialize method not permitted to set errno,

    drivers/serial: 16550 UART driver IOCTL method must not set errno; it must return a negated errno value.
2017-09-30 12:59:33 -06:00
Gregory Nutt
0f04816b37 Trivial changes from review of last PR. 2017-09-14 14:55:50 -06:00
Florian Olbrich
6f57d1d472 lis3dsh.c edited to obey the nuttx coding standard. 2017-09-14 20:29:41 +00:00
Florian Olbrich
b1e625eacb Added initialization code and Kconfig entries to set up the LIS3DSH accelerometer
driver on STM32F4Discovery rev. C boards and attach the associated interrupt callback.

Added the argument parameter (FAR void *arg) to the interrupt handler provided by the LIS3DSH
driver to fit the definition for ISRs in xcpt_t.

Changed the check for working queue availability in lis3dsh interrupt handler to use work_available()
and not crash in case of an overrun.
2017-09-14 20:03:28 +02:00
Gregory Nutt
5129aeefd5 drivers/sensors: Fix remaining naming of configurations to be compliant for two more drivers. 2017-08-24 10:48:20 -06:00
Gregory Nutt
dc8f3778a9 drivers/sensors: Fix more naming of configurations to be compliant for two more drivers. Still a few more to go. 2017-08-24 10:26:53 -06:00
Gregory Nutt
1f023fa31a drivers/sensors: Fix more naming of configurations to be compliant for two more drivers. Still a few more to go. 2017-08-24 10:10:00 -06:00
Gregory Nutt
269107afc8 drivers/sensors: Make naming configuration compliant for two more drivers. Still several to go. 2017-08-24 09:54:23 -06:00
Gregory Nutt
7f4af7b690 drivrs/sensors: Make a few other configuration settings consistent with the (undocumented) standard. 2017-08-24 09:45:46 -06:00
Gregory Nutt
5dd25bbfde Missed two naming changes in last commit 2017-08-24 09:32:24 -06:00
Gregory Nutt
9e386e3b31 drivrs/sensors/hts221: Fix inconsistent configuration variable naming; Try to bring closer to an as-of-yet undocumented naming convention. 2017-08-24 09:22:36 -06:00
Alan Carvalho de Assis
1048a3b871 drivers/sensors/hc_sr04.c: Replace busy wait with semaphone. Using this solution we don't need 60ms delay. 2017-08-18 09:44:38 -06:00
Alan Carvalho de Assis
50e2e08742 drivers/sensors: Add support to HC-SR04 distance sensor 2017-08-17 18:52:54 -06:00
Juha Niskanen
0113b0db95 drivers: handle I2C_TRANSFER return value consistently. Some I2C peripherals transfers return zero on success, others number of completed transfers. Make drivers robust against this. 2017-08-04 07:31:36 -06:00
Gregory Nutt
ee4b69f0d3 Review of last PR. Fixes many coding standard problems. 2017-07-28 07:16:35 -06:00
Giorgio Groß
b55ec110f2 Add driver for LTC4151 current and voltage monitor 2017-07-28 13:05:56 +02:00
Juha Niskanen
32610b53f4 drivers/{sensors,usbmisc}: Fix uninitialized I2C frequency 2017-06-01 06:19:54 -06:00
Juha Niskanen
34e68a569b drivers: rename newly introduced up_i2creset to I2C_RESET 2017-05-15 07:22:17 -06:00
Juha Niskanen
b9a769d65d drivers: fix some bad NULL checks 2017-05-15 07:20:32 -06:00
Floxx
c2096f17d6 Moved LIS3DSH from the I2C-dependent block to the SPI-block to make Make.defs consistent with the driver (SPI only) and drivers/sensors/Kconfig. 2017-05-10 20:18:48 +02:00
Gregory Nutt
e9a5477506 Add an instance argument to the SPIDEV definitions. 2017-04-29 12:26:52 -06:00
Juha Niskanen
d64d4e02b4 sensors: lis2dh: fix hardfault when reading from unconfigured sensor 2017-04-04 07:38:49 -06:00
Juha Niskanen
dfe6a672c1 drivers/sensors: Add driver for ST LIS2DH accelerometer. From Timo Voutilainen <time.voutilainen@haltian.com> et al. 2017-04-03 07:28:22 -06:00
Juha Niskanen
9d13a2463f drivers/usbmisc: Add driver for Fairchild FUSB301 USB type-C controller.
From Harri Luhtala <harri.luhtala@haltian.com>. Tested with earlier
version of NuttX; with current version checked that it compiles.
2017-03-31 06:35:36 -06:00
Juha Niskanen
b5b148fef8 drivers/sensors: Add driver for ST LPS25H pressure sensor 2017-03-31 05:53:43 -06:00
Gregory Nutt
916bd8a48f HTS221 driver: Modify to use new interrupt parameter passing hooks. 2017-03-31 05:31:35 -06:00
Juha Niskanen
9e2b3da3e8 drivers/sensors: Add driver for ST HTS221 humidity sensor 2017-03-30 12:17:23 -06:00
Jussi Kivilinna
dffb8a67e3 Add entropy pool and strong random number generator
Entropy pool gathers environmental noise from device drivers, user-space, etc., and returns good random numbers, suitable for cryptographic use. Based on entropy pool design from *BSDs and uses BLAKE2Xs algorithm for CSPRNG output.

Patch also adds /dev/urandom support for using entropy pool RNG and new 'getrandom' system call for getting randomness without file-descriptor usage (thus avoiding file-descriptor exhaustion attacks). The 'getrandom' interface is similar as 'getentropy' and 'getrandom' available on OpenBSD and Linux respectively.
2017-03-30 07:38:37 -06:00
ahb
e1da80af5b fix as5048b by adding missing frequency parameter 2017-03-09 12:01:01 +01:00
Maciej Wójcik
1e6ab4763c typos 2017-03-05 13:04:07 +00:00
Gregory Nutt
6e32d74b33 Cosmetic changes from review of the last PR 2017-02-19 11:49:42 -06:00
raiden00
82cb38c824 drivers/sensors: Add driver for the ST L3GD20 3 axis gyro 2017-02-19 17:43:44 +01:00
Gregory Nutt
e29b50e00a Fix recurring naming problem: KXTJ9 vs KXJT9. 2017-02-18 08:08:41 -06:00
Gregory Nutt
ba2b345990 Remove a few remaining use of the obsolteted 'Compilation Switches' program section 2017-01-22 08:57:18 -06:00
Alan Carvalho de Assis
a6b7730f8c Add Vishay VEML6070 driver and support for STM32F103-Minimum board 2016-11-13 11:44:28 -06:00
Gregory Nutt
6a0917ae7f Eliminate warnings 2016-10-06 07:44:17 -06:00
Alan Carvalho de Assis
61980caee5 drivers/sensors: Adds support for the Sensixs XEN1210 3D-boar. This sensor is used on NANOSATC-BR2 a Brazillian CUBESAT project. 2016-09-16 12:45:53 -06:00