amiro-lld / include / alld_led.h @ e2db16a4
History | View | Annotate | Download (1.723 KB)
| 1 | d6728c5b | Thomas Schöpping | /*
|
|---|---|---|---|
| 2 | AMiRo-LLD is a compilation of low-level hardware drivers for the Autonomous Mini Robot (AMiRo) platform.
|
||
| 3 | Copyright (C) 2016..2018 Thomas Schöpping et al.
|
||
| 4 | |||
| 5 | This program is free software: you can redistribute it and/or modify
|
||
| 6 | it under the terms of the GNU General Public License as published by
|
||
| 7 | the Free Software Foundation, either version 3 of the License, or
|
||
| 8 | (at your option) any later version.
|
||
| 9 | |||
| 10 | This program is distributed in the hope that it will be useful,
|
||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
| 13 | GNU General Public License for more details.
|
||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License
|
||
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
| 17 | */
|
||
| 18 | |||
| 19 | #ifndef _AMIROLLD_LED_H_
|
||
| 20 | #define _AMIROLLD_LED_H_
|
||
| 21 | |||
| 22 | #include <amiro-lld.h> |
||
| 23 | |||
| 24 | #if defined(AMIROLLD_CFG_USE_LED) || defined(__DOXYGEN__)
|
||
| 25 | |||
| 26 | /**
|
||
| 27 | * @brief Active state of LED GPIO (low active).
|
||
| 28 | */
|
||
| 29 | #define LED_LLD_GPIO_ACTIVE_STATE APAL_GPIO_ACTIVE_LOW
|
||
| 30 | |||
| 31 | /**
|
||
| 32 | * @brief LED driver data structure.
|
||
| 33 | */
|
||
| 34 | typedef struct { |
||
| 35 | apalControlGpio_t gpio; /**< @brief The identifier of the GPIO. */
|
||
| 36 | } LEDDriver; |
||
| 37 | |||
| 38 | /**
|
||
| 39 | * @brief The state of the LED.
|
||
| 40 | */
|
||
| 41 | typedef enum { |
||
| 42 | LED_LLD_STATE_OFF = 0x00, /**< 'on' state of the LED */ |
||
| 43 | LED_LLD_STATE_ON = 0x01, /**< 'off' state of the LED */ |
||
| 44 | } led_lld_state_t; |
||
| 45 | |||
| 46 | #ifdef __cplusplus
|
||
| 47 | extern "C" { |
||
| 48 | #endif
|
||
| 49 | apalExitStatus_t led_lld_set(const LEDDriver* const led, const led_lld_state_t state); |
||
| 50 | apalExitStatus_t led_lld_get(const LEDDriver* const led, led_lld_state_t* const state); |
||
| 51 | apalExitStatus_t led_lld_toggle(const LEDDriver* const led); |
||
| 52 | #ifdef __cplusplus
|
||
| 53 | } |
||
| 54 | #endif
|
||
| 55 | |||
| 56 | #endif /* defined(AMIROLLD_CFG_USE_LED) */ |
||
| 57 | |||
| 58 | #endif /* _AMIROLLD_LED_H_ */ |