gp2y10xx_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Locha Inc
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 
9 #pragma once
10 
22 #include "board.h"
23 #include "saul_reg.h"
24 #include "gp2y10xx.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
39 #ifndef GP2Y10XX_PARAM_AOUT
40 #define GP2Y10XX_PARAM_AOUT (ADC_LINE(0))
41 #endif
42 
46 #ifndef GP2Y10XX_PARAM_ADC_RES
47 #define GP2Y10XX_PARAM_ADC_RES (ADC_RES_10BIT)
48 #endif
49 
53 #ifndef GP2Y10XX_PARAM_VREF
54 #define GP2Y10XX_PARAM_VREF (3300)
55 #endif
56 
60 #ifndef GP2Y10XX_PARAM_ILED_PIN
61 #define GP2Y10XX_PARAM_ILED_PIN (GPIO_UNDEF)
62 #endif
63 
67 #ifndef GP2Y10XX_PARAM_ILED_LEVEL
68 #define GP2Y10XX_PARAM_ILED_LEVEL (GP2Y10XX_ILED_LEVEL_HIGH)
69 #endif
70 
74 #ifndef GP2Y10XX_PARAMS
75 #define GP2Y10XX_PARAMS { .aout = GP2Y10XX_PARAM_AOUT, \
76  .adc_res = GP2Y10XX_PARAM_ADC_RES, \
77  .vref = GP2Y10XX_PARAM_VREF, \
78  .iled_pin = GP2Y10XX_PARAM_ILED_PIN, \
79  .iled_level = GP2Y10XX_PARAM_ILED_LEVEL, \
80  }
81 #endif
87 #ifndef GP2Y10XX_SAUL_INFO
88 #define GP2Y10XX_SAUL_INFO { .name = "gp2y1010" }
89 #endif
90 
95 {
97 };
98 
103 {
105 };
106 
107 #ifdef __cplusplus
108 }
109 #endif
GP2Y10xx device driver.
static const gp2y10xx_params_t gp2y10xx_params[]
GP2Y1010 configuration.
static const saul_reg_info_t gp2y10xx_saul_info[]
Additional meta information to keep in the SAUL registry.
#define GP2Y10XX_SAUL_INFO
GP2Y10xx driver SAUL registry information structures.
#define GP2Y10XX_PARAMS
GP2Y10xx driver configuration parameters.
SAUL registry interface definition.
GP2Y10xx device parameters.
Definition: gp2y10xx.h:83
Additional data to collect for each entry.
Definition: saul_reg.h:48