Loading...
Searching...
No Matches
itg320x_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Gunar Schorcht
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
15
16#include "board.h"
17#include "itg320x.h"
18#include "saul_reg.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
28#ifndef ITG320X_PARAM_DEV
29#define ITG320X_PARAM_DEV I2C_DEV(0)
30#endif
31#ifndef ITG320X_PARAM_ADDR
32#define ITG320X_PARAM_ADDR (ITG320X_I2C_ADDRESS_1)
33#endif
34#ifndef ITG320X_PARAM_LPF_BW
35#define ITG320X_PARAM_LPF_BW (ITG320X_LPF_BW_5)
36#endif
37#ifndef ITG320X_PARAM_ISR_DIV
38#define ITG320X_PARAM_ISR_DIV (99)
39#endif
40#ifndef ITG320X_PARAM_CLK_SEL
41#define ITG320X_PARAM_CLK_SEL (ITG320X_CLK_PLL_X_GYRO)
42#endif
43#ifndef ITG320X_PARAM_INT_PIN
44#define ITG320X_PARAM_INT_PIN (GPIO_UNDEF)
45#endif
46#ifndef ITG320X_PARAM_INT_LEVEL
47#define ITG320X_PARAM_INT_LEVEL (ITG320X_INT_LOW)
48#endif
49#ifndef ITG320X_PARAM_INT_DRIVE
50#define ITG320X_PARAM_INT_DRIVE (ITG320X_INT_PUSH_PULL)
51#endif
52
53#ifndef ITG320X_PARAMS
54#ifdef MODULE_ITG320X_INT
55#define ITG320X_PARAMS { \
56 .dev = ITG320X_PARAM_DEV, \
57 .addr = ITG320X_PARAM_ADDR, \
58 .lpf_bw = ITG320X_PARAM_LPF_BW, \
59 .isr_div = ITG320X_PARAM_ISR_DIV, \
60 .clk_sel = ITG320X_PARAM_CLK_SEL, \
61 .int_pin = ITG320X_PARAM_INT_PIN, \
62 .int_level = ITG320X_PARAM_INT_LEVEL, \
63 .int_drive = ITG320X_PARAM_INT_DRIVE, \
64 }
65#else /* MODULE_ITG320X_INT */
66#define ITG320X_PARAMS { \
67 .dev = ITG320X_PARAM_DEV, \
68 .addr = ITG320X_PARAM_ADDR, \
69 .lpf_bw = ITG320X_PARAM_LPF_BW, \
70 .isr_div = ITG320X_PARAM_ISR_DIV, \
71 .clk_sel = ITG320X_PARAM_CLK_SEL, \
72 }
73#endif /* MODULE_ITG320X_INT */
74#endif /* ITG320X_PARAMS */
75
76#ifndef ITG320X_SAUL_INFO
77#define ITG320X_SAUL_INFO { .name = "itg320x" }
78#endif
80
85{
86 ITG320X_PARAMS
87};
88
93{
94 ITG320X_SAUL_INFO
95};
96
97#ifdef __cplusplus
98}
99#endif
100
Device driver for InvenSense ITG320X 3-axis gyroscope.
static const itg320x_params_t itg320x_params[]
Allocate some memory to store the actual configuration.
static const saul_reg_info_t itg320x_saul_info[]
Additional meta information to keep in the SAUL registry.
SAUL registry interface definition.
ITG320X device initialization parameters.
Definition itg320x.h:144
Additional data to collect for each entry.
Definition saul_reg.h:48