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

Subversion Repositories spi_core_dsp_s3ean_kits

[/] [spi_core_dsp_s3ean_kits/] [trunk/] [rtl/] [verilog/] [spi_defines.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 williamgib
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  spi_define.v                                                ////
4
////                                                              ////
5
////  This file is part of the SPI IP core project                ////
6
////  http://www.opencores.org/projects/spi/                      ////
7
////                                                              ////
8
////  Author(s):                                                  ////
9
////      - Simon Srot (simons@opencores.org)                     ////
10
////                                                              ////
11
////  All additional information is avaliable in the Readme.txt   ////
12
////  file.                                                       ////
13
////                                                              ////
14
//////////////////////////////////////////////////////////////////////
15
////                                                              ////
16
//// Copyright (C) 2002 Authors                                   ////
17
////                                                              ////
18
//// This source file may be used and distributed without         ////
19
//// restriction provided that this copyright statement is not    ////
20
//// removed from the file and that any derivative work contains  ////
21
//// the original copyright notice and the associated disclaimer. ////
22
////                                                              ////
23
//// This source file is free software; you can redistribute it   ////
24
//// and/or modify it under the terms of the GNU Lesser General   ////
25
//// Public License as published by the Free Software Foundation; ////
26
//// either version 2.1 of the License, or (at your option) any   ////
27
//// later version.                                               ////
28
////                                                              ////
29
//// This source is distributed in the hope that it will be       ////
30
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
31
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
32
//// PURPOSE.  See the GNU Lesser General Public License for more ////
33
//// details.                                                     ////
34
////                                                              ////
35
//// You should have received a copy of the GNU Lesser General    ////
36
//// Public License along with this source; if not, download it   ////
37
//// from http://www.opencores.org/lgpl.shtml                     ////
38
////                                                              ////
39
//////////////////////////////////////////////////////////////////////
40
 
41
//
42
// Number of bits used for devider register. If used in system with
43
// low frequency of system clock this can be reduced.
44
// Use SPI_DIVIDER_LEN for fine tuning theexact number.
45
//
46
`define SPI_DIVIDER_LEN_8
47
//`define SPI_DIVIDER_LEN_16
48
//`define SPI_DIVIDER_LEN_24
49
//`define SPI_DIVIDER_LEN_32
50
 
51
`ifdef SPI_DIVIDER_LEN_8
52
  `define SPI_DIVIDER_LEN       5    // Can be set from 1 to 8
53
`endif
54
`ifdef SPI_DIVIDER_LEN_16
55
  `define SPI_DIVIDER_LEN       16   // Can be set from 9 to 16
56
`endif
57
`ifdef SPI_DIVIDER_LEN_24
58
  `define SPI_DIVIDER_LEN       24   // Can be set from 17 to 24
59
`endif
60
`ifdef SPI_DIVIDER_LEN_32
61
  `define SPI_DIVIDER_LEN       32   // Can be set from 25 to 32 
62
`endif
63
 
64
//
65
// Maximum number of bits that can be send/received at once. 
66
// Use SPI_MAX_CHAR for fine tuning the exact number, when using
67
// SPI_MAX_CHAR_32, SPI_MAX_CHAR_24, SPI_MAX_CHAR_16, SPI_MAX_CHAR_8.
68
//
69
//`define SPI_MAX_CHAR_128
70
//`define SPI_MAX_CHAR_64
71
//`define SPI_MAX_CHAR_32
72
`define SPI_MAX_CHAR_24
73
//`define SPI_MAX_CHAR_16
74
//`define SPI_MAX_CHAR_8
75
 
76
`ifdef SPI_MAX_CHAR_128
77
  `define SPI_MAX_CHAR          128  // Can only be set to 128 
78
  `define SPI_CHAR_LEN_BITS     7
79
`endif
80
`ifdef SPI_MAX_CHAR_64
81
  `define SPI_MAX_CHAR          64   // Can only be set to 64 
82
  `define SPI_CHAR_LEN_BITS     6
83
`endif
84
`ifdef SPI_MAX_CHAR_32
85
  `define SPI_MAX_CHAR          32   // Can be set from 25 to 32 
86
  `define SPI_CHAR_LEN_BITS     5
87
`endif
88
`ifdef SPI_MAX_CHAR_24
89
  `define SPI_MAX_CHAR          24   // Can be set from 17 to 24 
90
  `define SPI_CHAR_LEN_BITS     5
91
`endif
92
`ifdef SPI_MAX_CHAR_16
93
  `define SPI_MAX_CHAR          16   // Can be set from 9 to 16 
94
  `define SPI_CHAR_LEN_BITS     4
95
`endif
96
`ifdef SPI_MAX_CHAR_8
97
  `define SPI_MAX_CHAR          8    // Can be set from 1 to 8 
98
  `define SPI_CHAR_LEN_BITS     3
99
`endif
100
 
101
//
102
// Definitions for the SPI ADC
103
//
104
`define SPI_ADC_CHAR                                    32
105
`define SPI_ADC_CHAR_LEN_BITS                   5
106
//
107
// Number of device select signals. Use SPI_SS_NB for fine tuning the 
108
// exact number.
109
//
110
`define SPI_SS_NB_8
111
//`define SPI_SS_NB_16
112
//`define SPI_SS_NB_24
113
//`define SPI_SS_NB_32
114
 
115
`ifdef SPI_SS_NB_8
116
  `define SPI_SS_NB             8    // Can be set from 1 to 8
117
`endif
118
`ifdef SPI_SS_NB_16
119
  `define SPI_SS_NB             16   // Can be set from 9 to 16
120
`endif
121
`ifdef SPI_SS_NB_24
122
  `define SPI_SS_NB             24   // Can be set from 17 to 24
123
`endif
124
`ifdef SPI_SS_NB_32
125
  `define SPI_SS_NB             32   // Can be set from 25 to 32
126
`endif
127
 
128
 
129
//
130
// Register offset
131
//
132
`define SPI_RX_0                0
133
`define SPI_RX_1                1
134
`define SPI_RX_2                2
135
`define SPI_RX_3                3
136
`define SPI_TX_0                0
137
`define SPI_TX_1                1
138
`define SPI_TX_2                2
139
`define SPI_TX_3                3
140
`define SPI_CTRL                4
141
`define SPI_DEVIDE              5
142
`define SPI_SS                  6
143
 
144
//
145
// Number of bits in ctrl register
146
//
147
`define SPI_CTRL_BIT_NB         14
148
 
149
//
150
// Control register bit position
151
//
152
`define SPI_CTRL_TXC            13
153
`define SPI_CTRL_SAMPLE         12
154
`define SPI_CTRL_LSB            11
155
`define SPI_CTRL_TX_NEGEDGE     10
156
`define SPI_CTRL_RX_NEGEDGE     9
157
`define SPI_CTRL_GO             8
158
`define SPI_CTRL_WRITE          7
159
`define SPI_CTRL_CHAR_LEN       6:0
160
 

powered by: WebSVN 2.1.0

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