at24cxxx_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 
19 #ifndef AT24CXXX_PARAMS_H
20 #define AT24CXXX_PARAMS_H
21 
22 #include "board.h"
23 #include "periph/gpio.h"
24 #include "at24cxxx_defines.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #ifndef AT24CXXX_PARAM_I2C
35 
38 #define AT24CXXX_PARAM_I2C (I2C_DEV(0))
39 #endif
40 #ifndef AT24CXXX_PARAM_ADDR
41 
44 #define AT24CXXX_PARAM_ADDR (AT24CXXX_DEF_DEV_ADDR)
45 #endif
46 #ifndef AT24CXXX_PARAM_PIN_WP
47 
50 #define AT24CXXX_PARAM_PIN_WP (GPIO_UNDEF)
51 #endif
52 #ifndef AT24CXXX_PARAM_EEPROM_SIZE
53 
56 #define AT24CXXX_PARAM_EEPROM_SIZE (AT24CXXX_EEPROM_SIZE)
57 #endif
58 #ifndef AT24CXXX_PARAM_PAGE_SIZE
59 
62 #define AT24CXXX_PARAM_PAGE_SIZE (AT24CXXX_PAGE_SIZE)
63 #endif
64 #ifndef AT24CXXX_PARAM_MAX_POLLS
65 
68 #define AT24CXXX_PARAM_MAX_POLLS (AT24CXXX_MAX_POLLS)
69 #endif
70 #ifndef AT24CXXX_PARAMS
71 
74 #define AT24CXXX_PARAMS { \
75  .i2c = AT24CXXX_PARAM_I2C, \
76  .dev_addr = AT24CXXX_PARAM_ADDR, \
77  .pin_wp = AT24CXXX_PARAM_PIN_WP, \
78  .eeprom_size = AT24CXXX_PARAM_EEPROM_SIZE, \
79  .page_size = AT24CXXX_PARAM_PAGE_SIZE, \
80  .max_polls = AT24CXXX_PARAM_MAX_POLLS \
81 }
82 #endif
83 
88 #define AT24CXXX_NUMOF ARRAY_SIZE(at24cxxx_params)
89 
94 {
96 };
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
102 #endif /* AT24CXXX_PARAMS_H */
103 
at24cxxx_defines.h
Constants for AT24CXXX EEPROM devices.
gpio.h
Low-level GPIO peripheral driver interface definitions.
AT24CXXX_PARAMS
#define AT24CXXX_PARAMS
Default device configuration parameters.
Definition: at24cxxx_params.h:74
at24cxxx_params
Struct that holds initialization parameters.
Definition: at24cxxx.h:46