Loading...
Searching...
No Matches
ina2xx_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
20
21#include "board.h"
22#include "ina2xx.h"
23#include "saul_reg.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
33#ifndef INA2XX_PARAM_I2C
37#define INA2XX_PARAM_I2C (I2C_DEV(0))
38#endif
39#ifndef INA2XX_PARAM_ADDR
47#define INA2XX_PARAM_ADDR (0x40)
48#endif
49#ifndef INA2XX_PARAM_CONFIG
63#define INA2XX_PARAM_CONFIG (INA2XX_MODE_CONTINUOUS_SHUNT_BUS | \
64 INA2XX_SADC_AVG_128_SAMPLES | \
65 INA2XX_BADC_AVG_128_SAMPLES | \
66 INA2XX_SHUNT_RANGE_80MV | \
67 INA2XX_BUS_RANGE_16V)
68#endif
69#ifndef INA2XX_PARAM_RSHUNT_MOHM
75#define INA2XX_PARAM_RSHUNT_MOHM (100)
76#endif
77#ifndef INA2XX_PARAM_I_RANGE
84#define INA2XX_PARAM_I_RANGE (INA2XX_CURRENT_RANGE_655_MA)
85#endif
86#ifndef INA2XX_PARAMS
87#define INA2XX_PARAMS { .i2c = INA2XX_PARAM_I2C, \
88 .addr = INA2XX_PARAM_ADDR, \
89 .config = INA2XX_PARAM_CONFIG, \
90 .rshunt_mohm = INA2XX_PARAM_RSHUNT_MOHM, \
91 .i_range = INA2XX_PARAM_I_RANGE }
92#endif
94
99#ifndef INA2XX_SAULINFO
100#define INA2XX_SAULINFO { .name = "INA2XX current" }, \
101 { .name = "INA2XX power" }, \
102 { .name = "INA2XX voltage" }
103#endif
105
110{
111 INA2XX_PARAMS
112};
113
118{
119 INA2XX_SAULINFO
120};
121
122#ifdef __cplusplus
123}
124#endif
125
Device driver interface for Texas Instruments INA219/INA2XX Bi-Directional CURRENT/POWER MONITOR with...
static const saul_reg_info_t ina2xx_saul_info[]
Allocate and configure entries to the SAUL registry.
static const ina2xx_params_t ina2xx_params[]
Configure INA2XX devices.
SAUL registry interface definition.
Configuration parameters of the INA2xx driver.
Definition ina2xx.h:175
Additional data to collect for each entry.
Definition saul_reg.h:48