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