1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
|
/* This source file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */
/*This file is prepared for Doxygen automatic documentation generation.*/
/*! \file *********************************************************************
*
* \brief SMC on EBI driver for AVR32 UC3.
*
* - Compiler: IAR EWAVR32 and GNU GCC for AVR32
* - Supported devices: All AVR32 devices with a SMC module can be used.
* - AppNote:
*
* \author Atmel Corporation: http://www.atmel.com \n
* Support and FAQ: http://support.atmel.no/
*
******************************************************************************/
/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name of Atmel may not be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* 4. This software may only be redistributed and used in connection with an Atmel
* AVR product.
*
* THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
*
*/
#include "compiler.h"
#include "preprocessor.h"
#include "gpio.h"
#include "smc.h"
// Configure the SM Controller with SM setup and timing information for all chip select
#define SMC_CS_SETUP(ncs) { \
U32 nwe_setup = ((NWE_SETUP * hsb_mhz_up + 999) / 1000); \
U32 ncs_wr_setup = ((NCS_WR_SETUP * hsb_mhz_up + 999) / 1000); \
U32 nrd_setup = ((NRD_SETUP * hsb_mhz_up + 999) / 1000); \
U32 ncs_rd_setup = ((NCS_RD_SETUP * hsb_mhz_up + 999) / 1000); \
U32 nwe_pulse = ((NWE_PULSE * hsb_mhz_up + 999) / 1000); \
U32 ncs_wr_pulse = ((NCS_WR_PULSE * hsb_mhz_up + 999) / 1000); \
U32 nrd_pulse = ((NRD_PULSE * hsb_mhz_up + 999) / 1000); \
U32 ncs_rd_pulse = ((NCS_RD_PULSE * hsb_mhz_up + 999) / 1000); \
U32 nwe_cycle = ((NWE_CYCLE * hsb_mhz_up + 999) / 1000); \
U32 nrd_cycle = ((NRD_CYCLE * hsb_mhz_up + 999) / 1000); \
\
/* Some coherence checks... */ \
/* Ensures CS is active during Rd or Wr */ \
if( ncs_rd_setup + ncs_rd_pulse < nrd_setup + nrd_pulse ) \
ncs_rd_pulse = nrd_setup + nrd_pulse - ncs_rd_setup; \
if( ncs_wr_setup + ncs_wr_pulse < nwe_setup + nwe_pulse ) \
ncs_wr_pulse = nwe_setup + nwe_pulse - ncs_wr_setup; \
\
/* ncs_hold = n_cycle - ncs_setup - ncs_pulse */ \
/* n_hold = n_cycle - n_setup - n_pulse */ \
/* */ \
/* All holds parameters must be positive or null, so: */ \
/* nwe_cycle shall be >= ncs_wr_setup + ncs_wr_pulse */ \
if( nwe_cycle < ncs_wr_setup + ncs_wr_pulse ) \
nwe_cycle = ncs_wr_setup + ncs_wr_pulse; \
\
/* nwe_cycle shall be >= nwe_setup + nwe_pulse */ \
if( nwe_cycle < nwe_setup + nwe_pulse ) \
nwe_cycle = nwe_setup + nwe_pulse; \
\
/* nrd_cycle shall be >= ncs_rd_setup + ncs_rd_pulse */ \
if( nrd_cycle < ncs_rd_setup + ncs_rd_pulse ) \
nrd_cycle = ncs_rd_setup + ncs_rd_pulse; \
\
/* nrd_cycle shall be >= nrd_setup + nrd_pulse */ \
if( nrd_cycle < nrd_setup + nrd_pulse ) \
nrd_cycle = nrd_setup + nrd_pulse; \
\
AVR32_SMC.cs[ncs].setup = (nwe_setup << AVR32_SMC_SETUP0_NWE_SETUP_OFFSET) | \
(ncs_wr_setup << AVR32_SMC_SETUP0_NCS_WR_SETUP_OFFSET) | \
(nrd_setup << AVR32_SMC_SETUP0_NRD_SETUP_OFFSET) | \
(ncs_rd_setup << AVR32_SMC_SETUP0_NCS_RD_SETUP_OFFSET); \
AVR32_SMC.cs[ncs].pulse = (nwe_pulse << AVR32_SMC_PULSE0_NWE_PULSE_OFFSET) | \
(ncs_wr_pulse << AVR32_SMC_PULSE0_NCS_WR_PULSE_OFFSET) | \
(nrd_pulse << AVR32_SMC_PULSE0_NRD_PULSE_OFFSET) | \
(ncs_rd_pulse << AVR32_SMC_PULSE0_NCS_RD_PULSE_OFFSET); \
AVR32_SMC.cs[ncs].cycle = (nwe_cycle << AVR32_SMC_CYCLE0_NWE_CYCLE_OFFSET) | \
(nrd_cycle << AVR32_SMC_CYCLE0_NRD_CYCLE_OFFSET); \
AVR32_SMC.cs[ncs].mode = (((NCS_CONTROLLED_READ) ? AVR32_SMC_MODE0_READ_MODE_NCS_CONTROLLED : \
AVR32_SMC_MODE0_READ_MODE_NRD_CONTROLLED) << AVR32_SMC_MODE0_READ_MODE_OFFSET) | \
+ (((NCS_CONTROLLED_WRITE) ? AVR32_SMC_MODE0_WRITE_MODE_NCS_CONTROLLED : \
AVR32_SMC_MODE0_WRITE_MODE_NWE_CONTROLLED) << AVR32_SMC_MODE0_WRITE_MODE_OFFSET) | \
(NWAIT_MODE << AVR32_SMC_MODE0_EXNW_MODE_OFFSET) | \
(((SMC_8_BIT_CHIPS) ? AVR32_SMC_MODE0_BAT_BYTE_WRITE : \
AVR32_SMC_MODE0_BAT_BYTE_SELECT) << AVR32_SMC_MODE0_BAT_OFFSET) | \
(((SMC_DBW <= 8 ) ? AVR32_SMC_MODE0_DBW_8_BITS : \
(SMC_DBW <= 16) ? AVR32_SMC_MODE0_DBW_16_BITS : \
AVR32_SMC_MODE0_DBW_32_BITS) << AVR32_SMC_MODE0_DBW_OFFSET) | \
(TDF_CYCLES << AVR32_SMC_MODE0_TDF_CYCLES_OFFSET) | \
(TDF_OPTIM << AVR32_SMC_MODE0_TDF_MODE_OFFSET) | \
(PAGE_MODE << AVR32_SMC_MODE0_PMEN_OFFSET) | \
(PAGE_SIZE << AVR32_SMC_MODE0_PS_OFFSET); \
smc_tab_cs_size[ncs] = (U8)EXT_SM_SIZE; \
}
static U8 smc_tab_cs_size[6];
static void smc_enable_muxed_pins(void);
void smc_init(unsigned long hsb_hz)
{
unsigned long hsb_mhz_up = (hsb_hz + 999999) / 1000000;
//! Whether to use the NCS0 pin
#ifdef SMC_USE_NCS0
#include SMC_COMPONENT_CS0
// Setup SMC for NCS0
SMC_CS_SETUP(0)
#ifdef SMC_DBW_GLOBAL
#if (SMC_DBW_GLOBAL < SMC_DBW)
#undef SMC_DBW_GLOBAL
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#else
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#ifdef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS_GLOBAL < SMC_8_BIT)
#undef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#else
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#ifdef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE_GLOBAL < NWAIT_MODE)
#undef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#else
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#undef EXT_SM_SIZE
#undef SMC_DBW
#undef SMC_8_BIT_CHIPS
#undef NWE_SETUP
#undef NCS_WR_SETUP
#undef NRD_SETUP
#undef NCS_RD_SETUP
#undef NCS_WR_PULSE
#undef NWE_PULSE
#undef NCS_RD_PULSE
#undef NRD_PULSE
#undef NCS_WR_HOLD
#undef NWE_HOLD
#undef NWE_CYCLE
#undef NCS_RD_HOLD
#undef NRD_CYCLE
#undef TDF_CYCLES
#undef TDF_OPTIM
#undef PAGE_MODE
#undef PAGE_SIZE
#undef NCS_CONTROLLED_READ
#undef NCS_CONTROLLED_WRITE
#undef NWAIT_MODE
#endif
//! Whether to use the NCS1 pin
#ifdef SMC_USE_NCS1
#include SMC_COMPONENT_CS1
// Enable SM mode for CS1 if necessary.
AVR32_HMATRIX.sfr[AVR32_EBI_HMATRIX_NR] &= ~(1 << AVR32_EBI_SDRAM_CS);
AVR32_HMATRIX.sfr[AVR32_EBI_HMATRIX_NR];
// Setup SMC for NCS1
SMC_CS_SETUP(1)
#ifdef SMC_DBW_GLOBAL
#if (SMC_DBW_GLOBAL < SMC_DBW)
#undef SMC_DBW_GLOBAL
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#else
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#ifdef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS_GLOBAL < SMC_8_BIT)
#undef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#else
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#ifdef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE_GLOBAL < NWAIT_MODE)
#undef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#else
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#undef EXT_SM_SIZE
#undef SMC_DBW
#undef SMC_8_BIT_CHIPS
#undef NWE_SETUP
#undef NCS_WR_SETUP
#undef NRD_SETUP
#undef NCS_RD_SETUP
#undef NCS_WR_PULSE
#undef NWE_PULSE
#undef NCS_RD_PULSE
#undef NRD_PULSE
#undef NCS_WR_HOLD
#undef NWE_HOLD
#undef NWE_CYCLE
#undef NCS_RD_HOLD
#undef NRD_CYCLE
#undef TDF_CYCLES
#undef TDF_OPTIM
#undef PAGE_MODE
#undef PAGE_SIZE
#undef NCS_CONTROLLED_READ
#undef NCS_CONTROLLED_WRITE
#undef NWAIT_MODE
#endif
//! Whether to use the NCS2 pin
#ifdef SMC_USE_NCS2
#include SMC_COMPONENT_CS2
// Setup SMC for NCS2
SMC_CS_SETUP(2)
#ifdef SMC_DBW_GLOBAL
#if (SMC_DBW_GLOBAL < SMC_DBW)
#undef SMC_DBW_GLOBAL
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#else
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#ifdef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS_GLOBAL < SMC_8_BIT)
#undef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#else
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#ifdef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE_GLOBAL < NWAIT_MODE)
#undef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#else
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#undef EXT_SM_SIZE
#undef SMC_DBW
#undef SMC_8_BIT_CHIPS
#undef NWE_SETUP
#undef NCS_WR_SETUP
#undef NRD_SETUP
#undef NCS_RD_SETUP
#undef NCS_WR_PULSE
#undef NWE_PULSE
#undef NCS_RD_PULSE
#undef NRD_PULSE
#undef NCS_WR_HOLD
#undef NWE_HOLD
#undef NWE_CYCLE
#undef NCS_RD_HOLD
#undef NRD_CYCLE
#undef TDF_CYCLES
#undef TDF_OPTIM
#undef PAGE_MODE
#undef PAGE_SIZE
#undef NCS_CONTROLLED_READ
#undef NCS_CONTROLLED_WRITE
#undef NWAIT_MODE
#endif
//! Whether to use the NCS3 pin
#ifdef SMC_USE_NCS3
#include SMC_COMPONENT_CS3
// Setup SMC for NCS3
SMC_CS_SETUP(3)
#ifdef SMC_DBW_GLOBAL
#if (SMC_DBW_GLOBAL < SMC_DBW)
#undef SMC_DBW_GLOBAL
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#else
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#ifdef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS_GLOBAL < SMC_8_BIT)
#undef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#else
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#ifdef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE_GLOBAL < NWAIT_MODE)
#undef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#else
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#undef EXT_SM_SIZE
#undef SMC_DBW
#undef SMC_8_BIT_CHIPS
#undef NWE_SETUP
#undef NCS_WR_SETUP
#undef NRD_SETUP
#undef NCS_RD_SETUP
#undef NCS_WR_PULSE
#undef NWE_PULSE
#undef NCS_RD_PULSE
#undef NRD_PULSE
#undef NCS_WR_HOLD
#undef NWE_HOLD
#undef NWE_CYCLE
#undef NCS_RD_HOLD
#undef NRD_CYCLE
#undef TDF_CYCLES
#undef TDF_OPTIM
#undef PAGE_MODE
#undef PAGE_SIZE
#undef NCS_CONTROLLED_READ
#undef NCS_CONTROLLED_WRITE
#undef NWAIT_MODE
#endif
//! Whether to use the NCS4 pin
#ifdef SMC_USE_NCS4
#include SMC_COMPONENT_CS4
// Setup SMC for NCS4
SMC_CS_SETUP(4)
#ifdef SMC_DBW_GLOBAL
#if (SMC_DBW_GLOBAL < SMC_DBW)
#undef SMC_DBW_GLOBAL
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#else
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#ifdef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS_GLOBAL < SMC_8_BIT)
#undef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#else
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#ifdef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE_GLOBAL < NWAIT_MODE)
#undef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#else
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#undef EXT_SM_SIZE
#undef SMC_DBW
#undef SMC_8_BIT_CHIPS
#undef NWE_SETUP
#undef NCS_WR_SETUP
#undef NRD_SETUP
#undef NCS_RD_SETUP
#undef NCS_WR_PULSE
#undef NWE_PULSE
#undef NCS_RD_PULSE
#undef NRD_PULSE
#undef NCS_WR_HOLD
#undef NWE_HOLD
#undef NWE_CYCLE
#undef NCS_RD_HOLD
#undef NRD_CYCLE
#undef TDF_CYCLES
#undef TDF_OPTIM
#undef PAGE_MODE
#undef PAGE_SIZE
#undef NCS_CONTROLLED_READ
#undef NCS_CONTROLLED_WRITE
#undef NWAIT_MODE
#endif
//! Whether to use the NCS5 pin
#ifdef SMC_USE_NCS5
#include SMC_COMPONENT_CS5
// Setup SMC for NCS5
SMC_CS_SETUP(5)
#ifdef SMC_DBW_GLOBAL
#if (SMC_DBW_GLOBAL < SMC_DBW)
#undef SMC_DBW_GLOBAL
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#else
#if (SMC_DBW == 8)
#define SMC_DBW_GLOBAL 8
#elif (SMC_DBW == 16)
#define SMC_DBW_GLOBAL 16
#elif (SMC_DBW == 32)
#define SMC_DBW_GLOBAL 32
#else
#error error in SMC_DBW size
#endif
#endif
#ifdef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS_GLOBAL < SMC_8_BIT)
#undef SMC_8_BIT_CHIPS_GLOBAL
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#else
#if (SMC_8_BIT_CHIPS == TRUE)
#define SMC_8_BIT_CHIPS_GLOBAL TRUE
#elif (SMC_8_BIT_CHIPS == FALSE)
#define SMC_8_BIT_CHIPS_GLOBAL FALSE
#else
#error error in SMC_8_BIT_CHIPS size
#endif
#endif
#ifdef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE_GLOBAL < NWAIT_MODE)
#undef NWAIT_MODE_GLOBAL
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#else
#if (NWAIT_MODE == AVR32_SMC_EXNW_MODE_DISABLED)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_DISABLED
#elif (NWAIT_MODE == AVR32_SMC_EXNW_MODE_FROZEN)
#define NWAIT_MODE_GLOBAL AVR32_SMC_EXNW_MODE_FROZEN
#else
#error error in NWAIT_MODE size
#endif
#endif
#undef EXT_SM_SIZE
#undef SMC_DBW
#undef SMC_8_BIT_CHIPS
#undef NWE_SETUP
#undef NCS_WR_SETUP
#undef NRD_SETUP
#undef NCS_RD_SETUP
#undef NCS_WR_PULSE
#undef NWE_PULSE
#undef NCS_RD_PULSE
#undef NRD_PULSE
#undef NCS_WR_HOLD
#undef NWE_HOLD
#undef NWE_CYCLE
#undef NCS_RD_HOLD
#undef NRD_CYCLE
#undef TDF_CYCLES
#undef TDF_OPTIM
#undef PAGE_MODE
#undef PAGE_SIZE
#undef NCS_CONTROLLED_READ
#undef NCS_CONTROLLED_WRITE
#undef NWAIT_MODE
#endif
// Put the multiplexed MCU pins used for the SM under control of the SMC.
smc_enable_muxed_pins();
}
/*! \brief Puts the multiplexed MCU pins used for the SMC
*
*/
static void smc_enable_muxed_pins(void)
{
static const gpio_map_t SMC_EBI_GPIO_MAP =
{
// Enable data pins.
#ifdef EBI_DATA_0
{ATPASTE2(EBI_DATA_0,_PIN),ATPASTE2(EBI_DATA_0,_FUNCTION)},
#endif
#ifdef EBI_DATA_1
{ATPASTE2(EBI_DATA_1,_PIN),ATPASTE2(EBI_DATA_1,_FUNCTION)},
#endif
#ifdef EBI_DATA_2
{ATPASTE2(EBI_DATA_2,_PIN),ATPASTE2(EBI_DATA_2,_FUNCTION)},
#endif
#ifdef EBI_DATA_3
{ATPASTE2(EBI_DATA_3,_PIN),ATPASTE2(EBI_DATA_3,_FUNCTION)},
#endif
#ifdef EBI_DATA_4
{ATPASTE2(EBI_DATA_4,_PIN),ATPASTE2(EBI_DATA_4,_FUNCTION)},
#endif
#ifdef EBI_DATA_5
{ATPASTE2(EBI_DATA_5,_PIN),ATPASTE2(EBI_DATA_5,_FUNCTION)},
#endif
#ifdef EBI_DATA_6
{ATPASTE2(EBI_DATA_6,_PIN),ATPASTE2(EBI_DATA_6,_FUNCTION)},
#endif
#ifdef EBI_DATA_7
{ATPASTE2(EBI_DATA_7,_PIN),ATPASTE2(EBI_DATA_7,_FUNCTION)},
#endif
#ifdef EBI_DATA_8
{ATPASTE2(EBI_DATA_8,_PIN),ATPASTE2(EBI_DATA_8,_FUNCTION)},
#endif
#ifdef EBI_DATA_9
{ATPASTE2(EBI_DATA_9,_PIN),ATPASTE2(EBI_DATA_9,_FUNCTION)},
#endif
#ifdef EBI_DATA_10
{ATPASTE2(EBI_DATA_10,_PIN),ATPASTE2(EBI_DATA_10,_FUNCTION)},
#endif
#ifdef EBI_DATA_11
{ATPASTE2(EBI_DATA_11,_PIN),ATPASTE2(EBI_DATA_11,_FUNCTION)},
#endif
#ifdef EBI_DATA_12
{ATPASTE2(EBI_DATA_12,_PIN),ATPASTE2(EBI_DATA_12,_FUNCTION)},
#endif
#ifdef EBI_DATA_13
{ATPASTE2(EBI_DATA_13,_PIN),ATPASTE2(EBI_DATA_13,_FUNCTION)},
#endif
#ifdef EBI_DATA_14
{ATPASTE2(EBI_DATA_14,_PIN),ATPASTE2(EBI_DATA_14,_FUNCTION)},
#endif
#ifdef EBI_DATA_15
{ATPASTE2(EBI_DATA_15,_PIN),ATPASTE2(EBI_DATA_15,_FUNCTION)},
#endif
#ifdef EBI_DATA_16
{ATPASTE2(EBI_DATA_16,_PIN),ATPASTE2(EBI_DATA_16,_FUNCTION)},
#endif
#ifdef EBI_DATA_17
{ATPASTE2(EBI_DATA_17,_PIN),ATPASTE2(EBI_DATA_17,_FUNCTION)},
#endif
#ifdef EBI_DATA_18
{ATPASTE2(EBI_DATA_18,_PIN),ATPASTE2(EBI_DATA_18,_FUNCTION)},
#endif
#ifdef EBI_DATA_19
{ATPASTE2(EBI_DATA_19,_PIN),ATPASTE2(EBI_DATA_19,_FUNCTION)},
#endif
#ifdef EBI_DATA_20
{ATPASTE2(EBI_DATA_20,_PIN),ATPASTE2(EBI_DATA_20,_FUNCTION)},
#endif
#ifdef EBI_DATA_21
{ATPASTE2(EBI_DATA_21,_PIN),ATPASTE2(EBI_DATA_21,_FUNCTION)},
#endif
#ifdef EBI_DATA_22
{ATPASTE2(EBI_DATA_22,_PIN),ATPASTE2(EBI_DATA_22,_FUNCTION)},
#endif
#ifdef EBI_DATA_23
{ATPASTE2(EBI_DATA_23,_PIN),ATPASTE2(EBI_DATA_23,_FUNCTION)},
#endif
#ifdef EBI_DATA_24
{ATPASTE2(EBI_DATA_24,_PIN),ATPASTE2(EBI_DATA_24,_FUNCTION)},
#endif
#ifdef EBI_DATA_25
{ATPASTE2(EBI_DATA_25,_PIN),ATPASTE2(EBI_DATA_25,_FUNCTION)},
#endif
#ifdef EBI_DATA_26
{ATPASTE2(EBI_DATA_26,_PIN),ATPASTE2(EBI_DATA_26,_FUNCTION)},
#endif
#ifdef EBI_DATA_27
{ATPASTE2(EBI_DATA_27,_PIN),ATPASTE2(EBI_DATA_27,_FUNCTION)},
#endif
#ifdef EBI_DATA_28
{ATPASTE2(EBI_DATA_28,_PIN),ATPASTE2(EBI_DATA_28,_FUNCTION)},
#endif
#ifdef EBI_DATA_29
{ATPASTE2(EBI_DATA_29,_PIN),ATPASTE2(EBI_DATA_29,_FUNCTION)},
#endif
#ifdef EBI_DATA_30
{ATPASTE2(EBI_DATA_30,_PIN),ATPASTE2(EBI_DATA_30,_FUNCTION)},
#endif
#ifdef EBI_DATA_31
{ATPASTE2(EBI_DATA_31,_PIN),ATPASTE2(EBI_DATA_31,_FUNCTION)},
#endif
// Enable address pins.
#if SMC_DBW_GLOBAL <= 8
#ifdef EBI_ADDR_0
{ATPASTE2(EBI_ADDR_0,_PIN),ATPASTE2(EBI_ADDR_0,_FUNCTION)},
#endif
#endif
#if SMC_DBW_GLOBAL <= 16
#ifdef EBI_ADDR_1
{ATPASTE2(EBI_ADDR_1,_PIN),ATPASTE2(EBI_ADDR_1,_FUNCTION)},
#endif
#endif
#ifdef EBI_ADDR_2
{ATPASTE2(EBI_ADDR_2,_PIN),ATPASTE2(EBI_ADDR_2,_FUNCTION)},
#endif
#ifdef EBI_ADDR_3
{ATPASTE2(EBI_ADDR_3,_PIN),ATPASTE2(EBI_ADDR_3,_FUNCTION)},
#endif
#ifdef EBI_ADDR_4
{ATPASTE2(EBI_ADDR_4,_PIN),ATPASTE2(EBI_ADDR_4,_FUNCTION)},
#endif
#ifdef EBI_ADDR_5
{ATPASTE2(EBI_ADDR_5,_PIN),ATPASTE2(EBI_ADDR_5,_FUNCTION)},
#endif
#ifdef EBI_ADDR_6
{ATPASTE2(EBI_ADDR_6,_PIN),ATPASTE2(EBI_ADDR_6,_FUNCTION)},
#endif
#ifdef EBI_ADDR_7
{ATPASTE2(EBI_ADDR_7,_PIN),ATPASTE2(EBI_ADDR_7,_FUNCTION)},
#endif
#ifdef EBI_ADDR_8
{ATPASTE2(EBI_ADDR_8,_PIN),ATPASTE2(EBI_ADDR_8,_FUNCTION)},
#endif
#ifdef EBI_ADDR_9
{ATPASTE2(EBI_ADDR_9,_PIN),ATPASTE2(EBI_ADDR_9,_FUNCTION)},
#endif
#ifdef EBI_ADDR_10
{ATPASTE2(EBI_ADDR_10,_PIN),ATPASTE2(EBI_ADDR_10,_FUNCTION)},
#endif
#ifdef EBI_ADDR_11
{ATPASTE2(EBI_ADDR_11,_PIN),ATPASTE2(EBI_ADDR_11,_FUNCTION)},
#endif
#ifdef EBI_ADDR_12
{ATPASTE2(EBI_ADDR_12,_PIN),ATPASTE2(EBI_ADDR_12,_FUNCTION)},
#endif
#ifdef EBI_ADDR_13
{ATPASTE2(EBI_ADDR_13,_PIN),ATPASTE2(EBI_ADDR_13,_FUNCTION)},
#endif
#ifdef EBI_ADDR_14
{ATPASTE2(EBI_ADDR_14,_PIN),ATPASTE2(EBI_ADDR_14,_FUNCTION)},
#endif
#ifdef EBI_ADDR_15
{ATPASTE2(EBI_ADDR_15,_PIN),ATPASTE2(EBI_ADDR_15,_FUNCTION)},
#endif
#ifdef EBI_ADDR_16
{ATPASTE2(EBI_ADDR_16,_PIN),ATPASTE2(EBI_ADDR_16,_FUNCTION)},
#endif
#ifdef EBI_ADDR_17
{ATPASTE2(EBI_ADDR_17,_PIN),ATPASTE2(EBI_ADDR_17,_FUNCTION)},
#endif
#ifdef EBI_ADDR_18
{ATPASTE2(EBI_ADDR_18,_PIN),ATPASTE2(EBI_ADDR_18,_FUNCTION)},
#endif
#ifdef EBI_ADDR_19
{ATPASTE2(EBI_ADDR_19,_PIN),ATPASTE2(EBI_ADDR_19,_FUNCTION)},
#endif
#ifdef EBI_ADDR_20
{ATPASTE2(EBI_ADDR_20,_PIN),ATPASTE2(EBI_ADDR_20,_FUNCTION)},
#endif
#ifdef EBI_ADDR_21
{ATPASTE2(EBI_ADDR_21,_PIN),ATPASTE2(EBI_ADDR_21,_FUNCTION)},
#endif
#ifdef EBI_ADDR_22
{ATPASTE2(EBI_ADDR_22,_PIN),ATPASTE2(EBI_ADDR_22,_FUNCTION)},
#endif
#ifdef EBI_ADDR_23
{ATPASTE2(EBI_ADDR_23,_PIN),ATPASTE2(EBI_ADDR_23,_FUNCTION)},
#endif
#if SMC_DBW_GLOBAL <= 8
#undef SMC_8_BIT_CHIPS
#define SMC_8_BIT_CHIPS TRUE
#endif
// Enable data mask pins.
#if !SMC_8_BIT_CHIPS_GLOBAL
#ifdef EBI_ADDR_0
{ATPASTE2(EBI_ADDR_0,_PIN),ATPASTE2(EBI_ADDR_0,_FUNCTION)},
#endif
#endif
#ifdef EBI_NWE0
{ATPASTE2(EBI_NWE0,_PIN),ATPASTE2(EBI_NWE0,_FUNCTION)},
#endif
#if SMC_DBW_GLOBAL >= 16
#ifdef EBI_NWE1
{ATPASTE2(EBI_NWE1,_PIN),ATPASTE2(EBI_NWE1,_FUNCTION)},
#endif
#if SMC_DBW_GLOBAL >= 32
#ifdef EBI_ADDR_1
{ATPASTE2(EBI_ADDR_1,_PIN),ATPASTE2(EBI_ADDR_1,_FUNCTION)},
#endif
#ifdef EBI_NWE3
{ATPASTE2(EBI_NWE3,_PIN),ATPASTE2(EBI_NWE3,_FUNCTION)},
#endif
#endif
#endif
#ifdef EBI_NRD
{ATPASTE2(EBI_NRD,_PIN),ATPASTE2(EBI_NRD,_FUNCTION)},
#endif
// Enable control pins.
#if NWAIT_MODE_GLOBAL != AVR32_SMC_EXNW_MODE_DISABLED
#ifdef EBI_NWAIT
{ATPASTE2(EBI_NWAIT,_PIN),ATPASTE2(EBI_NWAIT,_FUNCTION)},
#endif
#endif
#ifdef SMC_USE_NCS0
#ifdef EBI_NCS_0
{ATPASTE2(EBI_NCS_0,_PIN),ATPASTE2(EBI_NCS_0,_FUNCTION)},
#endif
#endif
#ifdef SMC_USE_NCS1
#ifdef EBI_NCS_1
{ATPASTE2(EBI_NCS_1,_PIN),ATPASTE2(EBI_NCS_1,_FUNCTION)},
#endif
#endif
#ifdef SMC_USE_NCS2
#ifdef EBI_NCS_2
{ATPASTE2(EBI_NCS_2,_PIN),ATPASTE2(EBI_NCS_2,_FUNCTION)},
#endif
#endif
#ifdef SMC_USE_NCS3
#ifdef EBI_NCS_3
{ATPASTE2(EBI_NCS_3,_PIN),ATPASTE2(EBI_NCS_3,_FUNCTION)},
#endif
#endif
#ifdef SMC_USE_NCS4
#ifdef EBI_NCS_4
{ATPASTE2(EBI_NCS_4,_PIN),ATPASTE2(EBI_NCS_4,_FUNCTION)},
#endif
#endif
#ifdef SMC_USE_NCS5
#ifdef EBI_NCS_5
{ATPASTE2(EBI_NCS_5,_PIN),ATPASTE2(EBI_NCS_5,_FUNCTION)},
#endif
#endif
};
gpio_enable_module(SMC_EBI_GPIO_MAP, sizeof(SMC_EBI_GPIO_MAP) / sizeof(SMC_EBI_GPIO_MAP[0]));
}
unsigned char smc_get_cs_size(unsigned char cs)
{
return smc_tab_cs_size[cs];
}
|