sys/auto_init: add support for periph_temperature
This commit is contained in:
parent
a142286d8d
commit
891580aba7
@ -602,6 +602,10 @@ ifneq (,$(filter saul,$(USEMODULE)))
|
|||||||
USEMODULE += phydat
|
USEMODULE += phydat
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter saul_nrf_temperature,$(USEMODULE)))
|
||||||
|
FEATURES_REQUIRED += periph_temperature
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter phydat,$(USEMODULE)))
|
ifneq (,$(filter phydat,$(USEMODULE)))
|
||||||
USEMODULE += fmt
|
USEMODULE += fmt
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -62,6 +62,7 @@ PSEUDOMODULES += riotboot_%
|
|||||||
PSEUDOMODULES += saul_adc
|
PSEUDOMODULES += saul_adc
|
||||||
PSEUDOMODULES += saul_default
|
PSEUDOMODULES += saul_default
|
||||||
PSEUDOMODULES += saul_gpio
|
PSEUDOMODULES += saul_gpio
|
||||||
|
PSEUDOMODULES += saul_nrf_temperature
|
||||||
PSEUDOMODULES += schedstatistics
|
PSEUDOMODULES += schedstatistics
|
||||||
PSEUDOMODULES += sock
|
PSEUDOMODULES += sock
|
||||||
PSEUDOMODULES += sock_ip
|
PSEUDOMODULES += sock_ip
|
||||||
|
|||||||
@ -326,6 +326,10 @@ void auto_init(void)
|
|||||||
extern void auto_init_gpio(void);
|
extern void auto_init_gpio(void);
|
||||||
auto_init_gpio();
|
auto_init_gpio();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MODULE_SAUL_NRF_TEMPERATURE
|
||||||
|
extern void auto_init_nrf_temperature(void);
|
||||||
|
auto_init_nrf_temperature();
|
||||||
|
#endif
|
||||||
#ifdef MODULE_AD7746
|
#ifdef MODULE_AD7746
|
||||||
extern void auto_init_ad7746(void);
|
extern void auto_init_ad7746(void);
|
||||||
auto_init_ad7746();
|
auto_init_ad7746();
|
||||||
|
|||||||
55
sys/auto_init/saul/auto_init_nrf_temperature.c
Normal file
55
sys/auto_init/saul/auto_init_nrf_temperature.c
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2019 Inria
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
* directory for more details.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup sys_auto_init_saul
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief Auto initialization of internal temperature sensor directly mapped to SAUL reg
|
||||||
|
*
|
||||||
|
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef MODULE_SAUL_NRF_TEMPERATURE
|
||||||
|
|
||||||
|
#include "cpu.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include "saul_reg.h"
|
||||||
|
#include "saul/periph.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Memory for the registry entries
|
||||||
|
*/
|
||||||
|
static saul_reg_t saul_reg_entry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Reference the driver struct
|
||||||
|
*/
|
||||||
|
extern saul_driver_t nrf_temperature_saul_driver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Reference the information for saul registry
|
||||||
|
*/
|
||||||
|
extern saul_reg_info_t nrf_temperature_saul_info;
|
||||||
|
|
||||||
|
void auto_init_nrf_temperature(void)
|
||||||
|
{
|
||||||
|
saul_reg_entry.dev = NULL;
|
||||||
|
saul_reg_entry.name = nrf_temperature_saul_info.name;
|
||||||
|
saul_reg_entry.driver = &nrf_temperature_saul_driver;
|
||||||
|
/* add to registry */
|
||||||
|
saul_reg_add(&(saul_reg_entry));
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
typedef int dont_be_pedantic;
|
||||||
|
#endif /* MODULE_SAUL_NRF_TEMPERATURE */
|
||||||
Loading…
x
Reference in New Issue
Block a user