SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
Classes | Functions
sys-spi-nand.h File Reference
#include <io.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <types.h>
#include "sys-clk.h"
#include "sys-gpio.h"
#include "sys-spi.h"
#include "log.h"
Include dependency graph for sys-spi-nand.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  spi_nand_id_t
 Represents the NAND Device ID structure. More...
 
struct  spi_nand_info_t
 Represents the specific information of a NAND Flash device. More...
 

Functions

int spi_nand_detect (sunxi_spi_t *spi)
 Detect and initialize SPI NAND flash.
 
uint32_t spi_nand_read (sunxi_spi_t *spi, uint8_t *buf, uint32_t addr, uint32_t rxlen)
 Read data from SPI NAND flash.
 

Function Documentation

◆ spi_nand_detect()

int spi_nand_detect ( sunxi_spi_t spi)

Detect and initialize SPI NAND flash.

Parameters
spiPointer to the sunxi_spi_t structure.
Returns
0 on success, -1 on failure.

◆ spi_nand_read()

uint32_t spi_nand_read ( sunxi_spi_t spi,
uint8_t buf,
uint32_t  addr,
uint32_t  rxlen 
)

Read data from SPI NAND flash.

Parameters
spiPointer to the sunxi_spi_t structure.
bufPointer to the buffer to store the read data.
addrStarting address to read from.
rxlenNumber of bytes to read.
Returns
Number of bytes read on success, -1 on failure.