commit df051abd9e449d21bbb77f99b52c17f501cec4af
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Wed Nov 13 15:59:17 2019 +0100

    switch driver (v1) added

diff --git a/drivers/switch/v1/alld_switch.c b/drivers/switch/v1/alld_switch.c
new file mode 100644
index 0000000..0e6b147
--- /dev/null
+++ b/drivers/switch/v1/alld_switch.c
@@ -0,0 +1,71 @@
+/*
+AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2019  Thomas Schöpping et al.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file    alld_switch.c
+ * @brief   Switch function implementations.
+ *
+ * @addtogroup lld_switch
+ * @{
+ */
+
+#include <alld_switch.h>
+
+/******************************************************************************/
+/* LOCAL DEFINITIONS                                                          */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXPORTED VARIABLES                                                         */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL TYPES                                                                */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL VARIABLES                                                            */
+/******************************************************************************/
+
+/******************************************************************************/
+/* LOCAL FUNCTIONS                                                            */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXPORTED FUNCTIONS                                                         */
+/******************************************************************************/
+
+/**
+ * @brief Get the current status of the switch.
+ * @param[in]   switchd The switch driver object.
+ * @param[out]  state   The state object to fill.
+ * @return              An indicator whether the call was successful.
+ */
+apalExitStatus_t switch_lld_get(const SwitchDriver* const switchd, switch_lld_state_t* const state)
+{
+  apalDbgAssert(switchd != NULL);
+  apalDbgAssert(state != NULL);
+
+  apalControlGpioState_t gpio_state;
+  apalExitStatus_t status = apalControlGpioGet(switchd->gpio, &gpio_state);
+  *state = gpio_state == APAL_GPIO_ON ? SWITCH_LLD_STATE_ON : SWITCH_LLD_STATE_OFF;
+  return status;
+}
+
+/** @} */
+
diff --git a/drivers/switch/v1/alld_switch.h b/drivers/switch/v1/alld_switch.h
new file mode 100644
index 0000000..eb2398d
--- /dev/null
+++ b/drivers/switch/v1/alld_switch.h
@@ -0,0 +1,86 @@
+/*
+AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous Mini Robot (AMiRo) platform.
+Copyright (C) 2016..2019  Thomas Schöpping et al.
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file    alld_switch.h
+ * @brief   Switch macros and structures.
+ *
+ * @addtogroup lld_switch
+ * @{
+ */
+
+#ifndef AMIROLLD_SWITCH_H
+#define AMIROLLD_SWITCH_H
+
+#include <amiro-lld.h>
+
+/******************************************************************************/
+/* CONSTANTS                                                                  */
+/******************************************************************************/
+
+/******************************************************************************/
+/* SETTINGS                                                                   */
+/******************************************************************************/
+
+/******************************************************************************/
+/* CHECKS                                                                     */
+/******************************************************************************/
+
+/******************************************************************************/
+/* DATA STRUCTURES AND TYPES                                                  */
+/******************************************************************************/
+
+/**
+ * @brief Switch driver data structure.
+ */
+typedef struct {
+  const apalControlGpio_t* gpio;  /**< @brief The identifier of the GPIO.  */
+} SwitchDriver;
+
+/**
+ * @brief The state of the switch.
+ */
+typedef enum {
+  SWITCH_LLD_STATE_OFF = 0x00,   /**< 'released' state of the switch */
+  SWITCH_LLD_STATE_ON  = 0x01,   /**< 'pressed' state of the switch */
+} switch_lld_state_t;
+
+/******************************************************************************/
+/* MACROS                                                                     */
+/******************************************************************************/
+
+/******************************************************************************/
+/* EXTERN DECLARATIONS                                                        */
+/******************************************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+  apalExitStatus_t switch_lld_get(const SwitchDriver* const switchp, switch_lld_state_t* const state);
+#ifdef __cplusplus
+}
+#endif
+
+/******************************************************************************/
+/* INLINE FUNCTIONS                                                           */
+/******************************************************************************/
+
+#endif /* AMIROLLD_SWITCH_H */
+
+/** @} */
+
diff --git a/drivers/switch/v1/alld_switch.mk b/drivers/switch/v1/alld_switch.mk
new file mode 100644
index 0000000..b96aeb5
--- /dev/null
+++ b/drivers/switch/v1/alld_switch.mk
@@ -0,0 +1,33 @@
+################################################################################
+# AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous  #
+# Mini Robot (AMiRo) platform.                                                 #
+# Copyright (C) 2016..2019  Thomas Schöpping et al.                            #
+#                                                                              #
+# This program is free software: you can redistribute it and/or modify         #
+# it under the terms of the GNU General Public License as published by         #
+# the Free Software Foundation, either version 3 of the License, or            #
+# (at your option) any later version.                                          #
+#                                                                              #
+# This program is distributed in the hope that it will be useful,              #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
+# GNU General Public License for more details.                                 #
+#                                                                              #
+# You should have received a copy of the GNU General Public License            #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.        #
+#                                                                              #
+# This research/work was supported by the Cluster of Excellence Cognitive      #
+# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is   #
+# funded by the German Research Foundation (DFG).                              #
+################################################################################
+
+
+
+# path to this directory
+AMIROLLD_switch_V1_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
+
+# include paths
+AMIROLLD_INC += $(AMIROLLD_switch_V1_DIR)
+
+# C source files
+AMIROLLD_CSRC += $(AMIROLLD_switch_V1_DIR)alld_switch.c
