-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnand-utils.h
57 lines (43 loc) · 1.25 KB
/
nand-utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright (C) 2023 Gijun Oh
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
#ifndef NAND_UTILS_H
#define NAND_UTILS_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef DEBUG
#pragma message "debug mode is enabled"
#endif
void nand_delay_ns(int ns);
void nand_write_pin_mode(void);
void nand_digital_write(int pin, int value);
void nand_digital_write_byte(volatile int command);
void nand_write_1_cycle(volatile int data);
void nand_read_pin_mode(void);
unsigned int nand_read_byte(void);
unsigned int nand_read_1_cycle(void);
void nand_send_command(volatile int command);
void nand_send_address_1_cycle(volatile int address);
void nand_send_address(volatile int row, volatile int col);
void nand_send_address_row(volatile int row);
void nand_enable_chip(void);
void nand_disable_chip(void);
void nand_wait_busy(void);
void nand_read_id(unsigned int cycles[5]);
void nand_pins_print(void);
void nand_page_print(char *data);
int nand_info_print(void);
void nand_status(void);
int nand_pass_fail(void);
// nand-oob.c
int nand_oob_setup(char *oob, char *data);
int nand_oob_verify(char *oob, char *data);
#ifdef __cplusplus
}
#endif
#endif