mirror of
https://github.com/apache/nuttx.git
synced 2026-09-12 05:30:20 +00:00
drivers/sensors: add a new sensor type ENG
Add a new sensor type for ENG sensor. Signed-off-by: liucheng5 <liucheng5@xiaomi.com> Signed-off-by: likun17 <likun17@xiaomi.com>
This commit is contained in:
parent
4514a11237
commit
bbda415412
2 changed files with 18 additions and 2 deletions
|
|
@ -218,6 +218,7 @@ static const struct sensor_meta_s g_sensor_meta[] =
|
|||
{sizeof(struct sensor_pm25), "pm25"},
|
||||
{sizeof(struct sensor_pm10), "pm10"},
|
||||
{sizeof(struct sensor_uv), "uv"},
|
||||
{sizeof(struct sensor_eng), "eng"},
|
||||
};
|
||||
|
||||
static const struct file_operations g_sensor_fops =
|
||||
|
|
|
|||
|
|
@ -475,7 +475,6 @@
|
|||
/* GNSS Geofence */
|
||||
|
||||
#define SENSOR_TYPE_GNSS_GEOFENCE 52
|
||||
|
||||
/* Velocity Sensor
|
||||
* A sensor of this type measures the velocity as it is moving.
|
||||
* The default unit velocity is meter by seconds m/s (SI).
|
||||
|
|
@ -511,11 +510,20 @@
|
|||
|
||||
#define SENSOR_TYPE_ULTRAVIOLET 57
|
||||
|
||||
/* ENG (Electroneurography)
|
||||
* A sensor of this type measures the electrical activity of peripheral
|
||||
* nerves. This neural electrical signal, generated by nerve impulses
|
||||
* traveling through axons and captured by electrodes, provides valuable
|
||||
* information about nervous system and muscle-nerve communication.
|
||||
*/
|
||||
|
||||
#define SENSOR_TYPE_ENG 58
|
||||
|
||||
/* The total number of sensor
|
||||
* please increase it if you added a new sensor type!
|
||||
*/
|
||||
|
||||
#define SENSOR_TYPE_COUNT 58
|
||||
#define SENSOR_TYPE_COUNT 59
|
||||
|
||||
/* The additional sensor open flags */
|
||||
|
||||
|
|
@ -902,6 +910,13 @@ struct sensor_cap /* Type: Capacitance */
|
|||
int32_t rawdata[4]; /* in SI units pF */
|
||||
};
|
||||
|
||||
struct sensor_eng /* Type: ENG */
|
||||
{
|
||||
uint64_t timestamp; /* Unit is microseconds */
|
||||
float voltage[4]; /* Voltage unit in mV */
|
||||
uint32_t stat; /* Status. bit3:0 - value 3:0 is valid or not */
|
||||
};
|
||||
|
||||
struct sensor_gnss /* Type: GNSS */
|
||||
{
|
||||
uint64_t timestamp; /* Time since system start, Units is microseconds */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue