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

Subversion Repositories s6soc

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

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

powered by: WebSVN 2.1.0

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