OpenCores
URL https://opencores.org/ocsvn/usb_nand_reader/usb_nand_reader/trunk

Subversion Repositories usb_nand_reader

[/] [usb_nand_reader/] [trunk/] [mini32/] [CMD_PageProgram.c] - Rev 7

Compare with Previous | Blame | View Log

 
#include "NandControl.h"
#include "CMD.h"
 
extern char readbuff[64];
 
unsigned char cmd_chip_page_program(unsigned char* inBuffer, int addressCycles, int pageSize)
{
    int i = 0, b;
    nand_send_command(NC_PAGE_PROGRAM_START);
    nand_send_address(inBuffer + 1, addressCycles);
    do_delay(5);
    while(i < pageSize)
    {
        USB_Polling_Proc();
        while(0 == (b = HID_Read()))
            USB_Break();
 
        nand_write(inBuffer, b);
        i += b;
    }
    do_delay(5);
    nand_send_command(NC_PAGE_PROGRAM_END);
    do_delay(100);
    nand_wait_ready();
    return cmd_chip_read_status();
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.