Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
Loading...
Searching...
No Matches
bq2429x_params.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2020 Locha Inc
3
* SPDX-License-Identifier: LGPL-2.1-only
4
*/
5
6
#pragma once
7
17
18
#include "board.h"
19
#include "
bq2429x.h
"
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
/* I2C configuration */
26
#ifndef BQ2429X_PARAM_I2C
27
#define BQ2429X_PARAM_I2C I2C_DEV(0)
28
#endif
29
30
/* Interrupt pin configuration */
31
#ifndef BQ2429X_PARAM_INT_PIN
32
#define BQ2429X_PARAM_INT_PIN GPIO_UNDEF
33
#endif
34
35
/* Control pins */
36
#ifndef BQ2429X_PARAM_CE_PIN
37
#define BQ2429X_PARMA_CE_PIN GPIO_UNDEF
38
#endif
39
#ifndef BQ2429X_PARAM_OTG_PIN
40
#define BQ2429X_PARMA_OTG_PIN GPIO_UNDEF
41
#endif
42
43
/* Input current/voltage */
44
#ifndef BQ2429X_PARAM_VLIM
45
#define BQ2429X_PARAM_VLIM BQ2429X_VLIM_4360
46
#endif
47
#ifndef BQ2429X_PARAM_ILIM
48
#define BQ2429X_PARAM_ILIM BQ2429X_ILIM_500
49
#endif
50
51
/* Battery charge current/voltage */
52
#ifndef BQ2429X_PARAM_ICHG
53
#define BQ2429X_PARAM_ICHG BQ2429X_ICHG_512
54
#endif
55
#ifndef BQ2429X_PARAM_VREG
56
#define BQ2429X_PARAM_VREG BQ2429X_VREG_4208
57
#endif
58
59
#if !IS_USED(MODULE_BQ2429X_INT)
60
61
#ifndef BQ2429X_PARAMS
62
#define BQ2429X_PARAMS { \
63
.i2c = BQ2429X_PARAM_I2C, \
64
.ce_pin = BQ2429X_PARMA_CE_PIN, \
65
.otg_pin = BQ2429X_PARMA_OTG_PIN, \
66
.vlim = BQ2429X_PARAM_VLIM, \
67
.ilim = BQ2429X_PARAM_ILIM, \
68
.ichg = BQ2429X_PARAM_ICHG, \
69
.vreg = BQ2429X_PARAM_VREG, \
70
}
71
#endif
72
73
#else
/* !IS_USED(MODULE_BQ2429X_INT) */
74
75
#ifndef BQ2429X_PARAMS
76
#define BQ2429X_PARAMS { \
77
.i2c = BQ2429X_PARAM_I2C, \
78
.int_pin = BQ2429X_PARAM_INT_PIN, \
79
.ce_pin = BQ2429X_PARMA_CE_PIN, \
80
.otg_pin = BQ2429X_PARMA_OTG_PIN, \
81
.vlim = BQ2429X_PARAM_VLIM, \
82
.ilim = BQ2429X_PARAM_ILIM, \
83
.ichg = BQ2429X_PARAM_ICHG, \
84
.vreg = BQ2429X_PARAM_VREG, \
85
}
86
#endif
87
88
#endif
/* !IS_USED(MODULE_BQ2429X_INT) */
89
90
static
bq2429x_params_t
bq2429x_params[] = {
91
BQ2429X_PARAMS,
92
};
93
94
#ifdef __cplusplus
95
}
96
#endif
97
bq2429x.h
Device driver interface for the BQ2429x Single-Cell USB Charger.
bq2429x_params_t
BQ2429x device parameters.
Definition
bq2429x.h:242
Generated on Wed Apr 15 2026 03:46:09 by
1.13.2