Loading...
Searching...
No Matches
itg320x_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 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
9#pragma once
10
18
19#include "board.h"
20#include "itg320x.h"
21#include "saul_reg.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
31#ifndef ITG320X_PARAM_DEV
32#define ITG320X_PARAM_DEV I2C_DEV(0)
33#endif
34#ifndef ITG320X_PARAM_ADDR
35#define ITG320X_PARAM_ADDR (ITG320X_I2C_ADDRESS_1)
36#endif
37#ifndef ITG320X_PARAM_LPF_BW
38#define ITG320X_PARAM_LPF_BW (ITG320X_LPF_BW_5)
39#endif
40#ifndef ITG320X_PARAM_ISR_DIV
41#define ITG320X_PARAM_ISR_DIV (99)
42#endif
43#ifndef ITG320X_PARAM_CLK_SEL
44#define ITG320X_PARAM_CLK_SEL (ITG320X_CLK_PLL_X_GYRO)
45#endif
46#ifndef ITG320X_PARAM_INT_PIN
47#define ITG320X_PARAM_INT_PIN (GPIO_UNDEF)
48#endif
49#ifndef ITG320X_PARAM_INT_LEVEL
50#define ITG320X_PARAM_INT_LEVEL (ITG320X_INT_LOW)
51#endif
52#ifndef ITG320X_PARAM_INT_DRIVE
53#define ITG320X_PARAM_INT_DRIVE (ITG320X_INT_PUSH_PULL)
54#endif
55
56#ifndef ITG320X_PARAMS
57#ifdef MODULE_ITG320X_INT
58#define ITG320X_PARAMS { \
59 .dev = ITG320X_PARAM_DEV, \
60 .addr = ITG320X_PARAM_ADDR, \
61 .lpf_bw = ITG320X_PARAM_LPF_BW, \
62 .isr_div = ITG320X_PARAM_ISR_DIV, \
63 .clk_sel = ITG320X_PARAM_CLK_SEL, \
64 .int_pin = ITG320X_PARAM_INT_PIN, \
65 .int_level = ITG320X_PARAM_INT_LEVEL, \
66 .int_drive = ITG320X_PARAM_INT_DRIVE, \
67 }
68#else /* MODULE_ITG320X_INT */
69#define ITG320X_PARAMS { \
70 .dev = ITG320X_PARAM_DEV, \
71 .addr = ITG320X_PARAM_ADDR, \
72 .lpf_bw = ITG320X_PARAM_LPF_BW, \
73 .isr_div = ITG320X_PARAM_ISR_DIV, \
74 .clk_sel = ITG320X_PARAM_CLK_SEL, \
75 }
76#endif /* MODULE_ITG320X_INT */
77#endif /* ITG320X_PARAMS */
78
79#ifndef ITG320X_SAUL_INFO
80#define ITG320X_SAUL_INFO { .name = "itg320x" }
81#endif
83
88{
89 ITG320X_PARAMS
90};
91
96{
97 ITG320X_SAUL_INFO
98};
99
100#ifdef __cplusplus
101}
102#endif
103
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:147
Additional data to collect for each entry.
Definition saul_reg.h:48