Browse Source

drivers/jc42: move SAUL config to params.h

pr/spi.typo
Hauke Petersen 6 years ago
parent
commit
13942225eb
  1. 18
      drivers/jc42/include/jc42_params.h
  2. 11
      sys/auto_init/saul/auto_init_jc42.c

18
drivers/jc42/include/jc42_params.h

@ -1,5 +1,6 @@
/*
* Copyright (C) 2017 Koen Zandberg <koen@bergzand.net>
* 2017 Freie Universität Berlin
*
* 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
@ -14,6 +15,7 @@
* @brief Default configuration for jc42
*
* @author Koen Zandberg <koen@bergzand.net>
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef JC42_PARAMS_H
@ -31,7 +33,7 @@ extern "C" {
* @{
*/
#ifndef JC42_PARAM_I2C_DEV
#define JC42_PARAM_I2C_DEV (0)
#define JC42_PARAM_I2C_DEV I2C_DEV(0)
#endif
#ifndef JC42_PARAM_ADDR
#define JC42_PARAM_ADDR (0x18)
@ -40,9 +42,9 @@ extern "C" {
#define JC42_PARAM_SPEED I2C_SPEED_FAST
#endif
#define JC42_PARAMS_DEFAULT {.i2c = JC42_PARAM_I2C_DEV, \
.speed = JC42_PARAM_SPEED, \
.addr = JC42_PARAM_ADDR }
#define JC42_PARAMS_DEFAULT { .i2c = JC42_PARAM_I2C_DEV, \
.speed = JC42_PARAM_SPEED, \
.addr = JC42_PARAM_ADDR }
/**@}*/
/**
@ -57,6 +59,14 @@ static const jc42_params_t jc42_params[] =
#endif
};
/**
* @brief Configure SAUL registry entries
*/
static const saul_reg_info_t jc42_saul_reg_info[] =
{
{ .name= "jc42" }
};
#ifdef __cplusplus
}
#endif

11
sys/auto_init/saul/auto_init_jc42.c

@ -48,17 +48,6 @@ static saul_reg_t saul_entries[JC42_NUMOF];
extern const saul_driver_t jc42_temperature_saul_driver;
/** @} */
/**
* @brief Allocate and configure entries to the SAUL registry
*/
saul_reg_t jc42_saul_reg_info[]=
{
{
.name= "jc42",
.driver = &jc42_temperature_saul_driver
}
};
void auto_init_jc42(void)
{
for (unsigned i = 0; i < JC42_NUMOF; i++) {

Loading…
Cancel
Save