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 
nvram_spi_params
Bus parameters for SPI NVRAM.
Definition: nvram-spi.h:38
spi.h
Low-level SPI peripheral driver interface definition.
nvram.h
Generic non-volatile RAM driver interface.
nvram_spi_params_t
struct nvram_spi_params nvram_spi_params_t
Bus parameters for SPI NVRAM.
nvram_spi_params::spi
spi_t spi
RIOT SPI device.
Definition: nvram-spi.h:40
nvram_spi_params::address_count
uint8_t address_count
Number of address bytes following each read/write command.
Definition: nvram-spi.h:46
spi_clk_t
spi_clk_t
Available SPI clock speeds.
Definition: spi.h:173
nvram
Device descriptor for generic NVRAM devices.
Definition: nvram.h:48
nvram_spi_init
int nvram_spi_init(nvram_t *dev, nvram_spi_params_t *spi_params, size_t size)
Initialize an nvram_t structure with SPI settings.
nvram_spi_params::clk
spi_clk_t clk
SPI clock speed.
Definition: nvram-spi.h:42
nvram_spi_params::cs
gpio_t cs
Chip select pin.
Definition: nvram-spi.h:44
gpio.h
Low-level GPIO peripheral driver interface definitions.
spi_t
unsigned int spi_t
Default type for SPI devices.
Definition: spi.h:118