sensors: add support for adxl362 accelerometer

add support for Analog Devices ADXL362 accelerometer
This commit is contained in:
raiden00pl
2024-04-15 13:47:43 +02:00
committed by Alan Carvalho de Assis
parent 33d0276f3e
commit ebcf25b2f6
5 changed files with 727 additions and 0 deletions
+4
View File
@@ -56,6 +56,10 @@ if(CONFIG_SENSORS)
list(APPEND SRCS adxl345_base.c)
endif()
if(CONFIG_SENSORS_ADXL362)
list(APPEND SRCS adxl362_uorb.c)
endif()
if(CONFIG_SENSORS_DHTXX)
list(APPEND SRCS dhtxx.c)
endif()
+31
View File
@@ -892,6 +892,37 @@ config ADXL345_REGDEBUG
endif # SENSORS_ADXL345
config SENSORS_ADXL362
bool "Analog Devices ADXL362 Driver"
default n
---help---
Enables support for the ADXL362 driver
if SENSORS_ADXL362
config SENSORS_ADXL362_POLL
bool "Enables polling sensor data"
default n
---help---
Enables polling of sensor.
config SENSORS_ADXL362_POLL_INTERVAL
int "Polling interval in microseconds, default 1 sec"
depends on SENSORS_ADXL362_POLL
default 1000000
range 0 4294967295
---help---
The interval until a new sensor measurement will be triggered.
config SENSORS_ADXL362_THREAD_STACKSIZE
int "Worker thread stack size"
depends on SENSORS_ADXL362_POLL
default 1024
---help---
The stack size for the worker thread.
endif # SENSORS_ADXL362
config SENSORS_ADXL372
bool "Analog Devices ADXL372 Sensor support"
default n
+4
View File
@@ -285,6 +285,10 @@ ifeq ($(CONFIG_ADXL345_SPI),y)
CSRCS += adxl345_spi.c
endif
ifeq ($(CONFIG_SENSORS_ADXL362),y)
CSRCS += adxl362_uorb.c
endif
ifeq ($(CONFIG_SENSORS_ADXL372),y)
CSRCS += adxl372.c
endif
File diff suppressed because it is too large Load Diff
+65
View File
@@ -0,0 +1,65 @@
/****************************************************************************
* include/nuttx/sensors/adxl362.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_SENSORS_ADXL362_H
#define __INCLUDE_NUTTX_SENSORS_ADXL362_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/spi/spi.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Name: adxl362_register
*
* Description:
* Register the ADXL362 character device as uorb
*
* Input Parameters:
* devno - device instance
* spi - An instance of the SPI interface to use to communicate with
* ADXL362
*
* Returned Value:
* Zero (OK) on success; a negated errno value on failure.
*
****************************************************************************/
int adxl362_register(int devno, FAR struct spi_dev_s *spi);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDE_NUTTX_SENSORS_ADXL362_H */