nvram-spi.h File Reference

Device interface for various SPI connected NVRAM. More...

Detailed Description

Tested on:

  • Cypress/Ramtron FM25L04B.
Joakim NohlgÄrd joaki.nosp@m.m.no.nosp@m.hlgar.nosp@m.d@ei.nosp@m.stec..nosp@m.se

Definition in file nvram-spi.h.

#include <stdint.h>
#include "nvram.h"
#include "periph/spi.h"
#include "periph/gpio.h"
+ Include dependency graph for nvram-spi.h:

Go to the source code of this file.

Data Structures

struct  nvram_spi_params
 Bus parameters for SPI NVRAM. More...
typedef struct nvram_spi_params nvram_spi_params_t
 Bus parameters for SPI NVRAM.
int nvram_spi_init (nvram_t *dev, nvram_spi_params_t *spi_params, size_t size)
 Initialize an nvram_t structure with SPI settings. More...

Function Documentation

◆ nvram_spi_init()

int nvram_spi_init ( nvram_t dev,
nvram_spi_params_t spi_params,
size_t  size 

This will also initialize the CS pin as a GPIO output, without pull resistors.

[out]devPointer to NVRAM device descriptor
[out]spi_paramsPointer to SPI settings
[in]sizeDevice capacity
0 on success
<0 on errors