nvram-spi.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Eistec AB
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
23 #ifndef NVRAM_SPI_H
24 #define NVRAM_SPI_H
25 
26 #include <stdint.h>
27 #include "nvram.h"
28 #include "periph/spi.h"
29 #include "periph/gpio.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 typedef struct nvram_spi_params {
44  gpio_t cs;
46  uint8_t address_count;
48 
61 int nvram_spi_init(nvram_t *dev, nvram_spi_params_t *spi_params, size_t size);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* NVRAM_SPI_H */
68 
Generic non-volatile RAM driver interface.
Low-level GPIO peripheral driver interface definitions.
spi_clk_t clk
SPI clock speed.
Definition: nvram-spi.h:42
int nvram_spi_init(nvram_t *dev, nvram_spi_params_t *spi_params, size_t size)
Initialize an nvram_t structure with SPI settings.
Bus parameters for SPI NVRAM.
Definition: nvram-spi.h:38
Low-level SPI peripheral driver interface definition.
gpio_t cs
Chip select pin.
Definition: nvram-spi.h:44
struct nvram_spi_params nvram_spi_params_t
Bus parameters for SPI NVRAM.
Device descriptor for generic NVRAM devices.
Definition: nvram.h:48
uint8_t address_count
Number of address bytes following each read/write command.
Definition: nvram-spi.h:46
spi_t spi
RIOT SPI device.
Definition: nvram-spi.h:40
unsigned int spi_t
Default type for SPI devices.
Definition: spi.h:105