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