-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfig_def.h
1253 lines (976 loc) · 33.3 KB
/
config_def.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
// ****************************************************************************
//
// Default Library Configuration
//
// ****************************************************************************
// PicoLibSDK - Alternative SDK library for Raspberry Pico and RP2040
// Copyright (c) 2023 Miroslav Nemecek, Panda38@seznam.cz, hardyplotter2@gmail.com
// https://github.com/Panda381/PicoLibSDK
// https://www.breatharian.eu/hw/picolibsdk/index_en.html
// https://github.com/pajenicko/picopad
// https://picopad.eu/en/
// License:
// This source code is freely available for any purpose, including commercial.
// It is possible to take and modify the code or parts of it, without restriction.
/*
Default system resources
------------------------
DMA 10 and 11 are reserved for temporary operations (DMA_MemCopy, CrcxxDMA),
but they can be used temporary by user program, too. Search: UARTSAMPLE_TXDMA,
UARTSAMPLE_RXDMA, DMA_TEMP_CHAN.
DMA channels 8 and 9 are used by miniVGA library.
DMA channels 2 to 7 are used by DVI (HDMI) library.
PIO1 is used by miniVGA and DVI (HDMI) library.
Hardware interpolators are used when drawing to canvas (DRAW_HWINTER_INX) and
by VGA driver rendering service.
*/
#ifndef _CONFIG_DEF_H
#define _CONFIG_DEF_H
/* Options from command line:
RP2040 // 1=use MCU RP2040
RP2350 // 1=use MCU RP235xx
RP2350A // 1=use MCU RP235xA (60 pin)
RP2350B // 1=use MCU RP235xB (80 pin)
FLASHSIZE // Flash size in bytes (2 MB, 4 MB, 8 MB, 16 MB)
RAMSIZE // RAM base size in bytes (256 KB or 512 KB)
*/
// ----------------------------------------------------------------------------
// Device custom configutation
// ----------------------------------------------------------------------------
#if USE_DEMOVGA // use DemoVGA device configuration
#include "_devices/demovga/_config.h"
#endif
#if USE_PICOTRON // use Picotron device configuration
#include "_devices/picotron/_config.h"
#endif
#if USE_PICOINO // use Picoino device configuration
#include "_devices/picoino/_config.h"
#endif
#if USE_PICOPAD // use PicoPad device configuration
#include "_devices/picopad/_config.h"
#endif
#if USE_PICO // use Pico device configuration
#include "_devices/pico/_config.h"
#endif
#if USE_PC
#define ASM64 1 // 1 = use assembler x64 optimization, if available
#endif
#ifndef USE_SCREENSHOT // use screen shots
#define USE_SCREENSHOT 0 // use screen shots
#endif
// ----------------------------------------------------------------------------
// Spinlock resources
// ----------------------------------------------------------------------------
// Timer spinlock
#ifndef PICO_SPINLOCK_ID_TIMER
#define PICO_SPINLOCK_ID_TIMER 14 // timer spinlock
#endif
// SpinLock for printf function
#ifndef PRINTF_SPIN
#define PRINTF_SPIN 15 // printf spinlock
#endif
// Spinlocks 16 to 21 can be allocated by the SpinNextStriped() function
// - striped spinlocks (indexed with round robin)
#ifndef PICO_SPINLOCK_ID_STRIPED_FIRST
#define PICO_SPINLOCK_ID_STRIPED_FIRST 16 // first striped spinlock
#endif
#ifndef PICO_SPINLOCK_ID_STRIPED_LAST
#define PICO_SPINLOCK_ID_STRIPED_LAST 21 // last striped spinlock
#endif
// Spinlocks 22 to 27 can be allocated by the SpinClaimFree() function (auto-claimed spinlocks)
#ifndef PICO_SPINLOCK_ID_CLAIM_FREE_FIRST
#define PICO_SPINLOCK_ID_CLAIM_FREE_FIRST 22 // first free spinlock
#endif
#ifndef PICO_SPINLOCK_ID_CLAIM_FREE_LAST
#define PICO_SPINLOCK_ID_CLAIM_FREE_LAST 27 // last free spinlock
#endif
// Spinlocks 28 and 29 are used by UART test sample and by USART stdio. Search:
// UARTSAMPLE_TXSPIN, UARTSAMPLE_RXSPIN, UART_STDIO_TXSPIN, UART_STDIO_RXSPIN.
#ifndef UART_STDIO_TXSPIN
#define UART_STDIO_TXSPIN 28 // transmitter spinlock 0..31 (-1 = not used)
#endif
#ifndef UARTSAMPLE_TXSPIN
#define UARTSAMPLE_TXSPIN 28 // transmitter spinlock 0..31 (-1 = not used)
#endif
#ifndef UART_STDIO_RXSPIN
#define UART_STDIO_RXSPIN 29 // receiver spinlock 0..31 (-1 = not used)
#endif
#ifndef UARTSAMPLE_RXSPIN
#define UARTSAMPLE_RXSPIN 29 // receiver spinlock 0..31 (-1 = not used)
#endif
// Spinlock 30 is used by USB driver. Search USB_SPIN.
#ifndef USB_SPIN
#define USB_SPIN 30 // USB spinlock, -1=do not use (ring buffer, event buffer, claim endpoints)
#endif
// Spinlock 31 is used by system memory allocator, safe integer etc. Search SYS_SPIN.
#ifndef SYS_SPIN
#define SYS_SPIN 31 // system spinlock (memory allocator, safe integer etc.; -1 = not used)
#endif
// ----------------------------------------------------------------------------
// SDK modules, folder _sdk (1=use, 0=do not use)
// ----------------------------------------------------------------------------
#ifndef USE_ORIGSDK
#define USE_ORIGSDK 1 // include interface of original-SDK
#endif
#ifndef USE_ADC
#define USE_ADC 1 // use ADC controller (sdk_adc.c, sdk_adc.h)
#endif
#ifndef USE_DMA
#define USE_DMA 1 // use DMA controller (sdk_dma.c, sdk_dma.h)
#endif
#ifndef USE_DOUBLE
#define USE_DOUBLE 1 // use Double-floating point 1=in RAM, 2=in Flash (sdk_double.c, sdk_double_asm.S, sdk_double.h)
#endif
#ifndef USE_FATALERROR
#define USE_FATALERROR 0 // use fatal error message 0=no, 1=display LCD message (sdk_fatal.c, sdk_fatal.h)
#endif
#ifndef USE_FIFO
#define USE_FIFO 1 // use Inter-core FIFO (sdk_fifo.c, sdk_fifo.h)
#endif
#ifndef USE_FLASH
#define USE_FLASH 1 // use Flash memory programming (sdk_flash.c, sdk_flash.h)
#endif
#ifndef USE_FLOAT
#define USE_FLOAT 1 // use Single-floating point 1=in RAM, 2=in Flash (sdk_float.c, sdk_float_asm.S, sdk_float.h)
#endif
#ifndef USE_GPIOCOPROC
#if RISCV || RP2040
#define USE_GPIOCOPROC 0 // use GPIO coprocessor (only RP2350 ARM; sdk_gpio_coproc.h)
#else
#define USE_GPIOCOPROC 1 // use GPIO coprocessor (only RP2350 ARM; sdk_gpio_coproc.h)
#endif
#endif
#ifndef USE_HSTX
#define USE_HSTX 1 // use HSTX (sdk_hstx.c, sdk_hstx.h)
#endif
#ifndef USE_I2C
#define USE_I2C 1 // use I2C interface (sdk_i2c.c, sdk_i2c.h)
#endif
#ifndef USE_INTERP
#define USE_INTERP 1 // use interpolator (sdk_interp.c, sdk_interp.h)
#endif
#ifndef USE_IRQ
#define USE_IRQ 1 // use IRQ interrupts (sdk_irq.c, sdk_irq.h)
#endif
#ifndef USE_MULTICORE
#define USE_MULTICORE 1 // use Multicore (sdk_multicore.c, sdk_multicore.h)
#endif
#ifndef USE_PIO
#define USE_PIO 1 // use PIO (sdk_pio.c, sdk_pio.h)
#endif
#ifndef USE_PLL
#define USE_PLL 1 // use PLL phase-locked loop (sdk_pll.c, sdk_pll.h)
#endif
#ifndef USE_PWM
#define USE_PWM 1 // use PWM (sdk_pwm.c, sdk_pwm.h)
#endif
#ifndef USE_ROSC
#define USE_ROSC 1 // use ROSC ring oscillator (sdk_rosc.c, sdk_rosc.h)
#endif
#ifndef USE_RTC
#define USE_RTC 1 // use RTC Real-time clock (sdk_rtc.c, sdk_rtc.h)
#endif
#ifndef USE_SHA256
#define USE_SHA256 1 // use SHA-256 accelerator (sdk_sha256.c, sdk_sha256.h)
#endif
#ifndef USE_SPI
#define USE_SPI 1 // use SPI interface (sdk_spi.c, sdk_spi.h)
#endif
#ifndef USE_SPINLOCK
#define USE_SPINLOCK 1 // use Spinlock (sdk_spinlock.c, sdk_spinlock.h)
#endif
#ifndef USE_SYSTICK
#define USE_SYSTICK 1 // use SysTick system timer (sdk_systick.c, sdk_systick.h)
#endif
#ifndef USE_TIMER
#define USE_TIMER 1 // use Timer with alarm (sdk_timer.c, sdk_timer.h)
#endif
#ifndef USE_TMDS
#define USE_TMDS 1 // use TMDS encoder (sdk_tmds.h)
#endif
#ifndef USE_TRNG
#define USE_TRNG 1 // use TRNG true random number generator (sdk_trng.h)
#endif
#ifndef USE_UART
#define USE_UART 1 // use UART serial port (sdk_uart.c, sdk_uart.h)
#endif
#ifndef USE_USBPAD
#define USE_USBPAD 0 // simulate keypad with USB keyboard
#endif
#ifndef USE_USBPORT
#define USE_USBPORT 0 // use USB Mini-Port (sdk_usbport.c, sdk_usbport.h)
#endif
#ifndef USE_USB_STDIO
#define USE_USB_STDIO 0 // use USB stdio (UsbPrint function)
#endif
#ifndef USE_UART_STDIO
#define USE_UART_STDIO 0 // use UART stdio (UartPrint function)
#endif
#ifndef USE_DRAW_STDIO
#define USE_DRAW_STDIO 0 // use DRAW stdio (DrawPrint function)
#endif
#ifndef USE_USB
#define USE_USB 0 // use USB (sdk_usb_*.c, sdk_usb_*.h) (only if not using TinyUSB library)
#endif
#ifndef USE_USB_DEV
#define USE_USB_DEV 0 // use USB Device Class Driver (sdk_usb_dev.c, sdk_usb_dev.h)
#endif
#ifndef USE_USB_DEV_AUDIO
#define USE_USB_DEV_AUDIO 0 // use USB AUDIO Audio device, value = number of interfaces (device)
#endif
#ifndef USE_USB_DEV_BTH
#define USE_USB_DEV_BTH 0 // use USB BTH Bluetooth (device)
#endif
#ifndef USE_USB_DEV_CDC
#define USE_USB_DEV_CDC 0 // use USB CDC Communication Device Class, value = number of interfaces (device)
#endif
#ifndef USE_USB_DEV_DFU
#define USE_USB_DEV_DFU 0 // use USB DFU-RT Device Firmware Upgrade (device)
#endif
#ifndef USE_USB_DEV_HID
#define USE_USB_DEV_HID 0 // use USB HID Human Interface Device, value = number of interfaces (device)
#endif
#ifndef USE_USB_DEV_MIDI
#define USE_USB_DEV_MIDI 0 // use USB MIDI Midi device, value = number of interfaces (device)
#endif
#ifndef USE_USB_DEV_MSC
#define USE_USB_DEV_MSC 0 // use USB MSC Mass Storage Class (device)
#endif
#ifndef USE_USB_DEV_NET
#define USE_USB_DEV_NET 0 // use USB NET Network adapter (device)
#endif
#ifndef USE_USB_DEV_TMC
#define USE_USB_DEV_TMC 0 // use USB TMC Test and Measurement Class (device)
#endif
#ifndef USE_USB_DEV_VENDOR
#define USE_USB_DEV_VENDOR 0 // use USB VENDOR Vendor specific device, value = number of interfaces (device)
#endif
#ifndef USE_USB_DEV_VIDEO
#define USE_USB_DEV_VIDEO 0 // use USB VIDEO Video device, value = number of interfaces (device)
#endif
#ifndef USE_USB_HOST
#define USE_USB_HOST 0 // use USB Host Class Driver (sdk_usb_host.c, sdk_usb_host.h; value = number of devices without HUB devices)
#endif
#ifndef USE_USB_HOST_CDC
#define USE_USB_HOST_CDC 0 // use USB CDC Communication Device Class, value = number of interfaces (host)
#endif
#ifndef USE_USB_HOST_HID
#define USE_USB_HOST_HID 0 // use USB HID Human Interface Device, value = number of interfaces (host)
#endif
#ifndef USE_USB_HOST_HUB
#define USE_USB_HOST_HUB 0 // use USB HUB (host; value = number of HUBs)
#endif
#ifndef USE_USB_HOST_MSC
#define USE_USB_HOST_MSC 0 // use USB MSC Mass Storage Class (host)
#endif
#ifndef USE_USB_HOST_VENDOR
#define USE_USB_HOST_VENDOR 0 // use USB VENDOR Vendor specific device (host)
#endif
#ifndef USE_WATCHDOG
#define USE_WATCHDOG 1 // use Watchdog timer (sdk_watchdog.c, sdk_watchdog.h)
#endif
#ifndef USE_XOSC
#define USE_XOSC 1 // use XOSC crystal oscillator (sdk_xosc.c, sdk_xosc.h)
#endif
// ----------------------------------------------------------------------------
// Library modules, folder _lib (1=use, 0=do not use)
// ----------------------------------------------------------------------------
#ifndef USE_ALARM
#define USE_ALARM 1 // use SysTick alarm (lib_alarm.c, lib_alarm.h)
#endif
#ifndef USE_CALENDAR
#define USE_CALENDAR 1 // use 32-bit calendar (lib_calendar.c, lib_calendar.h)
#endif
#ifndef USE_CALENDAR64
#define USE_CALENDAR64 1 // use 64-bit calendar (lib_calendar64.c, lib_calendar64.h)
#endif
#ifndef USE_CANVAS
#define USE_CANVAS 1 // use Canvas (lib_canvas.c, lib_canvas.h)
#endif
#ifndef USE_COLOR
#define USE_COLOR 1 // use color vector (lib_color.c, lib_color.h)
#endif
#ifndef USE_CONFIG
#define USE_CONFIG 1 // use device configuration (lib_config.c, lib_config.h)
#endif
#ifndef USE_CRC
#define USE_CRC 1 // use CRC Check Sum (lib_crc.c, lib_crc.h)
#endif
#ifndef USE_DECNUM
#define USE_DECNUM 1 // use DecNum (decnum.c, decnum.h)
#endif
#ifndef USE_DRAW
#define USE_DRAW 0 // use drawing to frame buffer (lib_draw.c, lib_draw.h)
#endif
#ifndef USE_ESCPKT
#define USE_ESCPKT 1 // use escape packet protocol (lib_escpkt.c, lib_escpkt.h)
#endif
#ifndef USE_EVENT
#define USE_EVENT 1 // use Event Ring buffer (lib_event.c, lib_event.h)
#endif
#ifndef USE_FAT
#define USE_FAT 0 // use FAT file system (lib_fat.c, lib_fat.h)
#endif
#ifndef USE_FILESEL
#define USE_FILESEL 0 // use file selection (lib_filesel.c, lib_filesel.h)
#endif
#ifndef USE_FRAMEBUF
#define USE_FRAMEBUF 1 // use default display frame buffer
#endif
#ifndef USE_LIST
#define USE_LIST 1 // use Doubly Linked List (lib_list.c, lib_list.h)
#endif
#ifndef USE_MAT2D
#define USE_MAT2D 1 // use 2D transformation matrix (lib_mat2d.c, lib_mat2d.h)
#endif
#ifndef USE_MALLOC
#define USE_MALLOC 1 // use Memory Allocator (lib_malloc.c, lib_malloc.h)
#endif
#ifndef USE_MD5
#define USE_MD5 1 // use MD5 hash - may need to be disabled when colliding with BTStack
#endif
#ifndef USE_MINIRING
#define USE_MINIRING 1 // use Mini-Ring buffer (lib_miniring.c, lib_miniring.h)
#endif
#ifndef USE_PRINT
#define USE_PRINT 1 // use Formatted print (lib_print.c, lib_print.h)
#endif
#ifndef USE_PWMSND
#define USE_PWMSND 0 // use PWM sound output; set 1.. = number of channels (lib_pwmsnd.c, lib_pwmsnd.h)
#endif
#ifndef USE_RAND
#define USE_RAND 1 // use Random number generator (lib_rand.c, lib_rand.h)
#endif
#ifndef USE_RECT
#define USE_RECT 1 // use Rectangle (lib_rect.c, lib_rect.h)
#endif
#ifndef USE_RING
#define USE_RING 1 // use Ring buffer (lib_ring.c, lib_ring.h)
#endif
#ifndef USE_RINGRX
#define USE_RINGRX 0 // use Ring buffer with DMA receiver (lib_ringrx.c, lib_ringrx.h)
#endif
#ifndef USE_RINGTX
#define USE_RINGTX 0 // use Ring buffer with DMA transmitter (lib_ringtx.c, lib_ringtx.h)
#endif
#ifndef USE_SD
#define USE_SD 0 // use SD card (lib_sd.c, lib_sd.h)
#endif
#ifndef USE_STREAM
#define USE_STREAM 1 // use Data stream (lib_stream.c, lib_stream.h)
#endif
#ifndef USE_TEXT
#define USE_TEXT 1 // use Text strings, except StrLen and StrComp (lib_text.c, lib_textnum.c, lib_text.h)
#endif
#ifndef USE_TEXTLIST
#define USE_TEXTLIST 1 // use List of text strings (lib_textlist.c, lib_textlist.h)
#endif
#ifndef USE_TPRINT
#define USE_TPRINT 1 // use Text Print (lib_tprint.c, lib_tprint.h)
#endif
#ifndef USE_TREE
#define USE_TREE 1 // use Tree list (lib_tree.c, lib_tree.h)
#endif
#ifndef USE_VIDEO
#define USE_VIDEO 0 // use video player (lib_video.c, lib_video.h)
#endif
#ifndef FONT
#define FONT FontBold8x16 // default system font
#endif
#ifndef FONTW
#define FONTW 8 // width of system font
#endif
#ifndef FONTH
#define FONTH 16 // height of system font
#endif
// ----------------------------------------------------------------------------
// Fast float functions
// ----------------------------------------------------------------------------
#ifndef USE_M33_VFP
#define USE_M33_VFP 1 // 1=enable VFP floating point instructions on RP2350-ARM, 0=emulate with DCP coprocessor
#endif
// float
#ifndef USE_M33_SQRTF
#define USE_M33_SQRTF 1 // RP2350-ARM sqrtf() function: 1=fast (recommended), 2=precise
#endif
#ifndef USE_M33_FDIV
#define USE_M33_FDIV 1 // RP2350-ARM fdiv() function: 1=fast (recommended), 2=precise
#endif
#ifndef USE_RISCV_SQRTF
#define USE_RISCV_SQRTF 1 // RISC-V sqrtf() function: 0=libc, 1=fast (recommended)
#endif
#ifndef USE_RISCV_EXPF
#define USE_RISCV_EXPF 1 // RISC-V expf(), exp2f() and exp10f() function: 0=libc, 1=Chebyshev (recommended), 2=Taylor, 3=Cordic
#endif
#ifndef USE_RISCV_LOGF
#define USE_RISCV_LOGF 1 // RISC-V logf(), log2f() and log10f() function: 0=libc, 1=Chebyshev (recommended), 2=Mercator, 3=Cordic
#endif
#ifndef USE_RISCV_SINF
#define USE_RISCV_SINF 2 // RISC-V sinf(), cosf(), sincosf(), tanf(), cotanf() functions: 0=libc, 1=Chebyshev, 2=Taylor (recommended), 3=Cordic
#endif
#ifndef USE_RISCV_ASINF
#define USE_RISCV_ASINF 2 // RISC-V asinf(), acosf() functions: 0=libc, 2=Taylor (recommended), 3=Cordic
#endif
#ifndef USE_RISCV_ATANF
#define USE_RISCV_ATANF 1 // RISC-V atanf(), acotanf(), atan2f() functions: 0=libc, 1=Chebyshev (recommended), 3=Cordic
#endif
// double
#ifndef USE_M33_SQRT
#define USE_M33_SQRT 1 // RP2350-ARM sqrt() function: 1=fast (recommended), 2=precise
#endif
#ifndef USE_M33_DDIV
#define USE_M33_DDIV 1 // RP2350-ARM ddiv() function: 1=fast (recommended), 2=precise
#endif
// ----------------------------------------------------------------------------
// Big integers, folder _bigint (1=use, 0=do not use)
// ----------------------------------------------------------------------------
#ifndef USE_BIGINT
#define USE_BIGINT 1 // use Big Integers (bigint.c, bigint.h)
#endif
#ifndef BIGINT_BERN_NUM
#define BIGINT_BERN_NUM 1024 // number of table Bernoulli numbers - use number 0, 256, 512, 768 or 1024
#endif
// ----------------------------------------------------------------------------
// REAL numbers (1=use, 0=do not use)
// ----------------------------------------------------------------------------
// To generate constants with GenConst generator, enable all number types
// to allow more accurate generation of Chebyshev constants.
#ifndef USE_REAL
#define USE_REAL 0 // use real numbers
#endif
#ifndef USE_REAL16
#define USE_REAL16 0 // 1 = use real16 numbers (3 digits, exp +-4)
#endif
#ifndef USE_REAL32
#define USE_REAL32 0 // 1 = use real32 numbers (float, 7 digits, exp +-38)
#endif
#ifndef USE_REAL48
#define USE_REAL48 0 // 1 = use real48 numbers (11 digits, exp +-153)
#endif
#ifndef USE_REAL64
#define USE_REAL64 0 // 1 = use real64 numbers (double, 16 digits, exp +-308)
#endif
#ifndef USE_REAL80
#define USE_REAL80 0 // 1 = use real80 numbers (19 digits, exp +-4932)
#endif
#ifndef USE_REAL96
#define USE_REAL96 0 // 1 = use real96 numbers (25 digits, exp +-1233)
#endif
#ifndef USE_REAL128
#define USE_REAL128 0 // 1 = use real128 numbers (34 digits, exp +-4932)
#endif
#ifndef USE_REAL160
#define USE_REAL160 0 // 1 = use real160 numbers (43 digits, exp +-9864)
#endif
#ifndef USE_REAL192
#define USE_REAL192 0 // 1 = use real192 numbers (52 digits, exp +-19728)
#endif
#ifndef USE_REAL256
#define USE_REAL256 0 // 1 = use real256 numbers (71 digits, exp +-78913)
#endif
#ifndef USE_REAL384
#define USE_REAL384 0 // 1 = use real384 numbers (109 digits, exp +-315652)
#endif
#ifndef USE_REAL512
#define USE_REAL512 0 // 1 = use real512 numbers (147 digits, exp +-1262611)
#endif
#ifndef USE_REAL768
#define USE_REAL768 0 // 1 = use real768 numbers (224 digits, exp +-5050445)
#endif
#ifndef USE_REAL1024
#define USE_REAL1024 0 // 1 = use real1024 numbers (300 digits, exp +-20201781)
#endif
#ifndef USE_REAL1536
#define USE_REAL1536 0 // 1 = use real1536 numbers (453 digits, exp +-161614248)
#endif
#ifndef USE_REAL2048
#define USE_REAL2048 0 // 1 = use real2048 numbers (607 digits, exp +-161614248)
#endif
#ifndef USE_REAL3072
#define USE_REAL3072 0 // 1 = use real3072 numbers (915 digits, exp +-161614248)
#endif
#ifndef USE_REAL4096
#define USE_REAL4096 0 // 1 = use real4096 numbers (1224 digits, exp +-161614248)
#endif
#ifndef USE_REAL6144
#define USE_REAL6144 0 // 1 = use real6144 numbers ( digits, exp +-161614248)
#endif
#ifndef USE_REAL8192
#define USE_REAL8192 0 // 1 = use real8192 numbers ( digits, exp +-161614248)
#endif
#ifndef USE_REAL12288
#define USE_REAL12288 0 // 1 = use real12288 numbers ( digits, exp +-161614248)
#endif
// Limiting the usage of large Chebyshev tables
// Chebyshev approximations can speed up calculations of mathematical functions.
// However, the use of Chebyshev approximations for long numbers takes a lot of
// Flash memory and can be slow due to slow Flash memory access. If needed, set
// a limit here on the bit length of the numbers for which Chebyshev approximations
// will be used. Calculations using Chebyshev approximations are not recommended for
// use in this library. The tables are prepared up to a maximum number size of 1536 bits.
#ifndef MAXCHEB_LN
#define MAXCHEB_LN 0 //1536 // max. REAL number supporting Chebyshev approximations of Ln()
#endif
#ifndef MAXCHEB_EXP
#define MAXCHEB_EXP 0 //1536 // max. REAL number supporting Chebyshev approximations of Exp()
#endif
#ifndef MAXCHEB_SIN
#define MAXCHEB_SIN 0 //1536 // max. REAL number supporting Chebyshev approximations of Sin()
#endif
#ifndef MAXCHEB_ASIN
#define MAXCHEB_ASIN 0 //1536 // max. REAL number supporting Chebyshev approximations of ASin()
#endif
#ifndef MAXCHEB_ATAN
#define MAXCHEB_ATAN 0 //1536 // max. REAL number supporting Chebyshev approximations of ATan()
#endif
#ifndef MAXCHEB_SQRT
#define MAXCHEB_SQRT 0 //1536 // max. REAL number supporting Chebyshev approximations of Sqrt()
#endif
// Limiting the usage of large Cordic tables (see note of Chebyshev tables)
// Note: Calculations using Cordic are not complete in this library because
// they have lower precision and they are not recommended for use in this library.
#ifndef MAXCORD_ATAN
#define MAXCORD_ATAN 0 //8192 // max. REAL number supporting Cordic atan table (to calculate sin, cos, tan, asin, acos, atan)
#endif
// Limiting the usage of linear factorials
// Calculating the linear factorial requires tables that take up much Flash memory.
// If you need to limit the size of the tables, set a limit here of the bit length of
// the numbers that will support the linear factorial. The integer factorial
// can still be used, but it is slow for large numbers.
#ifndef MAXFACT_COEFF
#define MAXFACT_COEFF 8192 // max. REAL number supporting linear factorial
#endif
// ----------------------------------------------------------------------------
// Miscellaneous Settings
// ----------------------------------------------------------------------------
#ifndef USE_MEMLOCK
#define USE_MEMLOCK 1 // lock of Memory Allocator 0=no, 1=multicore, 2=multicore+IRQ (lib_malloc.c, lib_malloc.h)
#endif
#ifndef DRAW_HWINTER
#define DRAW_HWINTER 1 // 1=use hardware interpolator to draw images on Canvas
#endif
#ifndef DRAW_HWINTER_INX
#define DRAW_HWINTER_INX 0 // index of hardware interpolator to draw on canvas
#endif
#ifndef TEMP_NOISE
#define TEMP_NOISE 20 // number of steps of noise reduction of temperature measurement, 0 = not used (requires array of u16)
#endif
#ifndef USE_STACKCHECK
#define USE_STACKCHECK 1 // use Stack check (sdk_cpu.c, sdk_cpu.h)
#endif
#ifndef ASM64
#define ASM64 0 // 1 = use assembler x64 optimization, if available
#endif
#if RP2040
#define BOOTLOADER_SIZE 0x8000 // size of boot loader RP2040
#else // RP2350
#define BOOTLOADER_SIZE 0x10000 // size of boot loader RP2350
#endif
#define BOOTLOADER_DATA 32 // size of boot loader resident data
#ifndef USB_DEV_CDC_RX_BUFSIZE
#define USB_DEV_CDC_RX_BUFSIZE 256 // USB CDC device RX buffer size
#endif
#ifndef USB_DEV_CDC_TX_BUFSIZE
#define USB_DEV_CDC_TX_BUFSIZE 256 // USB CDC device TX buffer size
#endif
#ifndef USB_HOST_CDC_RX_BUFSIZE
#define USB_HOST_CDC_RX_BUFSIZE 256 // USB CDC host RX buffer size
#endif
#ifndef USB_HOST_CDC_TX_BUFSIZE
#define USB_HOST_CDC_TX_BUFSIZE 256 // USB CDC host TX buffer size
#endif
#ifndef USB_DEV_HID_RX_BUFSIZE
#define USB_DEV_HID_RX_BUFSIZE 16 // USB HID device RX buffer size
#endif
#ifndef USB_DEV_HID_TX_BUFSIZE
#define USB_DEV_HID_TX_BUFSIZE 32 // USB HID device TX buffer size
#endif
#ifndef USB_HOST_HID_RX_BUFSIZE
#define USB_HOST_HID_RX_BUFSIZE 32 // USB HID host RX buffer size
#endif
#ifndef USB_HOST_HID_TX_BUFSIZE
#define USB_HOST_HID_TX_BUFSIZE 16 // USB HID host TX buffer size
#endif
#ifndef USB_HOST_HID_REPSIZE
#define USB_HOST_HID_REPSIZE 256 // USB HID host buffer to load report descriptor
#endif
#ifndef USB_HOST_HID_KEY_BUFSIZE
#define USB_HOST_HID_KEY_BUFSIZE 16 // USB HID host keyboard ring buffer size
#endif
#ifndef USB_HOST_HID_MOUSE_BUFSIZE
#define USB_HOST_HID_MOUSE_BUFSIZE 16 // USB HID host mouse ring buffer size
#endif
#ifndef KEY_REP_TIME1
#define KEY_REP_TIME1 400 // delta time of first press in [ms] (max 500)
#endif
#ifndef KEY_REP_TIME2
#define KEY_REP_TIME2 100 // delta time of repeat press in [ms] (max 500)
#endif
#ifndef SYSTICK_KEYSCAN
#define SYSTICK_KEYSCAN 0 // call KeyScan() function from SysTick system timer
#endif
// UART stdio
#ifndef UART_STDIO_PORT
#define UART_STDIO_PORT 0 // UART stdio port 0 or 1
#endif
#ifndef UART_STDIO_TX
#define UART_STDIO_TX 0 // UART stdio TX GPIO pin
#endif
#ifndef UART_STDIO_RX
#define UART_STDIO_RX 1 // UART stdio RX GPIO pin
#endif
#ifndef UART_STDIO_TXBUF
#define UART_STDIO_TXBUF 128 // size of transmit ring buffer of UART stdio
#endif
#ifndef UART_STDIO_RXBUF
#define UART_STDIO_RXBUF 128 // size of receive ring buffer of UART stdio
#endif
#ifndef USE_FAST_PERI
#define USE_FAST_PERI 0 // use fast perifery - use system clock instead of USB clock
// Warning: If you change system clock, you must also repair
// peripheral clock and re-initialize peripherals.
#endif
#ifndef USE_DISP_DMA
#define USE_DISP_DMA 1 // use DMA output do LCD display
#endif
#ifndef DISP_ROT
#define DISP_ROT 1 // display rotation of LCD: 0 Portrait, 1 Landscape, 2 Inverted Portrait, 3 Inverted Landscape
#endif
#ifndef FLASH_CLKDIV // current divider of flash SPI
#ifdef PRESET_FLASH_CLKDIV
#define FLASH_CLKDIV PRESET_FLASH_CLKDIV // preset other divider
#else
#define FLASH_CLKDIV 4
#endif
#endif
#ifndef FLASH_SIZE
#define FLASH_SIZE (2*1024*1024) // compiled flash size
#endif
#define RAM_SIZE (264*1024) // RAM size
#define PICO_FLASH_SPI_CLKDIV FLASH_CLKDIV // original-SDK flag
#define PICO_FLASH_SIZE_BYTES FLASH_SIZE // original-SDK flag
#ifndef LOAD_FLASH_INFO
#define LOAD_FLASH_INFO 1 // load flash info on startup
#endif
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
// ----------------------------------------------------------------------------
// UART test sample (files sdk_uart.c, sdk_uart.h)
// ----------------------------------------------------------------------------
#ifndef UARTSAMPLE
#define UARTSAMPLE 0 // flag in sdk_uart.*, compile UART test sample: 1 = compile, 0 = not
#endif
#ifndef UARTSAMPLE_UART
#define UARTSAMPLE_UART 0 // UART 0 or 1
#endif
#ifndef UARTSAMPLE_TXORDER
#define UARTSAMPLE_TXORDER 7 // order of size of transmitter ring buffers (size in bytes = 1 << order)
#endif
#ifndef UARTSAMPLE_RXORDER
#define UARTSAMPLE_RXORDER 7 // order of size of receiver ring buffers (size in bytes = 1 << order)
#endif
#ifndef UARTSAMPLE_TXMODE
#define UARTSAMPLE_TXMODE 3 // transmit mode: 0=polling, 1=interrupt, 2=DMA stream, 3=DMA single
#endif
#ifndef UARTSAMPLE_RXMODE
#define UARTSAMPLE_RXMODE 2 // receive mode: 0=polling, 1=interrupt, 2=DMA stream
#endif
#ifndef UARTSAMPLE_TXDMA
#define UARTSAMPLE_TXDMA 10 // transmitter DMA channel 0..11 (used in DMA mode)
#endif
#ifndef UARTSAMPLE_RXDMA
#define UARTSAMPLE_RXDMA 11 // receiver DMA channel 0..11 (used in DMA mode)
#endif
// ----------------------------------------------------------------------------
// System resources
// ----------------------------------------------------------------------------
// DMA temporary channel to calculate CRC and memory copy/fill.
// CPU0 uses DMA channel 11, CPU1 uses DMA channel 10, so functions can be used
// simultaneously, without collision. However, they cannot be used simultaneously in an interrupt.
#ifndef DMA_TEMP_CHAN
#define DMA_TEMP_CHAN() (DMA_CHANNELS - 1 - CpuID())
#endif
#ifndef ROSC_MHZ
#if RP2040
#define ROSC_MHZ 6 // ring oscillator frequency in MHz (default RP2040: 6 MHz)
#else // RP2350
#define ROSC_MHZ 11 // ring oscillator frequency in MHz (default RP2350: 11 MHz)
#endif
#endif
#ifndef XOSC_MHZ
#define XOSC_MHZ 12 // crystal oscillator frequency in MHz (must be in range 1..15 MHz, default 12 MHz)
#endif
#ifndef PLL_KHZ
#if RP2040
#define PLL_KHZ 125000 // PLL system frequency in kHz (default 125000 kHz)
#else // RP2350
#define PLL_KHZ 150000 // PLL system frequency in kHz (default 150000 kHz)
#endif
#endif
#ifndef BATTERY_FULL
#define BATTERY_FULL 4.2f // voltage of full battery (default value, use Config.bat_full)
#endif
#ifndef BATTERY_FULL_INT
#define BATTERY_FULL_INT 4200 // voltage of full battery (default value, use Config.bat_full)
#endif
#ifndef BATTERY_EMPTY
#define BATTERY_EMPTY 3.1f // voltage of empty battery (default value, use Config.bat_empty)
#endif
#ifndef BATTERY_EMPTY_INT
#define BATTERY_EMPTY_INT 3100 // voltage of empty battery (default value, use Config.bat_empty)
#endif
#ifndef BAT_DIODE_FV
#define BAT_DIODE_FV 0.311f // voltage drop in mV on diode (default value, use Config.bat_diode)
#endif
#ifndef BAT_DIODE_FV_INT
#define BAT_DIODE_FV_INT 311 // voltage drop in mV on diode (default value, use Config.bat_diode)
#endif
#ifndef ADC_UREF
#define ADC_UREF 3.3f // ADC reference voltage (default value, use Config.adc_ref)
#endif
#ifndef ADC_UREF_INT
#define ADC_UREF_INT 3300 // ADC reference voltage (default value, use Config.adc_ref)
#endif
#ifndef TEMP_BASE
#define TEMP_BASE 0.706f // temperature base voltage at 27°C (default value, use Config.temp_base)
#endif
#ifndef TEMP_SLOPE
#define TEMP_SLOPE 0.001721f // temperature slope - voltage per 1 degree (default value, use Config.temp_slope)
#endif
// ----------------------------------------------------------------------------
// Auto-dependencies
// ----------------------------------------------------------------------------
#if !USE_ORIGSDK // include interface of original SDK
#define PICO_NO_HARDWARE 1 // this switch is not use in other places of the SDK,
// it is used only in PIO program to cut-out some unwanted declarations
#endif
#if USE_VIDEO
#undef USE_FRAMEBUF
#define USE_FRAMEBUF 0
#endif
#if USE_MEMLOCK
#undef USE_SPINLOCK
#define USE_SPINLOCK 1
#endif
#if USE_MINIVGA
#undef USE_PIO
#define USE_PIO 1
#undef USE_DMA
#define USE_DMA 1
#undef USE_IRQ
#define USE_IRQ 1
#undef USE_PLL
#define USE_PLL 1
#undef USE_MULTICORE
#define USE_MULTICORE 1