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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [host/] [flashdrvr.h] - Blame information for rev 51

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 18 dgisselq
////////////////////////////////////////////////////////////////////////////////
2 4 dgisselq
//
3
// Filename:    flashdrvr.h
4
//
5 18 dgisselq
// Project:     OpenArty, an entirely open SoC based upon the Arty platform
6 4 dgisselq
//
7 18 dgisselq
// Purpose:     Flash driver.  Encapsulates writing, both erasing sectors and
8
//              the programming pages, to the flash device.
9 4 dgisselq
//
10 18 dgisselq
// Creator:     Dan Gisselquist, Ph.D.
11
//              Gisselquist Technology, LLC
12
//
13
////////////////////////////////////////////////////////////////////////////////
14
//
15 51 dgisselq
// Copyright (C) 2015-2017, Gisselquist Technology, LLC
16 18 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
// You should have received a copy of the GNU General Public License along
28 51 dgisselq
// with this program.  (It's in the $(ROOT)/doc directory.  Run make with no
29 18 dgisselq
// target there if the PDF file isn't present.)  If not, see
30
// <http://www.gnu.org/licenses/> for a copy.
31
//
32
// 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 4 dgisselq
#ifndef FLASHDRVR_H
41
#define FLASHDRVR_H
42
 
43
#include "regdefs.h"
44
 
45
class   FLASHDRVR {
46
private:
47
        DEVBUS  *m_fpga;
48 51 dgisselq
        bool    m_debug;
49 4 dgisselq
 
50 18 dgisselq
        bool    verify_config(void);
51
        void    set_config(void);
52 4 dgisselq
        void    flwait(void);
53
public:
54 51 dgisselq
        FLASHDRVR(DEVBUS *fpga) : m_fpga(fpga), m_debug(false) {}
55 4 dgisselq
        bool    erase_sector(const unsigned sector, const bool verify_erase=true);
56 51 dgisselq
        bool    page_program(const unsigned addr, const unsigned len,
57
                        const char *data, const bool verify_write=true);
58 4 dgisselq
        bool    write(const unsigned addr, const unsigned len,
59 51 dgisselq
                        const char *data, const bool verify=false);
60 4 dgisselq
};
61
 
62
#endif

powered by: WebSVN 2.1.0

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