Loading...
Searching...
No Matches
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
19#ifndef AT25XXX_PARAMS_H
20#define AT25XXX_PARAMS_H
21
22#include "board.h"
23#include "at25xxx.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
33#ifndef AT25XXX_PARAM_SPI
34#define AT25XXX_PARAM_SPI (SPI_DEV(0))
35#endif
36#ifndef AT25XXX_PARAM_SPI_CLK
37#define AT25XXX_PARAM_SPI_CLK (SPI_CLK_5MHZ)
38#endif
39#ifndef AT25XXX_PARAM_CS
40#define AT25XXX_PARAM_CS (GPIO_PIN(0, 0))
41#endif
42#ifndef AT25XXX_PARAM_WP
43#define AT25XXX_PARAM_WP (GPIO_UNDEF)
44#endif
45#ifndef AT25XXX_PARAM_HOLD
46#define AT25XXX_PARAM_HOLD (GPIO_UNDEF)
47#endif
48#ifndef AT25XXX_PARAM_SIZE
49#define AT25XXX_PARAM_SIZE (128 * 1024UL) /* EEPROM size, in bytes */
50#endif
51#ifndef AT25XXX_PARAM_ADDR_LEN
52#define AT25XXX_PARAM_ADDR_LEN (24) /* Address length, in bits */
53#endif
54#ifndef AT25XXX_PARAM_PAGE_SIZE
55#define AT25XXX_PARAM_PAGE_SIZE (256) /* Page size, in bytes */
56#endif
57
58#ifndef AT25XXX_PARAMS
59#define AT25XXX_PARAMS { .spi = AT25XXX_PARAM_SPI, \
60 .spi_clk = AT25XXX_PARAM_SPI_CLK, \
61 .cs_pin = AT25XXX_PARAM_CS, \
62 .wp_pin = AT25XXX_PARAM_WP, \
63 .hold_pin = AT25XXX_PARAM_HOLD, \
64 .size = AT25XXX_PARAM_SIZE, \
65 .page_size = AT25XXX_PARAM_PAGE_SIZE }
66#endif
73{
74 AT25XXX_PARAMS
75};
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif /* AT25XXX_PARAMS_H */
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:39