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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [flashdrvr.h] - Blame information for rev 21

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    flashdrvr.h
4
//
5 11 dgisselq
// Project:     CMod S6 System on a Chip, ZipCPU demonstration project
6 8 dgisselq
//
7
// Purpose:     Flash driver.  Encapsulate writing to the flash device.
8
//
9 11 dgisselq
// Creator:     Dan Gisselquist, Ph.D.
10
//              Gisselquist Technology, LLC
11 8 dgisselq
//
12
////////////////////////////////////////////////////////////////////////////////
13
//
14 11 dgisselq
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
15 8 dgisselq
//
16
// This program is free software (firmware): you can redistribute it and/or
17
// modify it under the terms of  the GNU General Public License as published
18
// by the Free Software Foundation, either version 3 of the License, or (at
19
// your option) any later version.
20
//
21
// This program is distributed in the hope that it will be useful, but WITHOUT
22
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26 11 dgisselq
// You should have received a copy of the GNU General Public License along
27
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
28
// target there if the PDF file isn't present.)  If not, see
29
// <http://www.gnu.org/licenses/> for a copy.
30
//
31 8 dgisselq
// License:     GPL, v3, as defined and found on www.gnu.org,
32
//              http://www.gnu.org/licenses/gpl.html
33
//
34
//
35
////////////////////////////////////////////////////////////////////////////////
36
//
37
//
38
//
39
#ifndef FLASHDRVR_H
40
#define FLASHDRVR_H
41
 
42
#include "regdefs.h"
43
 
44
class   FLASHDRVR {
45
private:
46
        DEVBUS  *m_fpga;
47
 
48
        void    flwait(void);
49
public:
50
        FLASHDRVR(DEVBUS *fpga) : m_fpga(fpga) {}
51
        bool    erase_sector(const unsigned sector, const bool verify_erase=true);
52
        bool    write_page(const unsigned addr, const unsigned len,
53
                        const unsigned *data, const bool verify_write=true);
54
        bool    write(const unsigned addr, const unsigned len,
55
                        const unsigned *data, const bool verify=false);
56
};
57
 
58
#endif

powered by: WebSVN 2.1.0

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