Skip to content
Snippets Groups Projects
Commit 36526f8a authored by Sebastian Meiling's avatar Sebastian Meiling
Browse files

driver, mag3110: add saul

parent fddecfca
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) ...@@ -3,6 +3,7 @@ ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
endif endif
ifneq (,$(filter saul_default,$(USEMODULE))) ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += mag3110
USEMODULE += mma8x5x USEMODULE += mma8x5x
USEMODULE += hdc1000 USEMODULE += hdc1000
USEMODULE += tcs37727 USEMODULE += tcs37727
......
...@@ -42,6 +42,16 @@ static const mag3110_params_t mag3110_params[] = ...@@ -42,6 +42,16 @@ static const mag3110_params_t 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 #ifdef __cplusplus
} }
#endif #endif
......
...@@ -58,6 +58,16 @@ static const mag3110_params_t mag3110_params[] = ...@@ -58,6 +58,16 @@ static const mag3110_params_t mag3110_params[] =
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 #ifdef __cplusplus
} }
#endif #endif
......
/*
* 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 driver_mag3110
* @{
*
* @file
* @brief MAG3110 adaption to the RIOT actuator/sensor interface
*
* @author Sebastian Meiling <s@mlng.net>
*
* @}
*/
#include <string.h>
#include <stdio.h>
#include "saul.h"
#include "mag3110.h"
static int read_acc(void *dev, phydat_t *res)
{
mag3110_read((mag3110_t *)dev, (mag3110_data_t *)res);
res->unit = UNIT_GS;
res->scale = 2;
return 3;
}
const saul_driver_t mag3110_saul_driver = {
.read = read_acc,
.write = saul_notsup,
.type = SAUL_SENSE_MAG,
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment