periph.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef SAUL_PERIPH_H
20 #define SAUL_PERIPH_H
21 
22 #ifdef MODULE_SAUL_GPIO
23 #include "periph/gpio.h"
24 #endif /* MODULE_SAUL_GPIO */
25 
26 #ifdef MODULE_SAUL_ADC
27 #include "periph/adc.h"
28 #endif /* MODULE_SAUL_ADC */
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #ifdef MODULE_SAUL_GPIO
35 typedef enum {
36  SAUL_GPIO_INVERTED = (1 << 0),
37  SAUL_GPIO_INIT_CLEAR = (1 << 1),
38  SAUL_GPIO_INIT_SET = (1 << 2),
39 } saul_gpio_flags_t;
40 
44 typedef struct {
45  const char *name;
46  gpio_t pin;
47  gpio_mode_t mode;
48  saul_gpio_flags_t flags;
49 } saul_gpio_params_t;
50 #endif /* MODULE_SAUL_GPIO */
51 
52 #ifdef MODULE_SAUL_ADC
53 
56 typedef struct {
57  const char *name;
58  adc_t line;
59  adc_res_t res;
60 } saul_adc_params_t;
61 #endif /* MODULE_SAUL_ADC */
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* SAUL_PERIPH_H */
68 
Low-level GPIO peripheral driver interface definitions.
unsigned int adc_t
Define default ADC type identifier.
Definition: adc.h:59
Low-level ADC peripheral driver interface definitions.