Loading...
Searching...
No Matches
ltc4150_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Otto-von-Guericke-Universität Magdeburg
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
17
18#include "board.h"
19#include "ltc4150.h"
20#include "saul_reg.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
30#ifndef LTC4150_PARAM_INT
31#define LTC4150_PARAM_INT (GPIO_PIN(0, 4))
32#endif
33#ifndef LTC4150_PARAM_POL
34#define LTC4150_PARAM_POL (GPIO_UNDEF)
35#endif
36#ifndef LTC4150_PARAM_SHUTDOWN
37#define LTC4150_PARAM_SHUTDOWN (GPIO_PIN(0, 5))
38#endif
39#ifndef LTC4150_PARAM_PULSES
40#define LTC4150_PARAM_PULSES (45700U)
41#endif
42#ifndef LTC4150_PARAM_FLAGS
43#define LTC4150_PARAM_FLAGS LTC4150_EXT_PULL_UP
44#endif
45#ifndef LTC4150_PARAM_RECS
46#define LTC4150_PARAM_RECS NULL
47#define LTC4150_PARAM_RECDATA NULL
48#endif
49#ifndef LTC4150_PARAMS
50#define LTC4150_PARAMS { .interrupt = LTC4150_PARAM_INT, \
51 .polarity = LTC4150_PARAM_POL, \
52 .shutdown = LTC4150_PARAM_SHUTDOWN, \
53 .pulses_per_ah = LTC4150_PARAM_PULSES, \
54 .flags = LTC4150_PARAM_FLAGS, \
55 .recorders = LTC4150_PARAM_RECS, \
56 .recorder_data = LTC4150_PARAM_RECDATA }
57#endif
59
64#ifndef LTC4150_SAULINFO
65#define LTC4150_SAULINFO { .name = "LTC4150 charge" }, \
66 { .name = "LTC4150 average current" }
67#endif
68
70
75{
76 LTC4150_PARAMS
77};
78
83{
84 LTC4150_SAULINFO
85};
86
87#ifdef __cplusplus
88}
89#endif
90
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:143
Additional data to collect for each entry.
Definition saul_reg.h:48