Skip to content

Commit 39c6845

Browse files
liucheng5Otpvondoiats
authored andcommitted
drivers/sensors: add a new sensor type ENG
Add a new sensor type for ENG sensor. Signed-off-by: liucheng5 <[email protected]> Signed-off-by: likun17 <[email protected]>
1 parent 2a73434 commit 39c6845

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

drivers/sensors/sensor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ static const struct sensor_meta_s g_sensor_meta[] =
218218
{sizeof(struct sensor_pm25), "pm25"},
219219
{sizeof(struct sensor_pm10), "pm10"},
220220
{sizeof(struct sensor_uv), "uv"},
221+
{sizeof(struct sensor_eng), "eng"},
221222
};
222223

223224
static const struct file_operations g_sensor_fops =

include/nuttx/uorb.h

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,20 @@
511511

512512
#define SENSOR_TYPE_ULTRAVIOLET 57
513513

514+
/* ENG (Electroneurography)
515+
* A sensor of this type measures the electrical activity of peripheral
516+
* nerves. This neural electrical signal, generated by nerve impulses
517+
* traveling through axons and captured by electrodes, provides valuable
518+
* information about nervous system and muscle-nerve communication.
519+
*/
520+
521+
#define SENSOR_TYPE_ENG 58
522+
514523
/* The total number of sensor
515524
* please increase it if you added a new sensor type!
516525
*/
517526

518-
#define SENSOR_TYPE_COUNT 58
527+
#define SENSOR_TYPE_COUNT 59
519528

520529
/* The additional sensor open flags */
521530

@@ -902,6 +911,13 @@ struct sensor_cap /* Type: Capacitance */
902911
int32_t rawdata[4]; /* in SI units pF */
903912
};
904913

914+
struct sensor_eng /* Type: ENG */
915+
{
916+
uint64_t timestamp; /* Unit is microseconds */
917+
float voltage[4]; /* Voltage unit in mV */
918+
uint32_t stat; /* Status. bit3:0 - value 3:0 is valid or not */
919+
};
920+
905921
struct sensor_gnss /* Type: GNSS */
906922
{
907923
uint64_t timestamp; /* Time since system start, Units is microseconds */

0 commit comments

Comments
 (0)