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

Last change on this file since 553 was 551, checked in by bouyer, 11 years ago

Add vci_spi, a SPI (Serial Peripheral Interface) controller. The initiator
port is unused for now, but a DMA feature will be added soon.

File size: 1.7 KB
Line 
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 *
22 * Copyright (c) UPMC, Lip6, Asim
23 *         alain greiner
24 *
25 * Maintainers: alain
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,
37    SPI_SS
38};
39
40#define SPI_CTRL_CPOL           (1 << 15) /* Clock polarity                */
41#define SPI_CTRL_CPHA           (1 << 14) /* Clock phase                   */
42#define SPI_CTRL_ASS_EN         (1 << 13) /* Auto Slave Sel Assertion      */
43#define SPI_CTRL_IE_EN          (1 << 12) /* Interrupt Enable              */
44// 9-11 reserved
45#define SPI_CTRL_GO_BSY         (1 << 8 ) /* Start the transfer            */
46#define SPI_CTRL_CHAR_LEN_MASK  (0xFF   ) /* Bits transmited in 1 transfer */
47
48#endif /* SPISD_H */
49
50// Local Variables:
51// tab-width: 4
52// c-basic-offset: 4
53// c-file-offsets:((innamespace . 0)(inline-open . 0))
54// indent-tabs-mode: nil
55// End:
56
57// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
58
Note: See TracBrowser for help on using the repository browser.