-
Notifications
You must be signed in to change notification settings - Fork 48
/
projectconfig.h
1381 lines (1158 loc) · 58.3 KB
/
projectconfig.h
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
996
997
998
999
1000
/**************************************************************************/
/*!
@file projectconfig.h
@author K. Townsend (microBuilder.eu)
@section LICENSE
Software License Agreement (BSD License)
Copyright (c) 2012, microBuilder SARL
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. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
*/
/**************************************************************************/
#ifndef _PROJECTCONFIG_H_
#define _PROJECTCONFIG_H_
#include "lpc134x.h"
#include "sysdefs.h"
/*=========================================================================
BOARD SELECTION
Because several boards use this code library with sometimes slightly
different pin configuration, you will need to specify which board you
are using by enabling one of the following definitions. The code base
will then try to configure itself accordingly for that board.
CFG_BRD_LPC1343_REFDESIGN
=========================
microBuilder.eu LPC1343 Reference Design base board with
on-board peripherals initialised (EEPROM, USB or UART CLI, etc.)
This is the recommended starting point for new development
since it makes it easy to send printf output to USB CDC, access
the on-board EEPROM, etc.
CFG_BRD_LPC1343_REFDESIGN_MINIMAL
=================================
microBuilder.eu LPC1343 Reference Design base board with
only the most common peripherals initialised by default.
Results in smallest code since EEPROM, USB, etc., are not
initialised on startup. By default, only the following
peripherals are initialised by systemInit():
- CPU (Configures the PLL, etc.)
- GPIO
- SysTick Timer
- UART (with printf support) *
* Can be removed to save 0.8kb in debug and 0.3 kb in
release. Comment out 'CFG_PRINTF_UART' to disable it.
The code size can be further reduced by several KB by removing
any IRQ Handlers that are not used. The I2C IRQHandler, for
example, uses ~1KB of flash in debug and ~400KB in release mode,
but because it is referenced in the startup code it is always
included even if I2C is never used in the project.
Other IRQ Handlers that you might be able to comment out
to save some space are:
IRQ Handler Debug Release
------------------------- ------ -------
I2C_IRQHandler 1160 b 400 b
SSP_IRQHandler 160 b 76 b
UART_IRQHandler 246 b 116 b
WAKEUP_IRQHandler 160 b 100 b
WDT_IRQHandler 50 b 28 b
CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
====================================
microBuilder.eu/Adafruit Stand-Alone "Smart LCD" with USB enabled
for the CLI interface.
CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
=====================================
microBuilder.eu/Adafruit Stand-Alone "Smart LCD" with UART enabled
for the CLI interface.
CFG_BRD_LPC1343_802154USBSTICK
==============================
microBuilder.eu USB stick 802.15.4 868/915MHz RF transceiver
CFG_BRD_LPC1343_OLIMEX_P
==============================
Simple Olimex LPC1343 breakout board
CFG_BRD_LPC1343_LPCXPRESSO
==============================
LPC1343 LPCXpresso board
-----------------------------------------------------------------------*/
#define CFG_BRD_LPC1343_REFDESIGN
// #define CFG_BRD_LPC1343_REFDESIGN_MINIMAL
// #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
// #define CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
// #define CFG_BRD_LPC1343_802154USBSTICK
// #define CFG_BRD_LPC1343_OLIMEX_P
// #define CFG_BRD_LPC1343_LPCXPRESSO
/*=========================================================================*/
/**************************************************************************
PIN USAGE
-----------------------------------------------------------------------
This table tries to give an indication of which GPIO pins and
peripherals are used by the available drivers and SW examples. Only
dedicated GPIO pins available on the LPC1343 Reference Board are shown
below. Any unused peripheral blocks like I2C, SSP, ADC, etc., can
also be used as GPIO if they are available.
PORT 1 PORT 2 PORT 3
========= ================= =======
8 9 10 11 1 2 3 4 5 6 7 8 9 0 1 2 3
SDCARD . . . . . . . . . . . . . X . . .
PWM . X . . . . . . . . . . . . . . .
STEPPER . . . . . . . . . . . . . X X X X
CHIBI X X X . . . . . . . . . . . . . .
ILI9325/8 X X X X X X X X X X X X X . . . X
ST7565 X X X X X X X X X X X X X . . . X
ST7735 . . . . X X X X X X . . . . . . .
SHARPMEM . . . . X X X X . . . . . . . . .
SSD1306 SPI . . . . X X X . X X . . . . . . .
SSD1351 . . . . X X X X X . . . . . . . .
MCP121 . . . . . . . . . . . . . . X . .
PN532 [3] . . . . . . . . . . . . . . X X .
TIMERS SSP ADC UART
====================== === ======= ====
16B0 16B1 32B0 32B1 0 0 1 2 3 0
SDCARD . . . . X . . . . .
PWM . X . . . . . . . .
PMU [1] . . X . . . . . . .
USB . . . X . . . . . .
STEPPER . . X . . . . . . .
CHIBI x . . . X . . . . .
ILI9325/8 . . . . . X X X X .
ST7565 . . . . . X X X X .
ST7535 . . . . . . . . . .
SHARPMEM . . . . . . . . . .
SSD1306 SPI . . . . . . . . . .
INTERFACE . . . . . . . . . X[2]
[1] PMU uses 32-bit Timer 0 for SW wakeup from deep-sleep. This timer
can safely be used by other peripherals, but may need to be
reconfigured when you wakeup from deep-sleep.
[2] INTERFACE can be configured to use either USBCDC or UART
[3] P3.2 is only used with the I2C bus (for IRQ)
**************************************************************************/
/**************************************************************************
I2C Addresses
-----------------------------------------------------------------------
The following addresses are used by the different I2C sensors included
in the code base [1]
HEX BINARY
==== ========
ISL12022M (RTC) 0xDE 1101111x
ISL12022M (SRAM) 0xAE 1010111x
LM75B 0x90 1001000x
MCP24AA 0xA0 1010000x
MCP4725 0xC0 1100000x ***
TEA5767 0xC0 1100000x ***
TSL2561 0x72 0111001x
TCS3414 0x72 0111001x
PN532 0x48 0100100x
SSD1306_I2C 0x78 0111100x // Assumes SA0 = GND
INA219 0xF0 10000000x // Assumes A0+A1 = GND
[1] Alternative addresses may exists, but the addresses listed in this
table are the values used in the code base
**************************************************************************/
/*=========================================================================
FIRMWARE VERSION SETTINGS
-----------------------------------------------------------------------*/
#define CFG_FIRMWARE_VERSION_MAJOR (1)
#define CFG_FIRMWARE_VERSION_MINOR (1)
#define CFG_FIRMWARE_VERSION_REVISION (0)
/*=========================================================================*/
/*=========================================================================
CORE CPU SETTINGS
-----------------------------------------------------------------------
CFG_CPU_CCLK Value is for reference only. 'core/cpu/cpu.c' must
be modified to change the clock speed, but the value
should be indicated here since CFG_CPU_CCLK is used by
other peripherals to determine timing.
-----------------------------------------------------------------------*/
#define CFG_CPU_CCLK (72000000) // 1 tick = 13.88nS
/*=========================================================================*/
/*=========================================================================
SYSTICK TIMER
-----------------------------------------------------------------------
CFG_SYSTICK_DELAY_IN_MS The number of milliseconds between each tick
of the systick timer.
-----------------------------------------------------------------------*/
#define CFG_SYSTICK_DELAY_IN_MS (1)
/*=========================================================================*/
/*=========================================================================
GPIO INTERRUPTS
-----------------------------------------------------------------------
IF you wish to use the GPIO interrupt handlers elsewhere in your code,
you should probably define a seperate IRQHandler for the appropriate
GPIO bank rather than using the definitions in core/gpio/gpio.c (to
avoid causing problems in other projects, and to make updates easier,
etc.) To disable the default IRQHandler, simply comment out the
define below for the appropriate GPIO bank and implement the handler
somewhere else.
GPIO_ENABLE_IRQ0 If defined, PIOINT0_IRQHandler will be declared and
handled in core/gpio/gpio.c
GPIO_ENABLE_IRQ1 If defined, PIOINT1_IRQHandler will be declared and
handled in core/gpio/gpio.c
GPIO_ENABLE_IRQ2 If defined, PIOINT2_IRQHandler will be declared and
handled in core/gpio/gpio.c
GPIO_ENABLE_IRQ3 If defined, PIOINT3_IRQHandler will be declared and
handled in core/gpio/gpio.c
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
// #define GPIO_ENABLE_IRQ0
#define GPIO_ENABLE_IRQ1
// #define GPIO_ENABLE_IRQ2
// #define GPIO_ENABLE_IRQ3
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
// #define GPIO_ENABLE_IRQ0
#define GPIO_ENABLE_IRQ1
// #define GPIO_ENABLE_IRQ2
// #define GPIO_ENABLE_IRQ3
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
// #define GPIO_ENABLE_IRQ0
#define GPIO_ENABLE_IRQ1
// #define GPIO_ENABLE_IRQ2
// #define GPIO_ENABLE_IRQ3
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
// #define GPIO_ENABLE_IRQ0
#define GPIO_ENABLE_IRQ1
// #define GPIO_ENABLE_IRQ2
// #define GPIO_ENABLE_IRQ3
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
// #define GPIO_ENABLE_IRQ0
#define GPIO_ENABLE_IRQ1
// #define GPIO_ENABLE_IRQ2
// #define GPIO_ENABLE_IRQ3
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
// #define GPIO_ENABLE_IRQ0
#define GPIO_ENABLE_IRQ1
// #define GPIO_ENABLE_IRQ2
// #define GPIO_ENABLE_IRQ3
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
// #define GPIO_ENABLE_IRQ0
#define GPIO_ENABLE_IRQ1
// #define GPIO_ENABLE_IRQ2
// #define GPIO_ENABLE_IRQ3
#endif
/*=========================================================================*/
/*=========================================================================
ALTERNATE RESET PIN
-----------------------------------------------------------------------
CFG_ALTRESET If defined, indicates that a GPIO pin should be
configured as an alternate reset pin in addition
to the dedicated reset pin.
CFG_ALTRESET_PORT The GPIO port where the alt reset pin is located
CFG_ALTRESET_PIN The GPIO pin where the alt reset pin is located
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_ALTRESET
#define CFG_ALTRESET_PORT (1)
#define CFG_ALTRESET_PIN (5) // P1.5 = RTS
#endif
/*=========================================================================*/
/*=========================================================================
UART
-----------------------------------------------------------------------
CFG_UART_BAUDRATE The default UART speed. This value is used
when initialising UART, and should be a
standard value like 57600, 9600, etc.
NOTE: This value may be overridden if
another value is stored in EEPROM!
CFG_UART_BUFSIZE The length in bytes of the UART RX FIFO. This
will determine the maximum number of received
characters to store in memory.
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
#define CFG_UART_BAUDRATE (115200)
#define CFG_UART_BUFSIZE (512)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
#define CFG_UART_BAUDRATE (115200)
#define CFG_UART_BUFSIZE (512)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
#define CFG_UART_BAUDRATE (115200)
#define CFG_UART_BUFSIZE (512)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_UART_BAUDRATE (57600)
#define CFG_UART_BUFSIZE (512)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
#define CFG_UART_BAUDRATE (115200)
#define CFG_UART_BUFSIZE (512)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
#define CFG_UART_BAUDRATE (115200)
#define CFG_UART_BUFSIZE (512)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
#define CFG_UART_BAUDRATE (115200)
#define CFG_UART_BUFSIZE (512)
#endif
/*=========================================================================*/
/*=========================================================================
SSP
-----------------------------------------------------------------------
CFG_SSP0_SCKPIN_2_11 Indicates which pin should be used for SCK0
CFG_SSP0_SCKPIN_0_6
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
#define CFG_SSP0_SCKPIN_2_11
// #define CFG_SSP0_SCKPIN_0_6
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
#define CFG_SSP0_SCKPIN_2_11
// #define CFG_SSP0_SCKPIN_0_6
#endif
#if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_SSP0_SCKPIN_2_11
// #define CFG_SSP0_SCKPIN_0_6
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
// #define CFG_SSP0_SCKPIN_2_11
#define CFG_SSP0_SCKPIN_0_6
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
#define CFG_SSP0_SCKPIN_2_11
// #define CFG_SSP0_SCKPIN_0_6
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
#define CFG_SSP0_SCKPIN_2_11
// #define CFG_SSP0_SCKPIN_0_6
#endif
/*=========================================================================*/
/*=========================================================================
ADC
-----------------------------------------------------------------------
ADC_AVERAGING_ENABLE To get better results, the ADC code can take
a number of samples and return the average
value. This is slower, but can give more
accurate results compared to single-reading.
To enable averaging, set ADC_AVERAGING_ENABLE
to a non-zero value.
ADC_AVERAGING_SAMPLES The number of ADC samples to read and
average if ADC averaging is enabled.
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
#define ADC_AVERAGING_ENABLE (1)
#define ADC_AVERAGING_SAMPLES (5)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
#define ADC_AVERAGING_ENABLE (1)
#define ADC_AVERAGING_SAMPLES (5)
#endif
#if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define ADC_AVERAGING_ENABLE (0)
#define ADC_AVERAGING_SAMPLES (5)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
#define ADC_AVERAGING_ENABLE (0)
#define ADC_AVERAGING_SAMPLES (5)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
#define ADC_AVERAGING_ENABLE (0)
#define ADC_AVERAGING_SAMPLES (5)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
#define ADC_AVERAGING_ENABLE (0)
#define ADC_AVERAGING_SAMPLES (5)
#endif
/*=========================================================================*/
/*=========================================================================
ON-BOARD LED
-----------------------------------------------------------------------
CFG_LED_PORT The port for the on board LED
CFG_LED_PIN The pin for the on board LED
CFG_LED_ON The pin state to turn the LED on (0 = low, 1 = high)
CFG_LED_OFF The pin state to turn the LED off (0 = low, 1 = high)
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
#define CFG_LED_PORT (2)
#define CFG_LED_PIN (10)
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
#define CFG_LED_PORT (2)
#define CFG_LED_PIN (10)
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
#endif
#if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_LED_PORT (2)
#define CFG_LED_PIN (10)
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
#define CFG_LED_PORT (3)
#define CFG_LED_PIN (2)
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
#define CFG_LED_PORT (3)
#define CFG_LED_PIN (2)
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
#define CFG_LED_PORT (0)
#define CFG_LED_PIN (7)
#define CFG_LED_ON (0)
#define CFG_LED_OFF (1)
#endif
/*=========================================================================*/
/*=========================================================================
MICRO-SD CARD
-----------------------------------------------------------------------
CFG_SDCARD If this field is defined SD Card and FAT32
file system support will be included
CFG_SDCARD_READONLY If this is set to 1, all commands to
write to the SD card will be removed
saving some flash space.
CFG_SDCARD_CDPORT The card detect port number
CFG_SDCARD_CDPIN The card detect pin number
NOTE: All config settings for FAT32 are defined
in ffconf.h
BENCHMARK: With SPI set to 6.0MHz, FATFS can read
~300KB/s (w/512 byte read buffer)
PIN LAYOUT: The pin layout that is used by this driver
can be seen in the following schematic:
/tools/schematics/Breakout_TFTLCD_ILI9325_v1.3
DEPENDENCIES: SDCARD requires the use of SSP0.
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
// #define CFG_SDCARD
#define CFG_SDCARD_READONLY (1) // Must be 0 or 1
#define CFG_SDCARD_CDPORT (3)
#define CFG_SDCARD_CDPIN (0)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
// #define CFG_SDCARD
#define CFG_SDCARD_READONLY (1) // Must be 0 or 1
#define CFG_SDCARD_CDPORT (3)
#define CFG_SDCARD_CDPIN (0)
#endif
#if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_SDCARD
#define CFG_SDCARD_READONLY (1) // Must be 0 or 1
#define CFG_SDCARD_CDPORT (3)
#define CFG_SDCARD_CDPIN (0)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
// #define CFG_SDCARD
#define CFG_SDCARD_READONLY (1) // Must be 0 or 1
#define CFG_SDCARD_CDPORT (3)
#define CFG_SDCARD_CDPIN (0)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
// #define CFG_SDCARD
#define CFG_SDCARD_READONLY (1) // Must be 0 or 1
#define CFG_SDCARD_CDPORT (3)
#define CFG_SDCARD_CDPIN (0)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
// #define CFG_SDCARD
#define CFG_SDCARD_READONLY (1) // Must be 0 or 1
#define CFG_SDCARD_CDPORT (3)
#define CFG_SDCARD_CDPIN (0)
#endif
/*=========================================================================*/
/*=========================================================================
USB
-----------------------------------------------------------------------
CFG_USBHID If this field is defined USB HID support will
be included. Currently uses ROM-based USB HID
CFG_USBCDC If this field is defined USB CDC support will
be included, with the USB Serial Port speed
set to 115200 BPS by default
CFG_USBCDC_BAUDRATE The default TX/RX speed. This value is used
when initialising USBCDC, and should be a
standard value like 57600, 9600, etc.
CFG_USBCDC_INITTIMEOUT The maximum delay in milliseconds to wait for
USB to connect. Must be a multiple of 10!
CFG_USBCDC_BUFFERSIZE Size of the buffer (in bytes) that stores
printf data until it can be sent out in
64 byte frames. The buffer is required since
only one frame per ms can be sent using USB
CDC (see 'puts' in systeminit.c).
-----------------------------------------------------------------------*/
#define CFG_USB_VID (0x239A)
#define CFG_USB_PID (0x1002)
#ifdef CFG_BRD_LPC1343_REFDESIGN
// #define CFG_USBHID
#define CFG_USBCDC
#define CFG_USBCDC_BAUDRATE (115200)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
// #define CFG_USBHID
// #define CFG_USBCDC
#define CFG_USBCDC_BAUDRATE (115200)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
// #define CFG_USBHID
#define CFG_USBCDC
#define CFG_USBCDC_BAUDRATE (115200)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
// #define CFG_USBHID
// #define CFG_USBCDC
#define CFG_USBCDC_BAUDRATE (57600)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
// #define CFG_USBHID
#define CFG_USBCDC
#define CFG_USBCDC_BAUDRATE (115200)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
// #define CFG_USBHID
#define CFG_USBCDC
#define CFG_USBCDC_BAUDRATE (115200)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
// #define CFG_USBHID
#define CFG_USBCDC
#define CFG_USBCDC_BAUDRATE (115200)
#define CFG_USBCDC_INITTIMEOUT (5000)
#define CFG_USBCDC_BUFFERSIZE (256)
#endif
/*=========================================================================*/
/*=========================================================================
PRINTF REDIRECTION
-----------------------------------------------------------------------
CFG_PRINTF_MAXSTRINGSIZE Maximum size of string buffer for printf
CFG_PRINTF_UART Will cause all printf statements to be
redirected to UART
CFG_PRINTF_USBCDC Will cause all printf statements to be
redirect to USB Serial
CFG_PRINTF_NEWLINE This is typically "\r\n" for Windows or
"\n" for *nix
Note: If no printf redirection definitions are present, all printf
output will be ignored.
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
#define CFG_PRINTF_MAXSTRINGSIZE (255)
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\r\n"
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
#define CFG_PRINTF_MAXSTRINGSIZE (255)
#define CFG_PRINTF_UART
// #define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\r\n"
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
#define CFG_PRINTF_MAXSTRINGSIZE (255)
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\r\n"
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_PRINTF_MAXSTRINGSIZE (255)
#define CFG_PRINTF_UART
// #define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\n"
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
#define CFG_PRINTF_MAXSTRINGSIZE (255)
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\r\n"
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
#define CFG_PRINTF_MAXSTRINGSIZE (255)
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\r\n"
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
#define CFG_PRINTF_MAXSTRINGSIZE (255)
// #define CFG_PRINTF_UART
#define CFG_PRINTF_USBCDC
#define CFG_PRINTF_NEWLINE "\r\n"
#endif
/*=========================================================================*/
/*=========================================================================
COMMAND LINE INTERFACE
-----------------------------------------------------------------------
CFG_INTERFACE If this field is defined the UART or USBCDC
based command-line interface will be included
CFG_INTERFACE_MAXMSGSIZE The maximum number of bytes to accept for an
incoming command
CFG_INTERFACE_PROMPT The command prompt to display at the start
of every new data entry line
CFG_INTERFACE_SILENTMODE If this is set to 1 only text generated in
response to commands will be send to the
output buffer. The command prompt will not
be displayed and incoming text will not be
echoed back to the output buffer (allowing
you to see the text you have input). This
is normally only desirable in a situation
where another MCU is communicating with
the LPC1343.
CFG_INTERFACE_DROPCR If this is set to 1 all incoming \r
characters will be dropped
CFG_INTERFACE_ENABLEIRQ If this is set to 1 the IRQ pin will be
set high when a command starts executing
and will go low when the command has
finished executing or the LCD is not busy.
This allows another device to know when a
new command can safely be sent.
CFG_INTERFACE_IRQPORT The gpio port for the IRQ/busy pin
CFG_INTERFACE_IRQPIN The gpio pin number for the IRQ/busy pin
CFG_INTERFACE_SHORTERRORS If this is enabled only short 1 character
error messages will be returned (followed
by CFG_PRINTF_NEWLINE), rather than more
verbose error messages. The specific
characters used are defined below.
CFG_INTERFACE_CONFIRMREADY If this is set to 1 a text confirmation
will be sent when the command prompt is
ready for a new command. This is in
addition to CFG_INTERFACE_ENABLEIRQ if
this is also enabled. The character used
is defined below.
CFG_INTERFACE_LONGSYSINFO If this is set to 1 extra information will
be included in the Sys Info ('V') command
on the CLI. This can be useful when trying
to debug problems on remote HW, or with
unknown firmware. It will also use about
0.5KB flash, though, so only enable it is
necessary.
NOTE: The command-line interface will use either
USB-CDC or UART depending on whether
CFG_PRINTF_UART or CFG_PRINTF_USBCDC are
selected.
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
#define CFG_INTERFACE
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "LPC1343 >> "
#define CFG_INTERFACE_SILENTMODE (0)
#define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
#define CFG_INTERFACE_IRQPORT (0)
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
// #define CFG_INTERFACE
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "LPC1343 >> "
#define CFG_INTERFACE_SILENTMODE (0)
#define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
#define CFG_INTERFACE_IRQPORT (0)
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB
#define CFG_INTERFACE
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "CMD >> "
#define CFG_INTERFACE_SILENTMODE (0)
#define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
#define CFG_INTERFACE_IRQPORT (0)
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND "?"
#define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS ">"
#define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS "<"
#define CFG_INTERFACE_CONFIRMREADY_TEXT "."
#define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_INTERFACE
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT ">>"
#define CFG_INTERFACE_SILENTMODE (1)
#define CFG_INTERFACE_DROPCR (1)
#define CFG_INTERFACE_ENABLEIRQ (1)
#define CFG_INTERFACE_IRQPORT (0)
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (1)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_SHORTERRORS_UNKNOWNCOMMAND "?"
#define CFG_INTERFACE_SHORTERRORS_TOOMANYARGS ">"
#define CFG_INTERFACE_SHORTERRORS_TOOFEWARGS "<"
#define CFG_INTERFACE_CONFIRMREADY_TEXT "."
#define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
// #define CFG_INTERFACE
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "CMD >> "
#define CFG_INTERFACE_SILENTMODE (0)
#define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
#define CFG_INTERFACE_IRQPORT (0)
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
#define CFG_INTERFACE
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "LPC-P1343 >> "
#define CFG_INTERFACE_SILENTMODE (0)
#define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
#define CFG_INTERFACE_IRQPORT (0)
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_LONGSYSINFO (0)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
#define CFG_INTERFACE
#define CFG_INTERFACE_MAXMSGSIZE (256)
#define CFG_INTERFACE_PROMPT "LPC-P1343 >> "
#define CFG_INTERFACE_SILENTMODE (0)
#define CFG_INTERFACE_DROPCR (0)
#define CFG_INTERFACE_ENABLEIRQ (0)
#define CFG_INTERFACE_IRQPORT (0)
#define CFG_INTERFACE_IRQPIN (7)
#define CFG_INTERFACE_SHORTERRORS (0)
#define CFG_INTERFACE_CONFIRMREADY (0)
#define CFG_INTERFACE_LONGSYSINFO (0)
#endif
/*=========================================================================*/
/*=========================================================================
PWM SETTINGS
-----------------------------------------------------------------------
CFG_PWM If this is defined, a basic PWM driver
will be included using 16-bit Timer 1 and
Pin 1.9 (MAT0) for the PWM output. In
order to allow for a fixed number of
pulses to be generated, some PWM-specific
code is required in the 16-Bit Timer 1
ISR. See "core/timer16/timer16.c" for
more information.
CFG_PWM_DEFAULT_PULSEWIDTH The default pulse width in ticks
CFG_PWM_DEFAULT_DUTYCYCLE The default duty cycle in percent
DEPENDENCIES: PWM output requires the use of 16-bit
timer 1 and pin 1.9 (CT16B1_MAT0).
-----------------------------------------------------------------------*/
// #define CFG_PWM
#define CFG_PWM_DEFAULT_PULSEWIDTH (CFG_CPU_CCLK / 1000)
#define CFG_PWM_DEFAULT_DUTYCYCLE (50)
/*=========================================================================*/
/*=========================================================================
STEPPER MOTOR SETTINGS
-----------------------------------------------------------------------
CFG_STEPPER If this is defined, a simple bi-polar
stepper motor will be included for common
H-bridge chips like the L293D or SN754410N
DEPENDENCIES: STEPPER requires the use of pins 3.0-3 and
32-bit Timer 0.
-----------------------------------------------------------------------*/
// #define CFG_STEPPER
/*=========================================================================*/
/*=========================================================================
EEPROM
-----------------------------------------------------------------------
CFG_I2CEEPROM If defined, drivers for the onboard EEPROM
will be included during build
CFG_I2CEEPROM_SIZE The number of bytes available on the EEPROM
-----------------------------------------------------------------------*/
#ifdef CFG_BRD_LPC1343_REFDESIGN
#define CFG_I2CEEPROM
#define CFG_I2CEEPROM_SIZE (3072)
#endif
#ifdef CFG_BRD_LPC1343_REFDESIGN_MINIMAL
// #define CFG_I2CEEPROM
#define CFG_I2CEEPROM_SIZE (3072)
#endif
#if defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_USB || defined CFG_BRD_LPC1343_TFTLCDSTANDALONE_UART
#define CFG_I2CEEPROM
#define CFG_I2CEEPROM_SIZE (3072)
#endif
#ifdef CFG_BRD_LPC1343_802154USBSTICK
#define CFG_I2CEEPROM
#define CFG_I2CEEPROM_SIZE (3072)
#endif
#ifdef CFG_BRD_LPC1343_OLIMEX_P
// #define CFG_I2CEEPROM
#define CFG_I2CEEPROM_SIZE (3072)
#endif
#ifdef CFG_BRD_LPC1343_LPCXPRESSO
// #define CFG_I2CEEPROM
#define CFG_I2CEEPROM_SIZE (3072)
#endif
/*=========================================================================*/
/*=========================================================================
EEPROM MEMORY MAP
-----------------------------------------------------------------------
EEPROM is used to persist certain user modifiable values to make
sure that these changes remain in effect after a reset or hard
power-down. The addresses in EEPROM for these various system
settings/values are defined below. The first 256 bytes of EEPROM
are reserved for this (0x0000..0x00FF).
CFG_EEPROM_RESERVED The last byte of reserved EEPROM memory
EEPROM Address (0x0000..0x00FF)
===============================