1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/drivers/at25xxx/include/at25xxx_params.h
Benjamin Valentin 97fc2f2af1 drivers: add AT25xxx series EEPROM
This adds a driver for the ST M95xxx series SPI EEPROMs.
The driver has been tested with the M95M01 EEPROM, but should
work with other chips from that family.

SPI-EEPROMs from other vendors from the families AT25xxx, 25AAxxx,
25LCxxx, CAT25xxx & BR25Sxxx should also in the same way.
2020-04-07 12:31:46 +02:00

82 lines
2.0 KiB
C

/*
* Copyright (C) 2019 ML!PA Consulting GmbH
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup drivers_at25xxx
* @{
*
* @file
* @brief Default configuration for the M95M01 EEPROM
*
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
* @}
*/
#ifndef AT25XXX_PARAMS_H
#define AT25XXX_PARAMS_H
#include "board.h"
#include "at25xxx.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name Set default configuration parameters for the AT25XXX driver
* @{
*/
#ifndef AT25XXX_PARAM_SPI
#define AT25XXX_PARAM_SPI (SPI_DEV(0))
#endif
#ifndef AT25XXX_PARAM_SPI_CLK
#define AT25XXX_PARAM_SPI_CLK (SPI_CLK_5MHZ)
#endif
#ifndef AT25XXX_PARAM_CS
#define AT25XXX_PARAM_CS (GPIO_PIN(0, 0))
#endif
#ifndef AT25XXX_PARAM_WP
#define AT25XXX_PARAM_WP (GPIO_UNDEF)
#endif
#ifndef AT25XXX_PARAM_HOLD
#define AT25XXX_PARAM_HOLD (GPIO_UNDEF)
#endif
#ifndef AT25XXX_PARAM_SIZE
#define AT25XXX_PARAM_SIZE (128 * 1024UL) /* EEPROM size, in bytes */
#endif
#ifndef AT25XXX_PARAM_ADDR_LEN
#define AT25XXX_PARAM_ADDR_LEN (24) /* Address length, in bits */
#endif
#ifndef AT25XXX_PARAM_PAGE_SIZE
#define AT25XXX_PARAM_PAGE_SIZE (256) /* Page size, in bytes */
#endif
#ifndef AT25XXX_PARAMS
#define AT25XXX_PARAMS { .spi = AT25XXX_PARAM_SPI, \
.spi_clk = AT25XXX_PARAM_SPI_CLK, \
.cs_pin = AT25XXX_PARAM_CS, \
.wp_pin = AT25XXX_PARAM_WP, \
.hold_pin = AT25XXX_PARAM_HOLD, \
.size = AT25XXX_PARAM_SIZE, \
.page_size = AT25XXX_PARAM_PAGE_SIZE }
#endif
/**
* @brief AT25XXX configuration
*/
static const at25xxx_params_t at25xxx_params[] =
{
AT25XXX_PARAMS
};
#ifdef __cplusplus
}
#endif
#endif /* AT25XXX_PARAMS_H */