Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Documentation/platforms/arm/nrf91/boards/thingy91/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ GPS No
Buttons Yes
LEDs No
COEX No
PMIC No
PMIC (ADP5360) No I2C 0x46
Battery monitoring No
Buzzer No
EEPROM (24CW160) No
Low power accelerometer (ADXL362) No
Hi G accelerometer (ADXL372) No
Air quality sensor (HBME680) No
Color sensor (BH1749NUC) No
EEPROM (24CW160) No I2C 0x50
Low power accelerometer (ADXL362) No SPI
Hi G accelerometer (ADXL372) No SPI
Air quality sensor (BME680) No I2C 0x76
Color sensor (BH1749NUC) No I2C 0x38
================================== ======= =============

Serial Console
Expand All @@ -39,7 +39,11 @@ Serial Console
Configurations
==============

TODO
thingy91_rtt
------------

Configuration with a console over RTT, enabling available peripherals
on the board (WIP).

Flash & Debug
=============
Expand Down
40 changes: 40 additions & 0 deletions boards/arm/nrf91/common/include/nrf91_adxl362.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/****************************************************************************
* boards/arm/nrf91/common/include/nrf91_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 __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_ADXL362_H
#define __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_ADXL362_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

/****************************************************************************
* Public Functions Prototypes
****************************************************************************/

/****************************************************************************
* Name: nrf91_adxl362_init
****************************************************************************/

int nrf91_adxl362_init(int devno, int busno);

#endif /* __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_ADXL362_H */
40 changes: 40 additions & 0 deletions boards/arm/nrf91/common/include/nrf91_adxl372.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/****************************************************************************
* boards/arm/nrf91/common/include/nrf91_adxl372.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 __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_ADXL372_H
#define __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_ADXL372_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

/****************************************************************************
* Public Functions Prototypes
****************************************************************************/

/****************************************************************************
* Name: nrf91_adxl372_init
****************************************************************************/

int nrf91_adxl372_init(int devno, int busno);

#endif /* __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_ADXL372_H */
40 changes: 40 additions & 0 deletions boards/arm/nrf91/common/include/nrf91_bh1749nuc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/****************************************************************************
* boards/arm/nrf91/common/include/nrf91_bh1749nuc.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 __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_BH1749NUC_H
#define __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_BH1749NUC_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

/****************************************************************************
* Public Functions Prototypes
****************************************************************************/

/****************************************************************************
* Name: nrf91_bh1749nuc_init
****************************************************************************/

int nrf91_bh1749nuc_init(int devno, int busno, uint8_t addr);

#endif /* __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_BH1749NUC_H */
40 changes: 40 additions & 0 deletions boards/arm/nrf91/common/include/nrf91_bme680.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/****************************************************************************
* boards/arm/nrf91/common/include/nrf91_bme680.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 __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_BME680_H
#define __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_BME680_H

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

/****************************************************************************
* Public Functions Prototypes
****************************************************************************/

/****************************************************************************
* Name: nrf91_bme680_init
****************************************************************************/

int nrf91_bme680_init(int devno, int busno);

#endif /* __BOARDS_ARM_NRF91_COMMON_INCLUDE_NRF91_BME680_H */
16 changes: 16 additions & 0 deletions boards/arm/nrf91/common/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ if(CONFIG_ARCH_BOARD_COMMON)
list(APPEND SRCS nrf91_reset.c)
endif()

if(CONFIG_SENSORS_BH1749NUC)
list(APPEND SRCS nrf91_bh1749nuc.c)
endif()

if(CONFIG_SENSORS_BME680)
list(APPEND SRCS nrf91_bme680.c)
endif()

if(CONFIG_SENSORS_ADXL372)
list(APPEND SRCS nrf91_adxl372.c)
endif()

if(CONFIG_SENSORS_ADXL362)
list(APPEND SRCS nrf91_adxl362.c)
endif()

target_sources(board PRIVATE ${SRCS})

endif()
16 changes: 16 additions & 0 deletions boards/arm/nrf91/common/src/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ ifeq ($(CONFIG_BOARDCTL_RESET),y)
CSRCS += nrf91_reset.c
endif

ifeq ($(CONFIG_SENSORS_BH1749NUC),y)
CSRCS += nrf91_bh1749nuc.c
endif

ifeq ($(CONFIG_SENSORS_BME680),y)
CSRCS += nrf91_bme680.c
endif

ifeq ($(CONFIG_SENSORS_ADXL372),y)
CSRCS += nrf91_adxl372.c
endif

ifeq ($(CONFIG_SENSORS_ADXL362),y)
CSRCS += nrf91_adxl362.c
endif

DEPPATH += --dep-path src
VPATH += :src
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src
Expand Down
68 changes: 68 additions & 0 deletions boards/arm/nrf91/common/src/nrf91_adxl362.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/****************************************************************************
* boards/arm/nrf91/common/src/nrf91_adxl362.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

#include <debug.h>
#include <errno.h>
#include <stdio.h>

#include <nuttx/spi/spi.h>
#include <nuttx/sensors/adxl362.h>

#include "nrf91_spi.h"

/****************************************************************************
* Public Functions
****************************************************************************/

/****************************************************************************
* Name: nrf91_adxl362_init
****************************************************************************/

int nrf91_adxl362_init(int devno, int busno)
{
struct spi_dev_s *spi;
int ret;

sninfo("Initializing ADXL362!\n");

/* Initialize SPI */

spi = nrf91_spibus_initialize(busno);
if (!spi)
{
return -ENODEV;
}

/* Then register the barometer sensor */

ret = adxl362_register(devno, spi);
if (ret < 0)
{
snerr("ERROR: Error registering ADXL362\n");
}

return ret;
}
68 changes: 68 additions & 0 deletions boards/arm/nrf91/common/src/nrf91_adxl372.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/****************************************************************************
* boards/arm/nrf91/common/src/nrf91_adxl372.c
*
* 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.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <nuttx/config.h>

#include <debug.h>
#include <errno.h>
#include <stdio.h>

#include <nuttx/spi/spi.h>
#include <nuttx/sensors/adxl372.h>

#include "nrf91_spi.h"

/****************************************************************************
* Public Functions
****************************************************************************/

/****************************************************************************
* Name: nrf91_adxl372_init
****************************************************************************/

int nrf91_adxl372_init(int devno, int busno)
{
struct spi_dev_s *spi;
int ret;

sninfo("Initializing ADXL372!\n");

/* Initialize SPI */

spi = nrf91_spibus_initialize(busno);
if (!spi)
{
return -ENODEV;
}

/* Then register the barometer sensor */

ret = adxl372_register_uorb(devno, spi);
if (ret < 0)
{
snerr("ERROR: Error registering ADXL372\n");
}

return ret;
}
Loading
Loading