at25xxx_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 ML!PA Consulting GmbH
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 
20 #ifndef AT25XXX_PARAMS_H
21 #define AT25XXX_PARAMS_H
22 
23 #include "board.h"
24 #include "at25xxx.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #ifndef AT25XXX_PARAM_SPI
35 #define AT25XXX_PARAM_SPI (SPI_DEV(0))
36 #endif
37 #ifndef AT25XXX_PARAM_SPI_CLK
38 #define AT25XXX_PARAM_SPI_CLK (SPI_CLK_5MHZ)
39 #endif
40 #ifndef AT25XXX_PARAM_CS
41 #define AT25XXX_PARAM_CS (GPIO_PIN(0, 0))
42 #endif
43 #ifndef AT25XXX_PARAM_WP
44 #define AT25XXX_PARAM_WP (GPIO_UNDEF)
45 #endif
46 #ifndef AT25XXX_PARAM_HOLD
47 #define AT25XXX_PARAM_HOLD (GPIO_UNDEF)
48 #endif
49 #ifndef AT25XXX_PARAM_SIZE
50 #define AT25XXX_PARAM_SIZE (128 * 1024UL) /* EEPROM size, in bytes */
51 #endif
52 #ifndef AT25XXX_PARAM_ADDR_LEN
53 #define AT25XXX_PARAM_ADDR_LEN (24) /* Address length, in bits */
54 #endif
55 #ifndef AT25XXX_PARAM_PAGE_SIZE
56 #define AT25XXX_PARAM_PAGE_SIZE (256) /* Page size, in bytes */
57 #endif
58 
59 #ifndef AT25XXX_PARAMS
60 #define AT25XXX_PARAMS { .spi = AT25XXX_PARAM_SPI, \
61  .spi_clk = AT25XXX_PARAM_SPI_CLK, \
62  .cs_pin = AT25XXX_PARAM_CS, \
63  .wp_pin = AT25XXX_PARAM_WP, \
64  .hold_pin = AT25XXX_PARAM_HOLD, \
65  .size = AT25XXX_PARAM_SIZE, \
66  .page_size = AT25XXX_PARAM_PAGE_SIZE }
67 #endif
68 
73 {
74  AT25XXX_PARAMS
75 };
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif /* AT25XXX_PARAMS_H */
at25xxx_params
static const at25xxx_params_t at25xxx_params[]
AT25XXX configuration.
Definition: at25xxx_params.h:72
at25xxx.h
Driver for the AT25xxx series of EEPROMs.
at25xxx_params_t
struct holding all params needed for device initialization
Definition: at25xxx.h:39