Loading...
Searching...
No Matches
ads101x_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 OTA keys S.A.
3 * 2018 Acutam Automation, LLC
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
21#ifndef ADS101X_PARAMS_H
22#define ADS101X_PARAMS_H
23
24#include "board.h"
25#include "saul_reg.h"
26#include "ads101x.h"
27#include "ads101x_regs.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
37#ifndef ADS101X_PARAM_I2C
38#define ADS101X_PARAM_I2C (I2C_DEV(0))
39#endif
40#ifndef ADS101X_PARAM_ADDR
41#define ADS101X_PARAM_ADDR (CONFIG_ADS101X_I2C_ADDRESS)
42#endif
43#ifndef ADS101X_PARAM_MUX_GAIN
44#define ADS101X_PARAM_MUX_GAIN (ADS101X_AIN0_DIFFM_AIN1 \
45 | ADS101X_PGA_FSR_2V048)
46#endif
47#ifndef ADS101X_PARAM_ALERT_PIN
48#define ADS101X_PARAM_ALERT_PIN (GPIO_UNDEF)
49#endif
50#ifndef ADS101X_PARAM_LOW_LIMIT
51#define ADS101X_PARAM_LOW_LIMIT (10000U)
52#endif
53#ifndef ADS101X_PARAM_HIGH_LIMIT
54#define ADS101X_PARAM_HIGH_LIMIT (20000U)
55#endif
56
57#ifndef ADS101X_PARAMS
58#define ADS101X_PARAMS { .i2c = ADS101X_PARAM_I2C, \
59 .addr = ADS101X_PARAM_ADDR, \
60 .mux_gain = ADS101X_PARAM_MUX_GAIN }
61#endif
62
63#ifndef ADS101X_ALERT_PARAMS
64#define ADS101X_ALERT_PARAMS { .i2c = ADS101X_PARAM_I2C, \
65 .addr = ADS101X_PARAM_ADDR, \
66 .alert_pin = ADS101X_PARAM_ALERT_PIN, \
67 .low_limit = ADS101X_PARAM_LOW_LIMIT, \
68 .high_limit = ADS101X_PARAM_HIGH_LIMIT }
69#endif
70#ifndef ADS101X_SAUL_INFO
71#define ADS101X_SAUL_INFO { .name = "ads101x" }
72#endif
79{
80 ADS101X_PARAMS
81};
82
87{
88 ADS101X_ALERT_PARAMS
89};
90
95{
96 ADS101X_SAUL_INFO
97};
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* ADS101X_PARAMS_H */
ADS101x/111x ADC device driver.
static const saul_reg_info_t ads101x_saul_info[]
Additional meta information to keep in the SAUL registry.
Register definition for ADS101x/111x devices.
SAUL registry interface definition.
ADS101x/111x alert params.
Definition ads101x.h:79
ADS101x/111x params.
Definition ads101x.h:70
Additional data to collect for each entry.
Definition saul_reg.h:49