SyterKit 0.4.0.x
SyterKit is a bare-metal framework
Loading...
Searching...
No Matches
sys-spi-nand.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef __SYS_SPI_NAND_H__
4#define __SYS_SPI_NAND_H__
5
6#include <io.h>
7#include <stdarg.h>
8#include <stdbool.h>
9#include <stddef.h>
10#include <stdint.h>
11#include <types.h>
12
13#include "sys-clk.h"
14#include "sys-gpio.h"
15#include "sys-spi.h"
16
17#include "log.h"
18
19#ifdef __cplusplus
20extern "C" {
21#endif// __cplusplus
22
31
46
54
65
66#ifdef __cplusplus
67}
68#endif// __cplusplus
69
70#endif// __SYS_SPI_NAND_H__
u32_t uint32_t
Definition stdint.h:13
u8_t uint8_t
Definition stdint.h:7
u16_t uint16_t
Definition stdint.h:10
Represents the NAND Device ID structure.
Definition sys-spi-nand.h:26
uint8_t dlen
Length of the ID (in bytes).
Definition sys-spi-nand.h:29
uint16_t dev
Device ID (16-bits) for identifying the specific NAND device.
Definition sys-spi-nand.h:28
uint8_t mfr
Manufacturer ID byte.
Definition sys-spi-nand.h:27
Represents the specific information of a NAND Flash device.
Definition sys-spi-nand.h:35
uint32_t planes_per_die
Number of planes present on a single die.
Definition sys-spi-nand.h:42
spi_nand_id_t id
Unique identifier for the NAND Flash device, containing manufacturer and device ID.
Definition sys-spi-nand.h:37
uint32_t pages_per_block
Number of pages contained in a single block.
Definition sys-spi-nand.h:40
uint32_t ndies
Total number of dies in the NAND package.
Definition sys-spi-nand.h:43
char * name
Name of the NAND Flash device.
Definition sys-spi-nand.h:36
uint32_t blocks_per_die
Number of blocks present on a single die.
Definition sys-spi-nand.h:41
spi_io_mode_t mode
I/O mode used for communication (assumes the existence of a spi_io_mode_t type).
Definition sys-spi-nand.h:44
uint32_t page_size
Size of the data page (in bytes).
Definition sys-spi-nand.h:38
uint32_t spare_size
Size of the spare area for additional information (in bytes).
Definition sys-spi-nand.h:39
SPI Device Configuration Structure.
Definition sys-spi.h:92
int spi_nand_detect(sunxi_spi_t *spi)
Detect and initialize SPI NAND flash.
Definition sys-spi-nand.c:342
uint32_t spi_nand_read(sunxi_spi_t *spi, uint8_t *buf, uint32_t addr, uint32_t rxlen)
Read data from SPI NAND flash.
Definition sys-spi-nand.c:415
spi_io_mode_t
SPI Input/Output Mode Enumeration.
Definition sys-spi.h:30