Loading...
Searching...
No Matches
mcp47xx_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021 Gunar Schorcht
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
17#ifndef MCP47XX_PARAMS_H
18#define MCP47XX_PARAMS_H
19
20#include "board.h"
21#include "mcp47xx.h"
22#include "saul_reg.h"
23#include "saul/periph.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
33#ifndef MCP47XX_PARAM_VARIANT
35#define MCP47XX_PARAM_VARIANT (MCP4725)
36#endif
37
38#ifndef MCP47XX_PARAM_DEV
40#define MCP47XX_PARAM_DEV I2C_DEV(0)
41#endif
42
43#ifndef MCP47XX_PARAM_ADDR
45#define MCP47XX_PARAM_ADDR (MCP47XX_BASE_ADDR + 2)
46#endif
47
48#ifndef MCP47XX_PARAM_GAIN
50#define MCP47XX_PARAM_GAIN (MCP47XX_GAIN_1X)
51#endif
52
53#ifndef MCP47XX_PARAM_VREF
55#define MCP47XX_PARAM_VREF (MCP47XX_VREF_VDD)
56#endif
57
58#ifndef MCP47XX_PARAM_PD_MODE
60#define MCP47XX_PARAM_PD_MODE (MCP47XX_PD_LARGE)
61#endif
62
63#ifndef MCP47XX_PARAMS
65#define MCP47XX_PARAMS { \
66 .dev = MCP47XX_PARAM_DEV, \
67 .addr = MCP47XX_PARAM_ADDR, \
68 .variant = MCP47XX_PARAM_VARIANT, \
69 .gain = MCP47XX_PARAM_GAIN, \
70 .vref = MCP47XX_PARAM_VREF, \
71 .pd_mode = MCP47XX_PARAM_PD_MODE, \
72 },
73#endif /* MCP47XX_PARAMS */
74
75#ifndef MCP47XX_SAUL_DAC_PARAMS
77#define MCP47XX_SAUL_DAC_PARAMS { \
78 .name = "DAC00", \
79 .dev = 0, \
80 .channel = 0, \
81 .initial = 32768, \
82 },
83#endif
90{
92};
93
94#if IS_USED(MODULE_SAUL) || DOXYGEN
102#endif /* IS_USED(MODULE_SAUL) || DOXYGEN */
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* MCP47XX_PARAMS_H */
static const mcp47xx_params_t mcp47xx_params[]
Allocate some memory to store the actual configuration.
#define MCP47XX_PARAMS
Default MCP47xx configuration parameters.
#define MCP47XX_SAUL_DAC_PARAMS
Example for mapping DAC channels to SAUL.
static const mcp47xx_saul_dac_params_t mcp47xx_saul_dac_params[]
Additional meta information to keep in the SAUL registry.
Parameter definitions for mapping peripherals directly to SAUL.
SAUL registry interface definition.
MCP47xx device configuration parameters.
Definition mcp47xx.h:213
MCP47xx configuration structure for mapping DAC channels to SAUL.
Definition mcp47xx.h:239