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

Subversion Repositories openarty

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

Go to most recent revision | 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
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
16
//
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
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
29
// 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
//
41 4 dgisselq
// Creator:     Dan Gisselquist
42
//              Gisselquist Tecnology, LLC
43
//
44
// Copyright:   2015
45
//
46
//
47
#ifndef FLASHDRVR_H
48
#define FLASHDRVR_H
49
 
50
#include "regdefs.h"
51
 
52
class   FLASHDRVR {
53
private:
54
        DEVBUS  *m_fpga;
55
 
56 18 dgisselq
        bool    verify_config(void);
57
        void    set_config(void);
58 4 dgisselq
        void    flwait(void);
59
public:
60
        FLASHDRVR(DEVBUS *fpga) : m_fpga(fpga) {}
61
        bool    erase_sector(const unsigned sector, const bool verify_erase=true);
62
        bool    write_page(const unsigned addr, const unsigned len,
63
                        const unsigned *data, const bool verify_write=true);
64
        bool    write(const unsigned addr, const unsigned len,
65
                        const unsigned *data, const bool verify=false);
66
};
67
 
68
#endif

powered by: WebSVN 2.1.0

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