ltc4150_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Otto-von-Guericke-Universität Magdeburg
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 LTC4150_PARAMS_H
20 #define LTC4150_PARAMS_H
21 
22 #include "board.h"
23 #include "ltc4150.h"
24 #include "saul_reg.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #ifndef LTC4150_PARAM_INT
35 #define LTC4150_PARAM_INT (GPIO_PIN(0, 4))
36 #endif
37 #ifndef LTC4150_PARAM_POL
38 #define LTC4150_PARAM_POL (GPIO_UNDEF)
39 #endif
40 #ifndef LTC4150_PARAM_SHUTDOWN
41 #define LTC4150_PARAM_SHUTDOWN (GPIO_PIN(0, 5))
42 #endif
43 #ifndef LTC4150_PARAM_PULSES
44 #define LTC4150_PARAM_PULSES (45700U)
45 #endif
46 #ifndef LTC4150_PARAM_FLAGS
47 #define LTC4150_PARAM_FLAGS LTC4150_EXT_PULL_UP
48 #endif
49 #ifndef LTC4150_PARAM_RECS
50 #define LTC4150_PARAM_RECS NULL
51 #define LTC4150_PARAM_RECDATA NULL
52 #endif
53 #ifndef LTC4150_PARAMS
54 #define LTC4150_PARAMS { .interrupt = LTC4150_PARAM_INT, \
55  .polarity = LTC4150_PARAM_POL, \
56  .shutdown = LTC4150_PARAM_SHUTDOWN, \
57  .pulses_per_ah = LTC4150_PARAM_PULSES, \
58  .flags = LTC4150_PARAM_FLAGS, \
59  .recorders = LTC4150_PARAM_RECS, \
60  .recorder_data = LTC4150_PARAM_RECDATA }
61 #endif
62 
68 #ifndef LTC4150_SAULINFO
69 #define LTC4150_SAULINFO { .name = "LTC4150 charge" }, \
70  { .name = "LTC4150 average current" }
71 #endif
72 
79 {
80  LTC4150_PARAMS
81 };
82 
87 {
88  LTC4150_SAULINFO
89 };
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* LTC4150_PARAMS_H */
96 
ltc4150_params_t
Parameters required to set up the LTC4150 coulomb counter.
Definition: ltc4150.h:148
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
ltc4150.h
LTC4150 coulomb counter.
ltc4150_saul_info
static const saul_reg_info_t ltc4150_saul_info[]
Allocate and configure entries to the SAUL registry.
Definition: ltc4150_params.h:86
saul_reg.h
SAUL registry interface definition.
ltc4150_params
static const ltc4150_params_t ltc4150_params[]
Configure LTC4150 devices.
Definition: ltc4150_params.h:78