source: trunk/modules/vci_spi/include/soclib/vcispi.h

Last change on this file was 592, checked in by bouyer, 11 years ago
  • report DMA errors
  • minor changes to sync with the VHDL model
File size: 1.9 KB
RevLine 
[551]1/*
2 * SOCLIB_LGPL_HEADER_BEGIN
3 *
4 * This file is part of SoCLib, GNU LGPLv2.1.
5 *
6 * SoCLib is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; version 2.1 of the License.
9 *
10 * SoCLib is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with SoCLib; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301 USA
19 *
20 * SOCLIB_LGPL_HEADER_END
21 *
[573]22 * Copyright (c) UPMC, Lip6, SoC
23 *         manuel bouyer
[551]24 *
[573]25 * Maintainers: bouyer
[551]26 */
27#ifndef SPISD_H
28#define SPISD_H
29
30enum SoclibBlockDeviceRegisters {
31    SPI_DATA_TXRX0,
32    SPI_DATA_TXRX1,
33    SPI_DATA_TXRX2,
34    SPI_DATA_TXRX3,
35    SPI_CTRL,
36    SPI_DIVIDER,
[579]37    SPI_SS,
38    SPI_DMA_BASE,
39    SPI_DMA_BASEH,
40    SPI_DMA_COUNT
[551]41};
42
[592]43#define SPI_CTRL_DMA_ERR        (1 << 17) /* R   DMA error                    */
[579]44#define SPI_CTRL_DMA_BSY        (1 << 16) /* R   DMA in progress              */
45#define SPI_CTRL_CPOL           (1 << 15) /* R/W Clock polarity               */
46#define SPI_CTRL_CPHA           (1 << 14) /* R/W Clock phase                  */
47#define SPI_CTRL_IE_EN          (1 << 12) /* R/W Interrupt Enable             */
[551]48// 9-11 reserved
[579]49#define SPI_CTRL_GO_BSY         (1 << 8 ) /* R/W Start the transfer           */
50#define SPI_CTRL_CHAR_LEN_MASK  (0xFF   ) /* R/W Bits transmited in 1 transfer*/
[551]51
[579]52#define SPI_DMA_COUNT_READ      (1 << 0) /* operation is a read (else write) */
53
[551]54#endif /* SPISD_H */
55
56// Local Variables:
57// tab-width: 4
58// c-basic-offset: 4
59// c-file-offsets:((innamespace . 0)(inline-open . 0))
60// indent-tabs-mode: nil
61// End:
62
63// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
64
Note: See TracBrowser for help on using the repository browser.