Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6886 from smlng/driver/mag3110/rework
drivers: mag3110 rework
- Loading branch information
Showing
11 changed files
with
422 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright (C) 2017 HAW Hamburg | ||
* | ||
* 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 boards_pba-d-01-kw2x | ||
* @{ | ||
* | ||
* @file | ||
* @brief MAG3110 board specific configuration | ||
* | ||
* @author Sebastian Meiling <s@mlng.net> | ||
*/ | ||
|
||
#ifndef MAG3110_PARAMS_H | ||
#define MAG3110_PARAMS_H | ||
|
||
#include "board.h" | ||
#include "saul_reg.h" | ||
#include "mag3110.h" | ||
#include "mag3110_reg.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @brief MAG3310 configuration | ||
*/ | ||
static const mag3110_params_t mag3110_params[] = | ||
{ | ||
{ | ||
.i2c = MAG3110_I2C, | ||
.addr = MAG3110_ADDR, | ||
.type = MAG3110_ID, | ||
.dros = MAG3110_DROS_DEFAULT, | ||
.offset = { 0, 0, 0 } | ||
} | ||
}; | ||
|
||
/** | ||
* @brief Additional meta information to keep in the SAUL registry | ||
*/ | ||
static const saul_reg_info_t mag3110_saul_info[] = | ||
{ | ||
{ | ||
.name = "mag3110" | ||
} | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* MAG3110_PARAMS_H */ | ||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright (C) 2017 HAW Hamburg | ||
* | ||
* 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 drivers_mag3110 | ||
* @{ | ||
* | ||
* @file | ||
* @brief Default configuration for MAG3110 devices | ||
* | ||
* @author Sebastian Meiling <s@mlng.net> | ||
*/ | ||
|
||
#ifndef MAG3110_PARAMS_H | ||
#define MAG3110_PARAMS_H | ||
|
||
#include "board.h" | ||
#include "saul_reg.h" | ||
#include "mag3110.h" | ||
#include "mag3110_reg.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @name Default configuration parameters for the MAG3110 driver | ||
* @{ | ||
*/ | ||
#ifndef MAG3110_PARAM_I2C | ||
#define MAG3110_PARAM_I2C (I2C_DEV(0)) | ||
#endif | ||
#ifndef MAG3110_PARAM_ADDR | ||
#define MAG3110_PARAM_ADDR (MAG3110_I2C_ADDRESS) | ||
#endif | ||
#ifndef MAG3110_PARAM_OFFSET | ||
#define MAG3110_PARAM_OFFSET { 0, 0, 0 } | ||
#endif | ||
#ifndef MAG3110_PARAMS | ||
#define MAG3110_PARAMS { .i2c = MAG3110_PARAM_I2C, \ | ||
.addr = MAG3110_PARAM_ADDR, \ | ||
.type = MAG3110_ID, \ | ||
.dros = MAG3110_DROS_DEFAULT, \ | ||
.offset = MAG3110_PARAM_OFFSET } | ||
#endif | ||
/**@}*/ | ||
|
||
/** | ||
* @brief MAG3110 configuration | ||
*/ | ||
static const mag3110_params_t mag3110_params[] = | ||
{ | ||
MAG3110_PARAMS | ||
}; | ||
|
||
/** | ||
* @brief Additional meta information to keep in the SAUL registry | ||
*/ | ||
static const saul_reg_info_t mag3110_saul_info[] = | ||
{ | ||
{ | ||
.name = "mag3110" | ||
} | ||
}; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* MAG3110_PARAMS_H */ | ||
/** @} */ |
Oops, something went wrong.