From 5604abcedc84fe8725dc8bb817ef9044057bfd10 Mon Sep 17 00:00:00 2001 From: Juan Carrano Date: Mon, 10 Sep 2018 15:21:09 +0200 Subject: [PATCH] drivers/tsl4531x: Add SAUL driver. --- drivers/include/tsl4531x_saul.h | 31 +++++++++++++++++++++++++++++++ drivers/tsl4531x/tsl4531x_saul.c | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 drivers/include/tsl4531x_saul.h diff --git a/drivers/include/tsl4531x_saul.h b/drivers/include/tsl4531x_saul.h new file mode 100644 index 0000000000..7783b1f469 --- /dev/null +++ b/drivers/include/tsl4531x_saul.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2018 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 + * directory for more details. + */ + +/** + * @ingroup drivers_tsl4531x + * @{ + * + * @file + * @brief SAUL interface for TSL4531 Luminosity sensor. + * + * @author Juan I Carrano + * + * @} + */ + +#ifndef TSL4531x_SAUL_H +#define TSL4531x_SAUL_H + +#include "saul.h" + +/** SAUL-compatible structure for illuminance sensor + */ +const saul_driver_t tsl4531x_saul_driver; + +#endif /* TSL4531x_SAUL_H */ + diff --git a/drivers/tsl4531x/tsl4531x_saul.c b/drivers/tsl4531x/tsl4531x_saul.c index f040beb25a..010c146111 100644 --- a/drivers/tsl4531x/tsl4531x_saul.c +++ b/drivers/tsl4531x/tsl4531x_saul.c @@ -34,7 +34,7 @@ static int _read(const void *dev, phydat_t *res) return nvals; } -const saul_driver_t tsl2561_illuminance_saul_driver = { +const saul_driver_t tsl4531x_saul_driver = { .read = _read, .write = saul_notsup, .type = SAUL_SENSE_LIGHT