-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathamazon.patch
More file actions
1805 lines (1800 loc) · 64.8 KB
/
Copy pathamazon.patch
File metadata and controls
1805 lines (1800 loc) · 64.8 KB
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
diff -Naur -x '.*' WICED-SDK-3.3-1.orig/WICED/platform/MCU/STM32F2xx/peripherals/platform_mcu_powersave.c WICED-AMAZON/WICED/platform/MCU/STM32F2xx/peripherals/platform_mcu_powersave.c
--- WICED-SDK-3.3-1.orig/WICED/platform/MCU/STM32F2xx/peripherals/platform_mcu_powersave.c 2015-06-29 06:33:36.000000000 -0400
+++ WICED-AMAZON/WICED/platform/MCU/STM32F2xx/peripherals/platform_mcu_powersave.c 2015-11-19 19:48:59.000000000 -0500
@@ -111,15 +111,18 @@
/* Allow access to BKP Domain */
PWR_BackupAccessCmd(ENABLE);
+//maximus64 - we don't have an 32KHz OSC hooked up
+//Configure to use internal !!!!!
/* Enable the LSE OSC */
- RCC_LSEConfig(RCC_LSE_ON);
+ //.RCC_LSEConfig(RCC_LSE_ON);
/* Wait till LSE is ready */
- while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
- {
- }
+ //while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
+ //{
+ //}
/* Select the RTC Clock Source */
- RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);
+ //RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);
+ RCC_RTCCLKConfig(RCC_RTCCLKSource_LSI);
/* Enable the RTC Clock */
RCC_RTCCLKCmd(ENABLE);
diff -Naur -x '.*' WICED-SDK-3.3-1.orig/apps/demo/garage/garage.c WICED-AMAZON/apps/demo/garage/garage.c
--- WICED-SDK-3.3-1.orig/apps/demo/garage/garage.c 1969-12-31 19:00:00.000000000 -0500
+++ WICED-AMAZON/apps/demo/garage/garage.c 2015-11-19 20:02:54.000000000 -0500
@@ -0,0 +1,248 @@
+#include "wiced.h"
+#include "resources.h"
+#include "wwd_crypto.h"
+#include "wiced_security.h"
+
+/******************************************************
+ * Macros
+ ******************************************************/
+
+#define TCP_PACKET_MAX_DATA_LENGTH (30)
+#define TCP_SERVER_LISTEN_PORT (50007)
+#define TCP_SERVER_THREAD_PRIORITY (WICED_DEFAULT_LIBRARY_PRIORITY)
+/* Stack size should cater for printf calls */
+#define TCP_SERVER_STACK_SIZE (6200)
+#define TCP_SERVER_COMMAND_MAX_SIZE (10)
+#define TCP_PACKET_MAX_DATA_LENGTH (30)
+
+/* Enable this define to demonstrate tcp keep alive procedure */
+/* #define TCP_KEEPALIVE_ENABLED */
+
+/* Keepalive will be sent every 2 seconds */
+#define TCP_SERVER_KEEP_ALIVE_INTERVAL (2)
+/* Retry 10 times */
+#define TCP_SERVER_KEEP_ALIVE_PROBES (5)
+/* Initiate keepalive check after 5 seconds of silence on a tcp socket */
+#define TCP_SERVER_KEEP_ALIVE_TIME (5)
+#define TCP_SILENCE_DELAY (30)
+
+/******************************************************
+ * Constants
+ ******************************************************/
+
+/******************************************************
+ * Enumerations
+ ******************************************************/
+
+/******************************************************
+ * Type Definitions
+ ******************************************************/
+typedef struct
+{
+// wiced_bool_t quit;
+ wiced_tcp_socket_t socket;
+}tcp_server_handle_t;
+/******************************************************
+ * Structures
+ ******************************************************/
+
+/******************************************************
+ * Static Function Declarations
+ ******************************************************/
+
+static void tcp_server_thread_main(uint32_t arg);
+static wiced_result_t tcp_sent_package( tcp_server_handle_t* server, char* ptr, uint16_t buff_size );
+static char* tcp_get_package( tcp_server_handle_t* server, wiced_packet_t** rx_packet, uint16_t* request_length );
+
+/******************************************************
+ * Variable Definitions
+ ******************************************************/
+
+static wiced_thread_t tcp_thread;
+static tcp_server_handle_t tcp_server_handle;
+
+/******************************************************
+ * Function Definitions
+ ******************************************************/
+
+void application_start(void)
+{
+ //turn on LED indicator
+ wiced_gpio_output_low( WICED_LED2 );
+
+ /* Initialise the device and WICED framework */
+ wiced_init( );
+
+ /* Configure the device */
+ wiced_configure_device( NULL );
+
+ /* Bring up the network interface */
+ wiced_network_up( WICED_STA_INTERFACE, WICED_USE_EXTERNAL_DHCP_SERVER, NULL );
+
+ /* Create a TCP server socket */
+ if (wiced_tcp_create_socket(&tcp_server_handle.socket, WICED_STA_INTERFACE) != WICED_SUCCESS)
+ {
+ WPRINT_APP_INFO(("TCP socket creation failed\n"));
+ }
+
+ if (wiced_tcp_listen( &tcp_server_handle.socket, TCP_SERVER_LISTEN_PORT ) != WICED_SUCCESS)
+ {
+ WPRINT_APP_INFO(("TCP server socket initialization failed\n"));
+ wiced_tcp_delete_socket(&tcp_server_handle.socket);
+ return;
+ }
+
+ /* Start a tcp server thread */
+ WPRINT_APP_INFO(("Creating tcp server thread \n"));
+ wiced_rtos_create_thread(&tcp_thread, TCP_SERVER_THREAD_PRIORITY, "Demo tcp server", tcp_server_thread_main, TCP_SERVER_STACK_SIZE, &tcp_server_handle);
+}
+
+static wiced_result_t tcp_sent_package( tcp_server_handle_t* server, char* ptr, uint16_t buff_size )
+{
+ wiced_packet_t* temp_packet = NULL;
+ uint16_t available_data_length;
+ char* tx_data;
+
+ // Send package
+ if (wiced_packet_create_tcp(&server->socket, TCP_PACKET_MAX_DATA_LENGTH, &temp_packet, (uint8_t**)&tx_data, &available_data_length) != WICED_SUCCESS)
+ {
+ WPRINT_APP_INFO(("TCP packet creation failed\n"));
+ return WICED_ERROR;
+ }
+
+ if(available_data_length < buff_size)
+ {
+ WPRINT_APP_INFO(("TCP packet not enought space\n"));
+
+ // Delete packet, since the send failed
+ wiced_packet_delete(temp_packet);
+ return WICED_ERROR;
+ }
+
+ memcpy(tx_data, ptr, (size_t)buff_size);
+
+ /* Set the end of the data portion */
+ wiced_packet_set_data_end(temp_packet, (uint8_t*)tx_data + buff_size);
+
+ // Send the TCP packet
+ if (wiced_tcp_send_packet(&server->socket, temp_packet) != WICED_SUCCESS)
+ {
+ WPRINT_APP_INFO(("TCP packet send failed\n"));
+
+ // Delete packet, since the send failed
+ wiced_packet_delete(temp_packet);
+ return WICED_ERROR;
+ }
+
+ // Delete the packet, we're done with it
+ wiced_packet_delete( temp_packet );
+
+ return WICED_SUCCESS;
+}
+
+static char* tcp_get_package( tcp_server_handle_t* server, wiced_packet_t** rx_packet, uint16_t* request_length )
+{
+ uint16_t available_data_length;
+ char* request;
+
+ //Receive the query from the TCP client
+ if (wiced_tcp_receive( &server->socket, rx_packet, WICED_WAIT_FOREVER ) != WICED_SUCCESS)
+ {
+ WPRINT_APP_INFO(("TCP get receive failed\n"));
+ return NULL;
+ }
+
+ // Process the client request
+ if (wiced_packet_get_data( *rx_packet, 0, (uint8_t**) &request, request_length, &available_data_length ) != WICED_SUCCESS)
+ {
+ WPRINT_APP_INFO(("TCP get data failed\n"));
+ return NULL;
+ }
+
+ return request;
+}
+
+static void toggle_garage()
+{
+ //Toggling GPIO switch on relay
+ //using LED3 pin
+ WPRINT_APP_INFO(("Toggling.....\n"));
+ wiced_gpio_output_low( WICED_LED3 );
+ wiced_rtos_delay_milliseconds(1000);
+ wiced_gpio_output_high( WICED_LED3 );
+}
+
+
+static void tcp_server_thread_main(uint32_t arg)
+{
+ tcp_server_handle_t* server = (tcp_server_handle_t*) arg;
+ wiced_packet_t* temp_packet = NULL;
+ aes_context_t enc_ctx;
+ char chall_rand[16];
+ char chall_rand_enc[16];
+ char key[] = "\x0f\xd3\x5d\x49\x29\xb2\x24\xfd\x2b\x30\x1c\x69\x6a\xe6\x6f\x92";
+ uint16_t i = 0;
+
+ WPRINT_APP_INFO(("TCP main thread running\n"));
+
+ //Set AES secret key 128bits
+ aes_setkey_enc(&enc_ctx, (unsigned char *)key, 128);
+
+ while ( 1 )
+ {
+ // ganerate random challenge
+ for(i=0; i<sizeof(chall_rand); i +=2) wwd_wifi_get_random(&chall_rand[i], 2);
+
+ //AES encrypt random challenge
+ aes_crypt_ecb(&enc_ctx, AES_ENCRYPT, (unsigned char *)chall_rand, (unsigned char *)chall_rand_enc);
+
+ /* Wait for a connection */
+ if ( wiced_tcp_accept( &server->socket ) == WICED_SUCCESS )
+ {
+ // Send encrypted random challenge
+ if(tcp_sent_package(server, chall_rand_enc, sizeof(chall_rand_enc)) != WICED_SUCCESS)
+ {
+ WPRINT_APP_INFO(("Challenge data sent failed\n"));
+ continue;
+ }
+
+ // Get challenge respond
+ char* request = tcp_get_package(server, &temp_packet, &i);
+ if(request == NULL || i != 16) //check return + package size
+ {
+ WPRINT_APP_INFO(("Challenge respond failed, i=%d\n", i));
+ wiced_packet_delete( temp_packet );
+ continue;
+ }
+
+ WPRINT_APP_INFO(("Received challenge respond\n"));
+
+ //verifying respond
+ if( memcmp(chall_rand, request, sizeof(chall_rand)) != 0 )
+ {
+ WPRINT_APP_INFO(("Challenge respond invalid\n"));
+ wiced_packet_delete( temp_packet );
+ continue;
+ }
+
+ wiced_packet_delete( temp_packet );
+ wiced_tcp_disconnect( &server->socket );
+
+ toggle_garage();
+ }
+ else
+ {
+ // Send failed or connection has been lost, close the existing connection and
+ // get ready to accept the next one
+ wiced_tcp_disconnect( &server->socket );
+ }
+
+ }
+
+ //WPRINT_APP_INFO(("Disconnect\n"));
+
+ //wiced_tcp_disconnect( &server->socket );
+
+ //WICED_END_OF_CURRENT_THREAD( );
+}
+
diff -Naur -x '.*' WICED-SDK-3.3-1.orig/apps/demo/garage/garage.mk WICED-AMAZON/apps/demo/garage/garage.mk
--- WICED-SDK-3.3-1.orig/apps/demo/garage/garage.mk 1969-12-31 19:00:00.000000000 -0500
+++ WICED-AMAZON/apps/demo/garage/garage.mk 2015-11-19 19:48:59.000000000 -0500
@@ -0,0 +1,7 @@
+NAME := Garage_Opener
+
+$(NAME)_SOURCES := garage.c
+
+$(NAME)_COMPONENTS := daemons/device_configuration
+
+INVALID_PLATFORMS := BCM943362WCD4_LPCX1769 STMDiscovery411_BCM43438 BCM943362WCDA
diff -Naur -x '.*' WICED-SDK-3.3-1.orig/apps/demo/garage/tcp_client.py WICED-AMAZON/apps/demo/garage/tcp_client.py
--- WICED-SDK-3.3-1.orig/apps/demo/garage/tcp_client.py 1969-12-31 19:00:00.000000000 -0500
+++ WICED-AMAZON/apps/demo/garage/tcp_client.py 2015-11-19 20:02:01.000000000 -0500
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+from Crypto.Cipher import AES
+import socket
+import optparse
+import time
+import sys
+
+BUFFER_SIZE = 1024
+
+# IP details for the WICED TCP server
+DEFAULT_IP = '192.168.86.107' #IP address of the WICED TCP server
+DEFAULT_PORT = 50007 # Port of the WICED TCP server
+
+DEFAULT_KEY = "\x0f\xd3\x5d\x49\x29\xb2\x24\xfd\x2b\x30\x1c\x69\x6a\xe6\x6f\x92"
+
+
+def tcp_client( server_key, server_ip, server_port ):
+
+ print "Starting tcp client"
+ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.connect((server_ip, server_port))
+ print "Connected.."
+
+ print "Getting Challenge Data..."
+ data = s.recv(BUFFER_SIZE)
+ print ":".join("{:02x}".format(ord(c)) for c in data)
+
+ print "Decrypting Challenge Data..."
+ # create a cipher object using the random secret
+ cipher = AES.new(server_key)
+ decoded = cipher.decrypt(data)
+
+ print ":".join("{:02x}".format(ord(c)) for c in decoded)
+
+
+ print "Send Challenge Data..."
+ s.send(decoded)
+
+ print "Done"
+
+ s.close()
+
+
+if __name__ == '__main__':
+ parser = optparse.OptionParser()
+ parser.add_option("--key", dest="key", default=DEFAULT_KEY, help="AES Key.")
+ parser.add_option("--hostip", dest="hostip", default=DEFAULT_IP, help="Hostip to listen on.")
+ parser.add_option("-p", "--port", dest="port", type="int", default=DEFAULT_PORT, help="Port to listen on [default: %default].")
+ (options, args) = parser.parse_args()
+ #start tcp client
+ tcp_client(options.key, options.hostip, options.port)
+
diff -Naur -x '.*' WICED-SDK-3.3-1.orig/platforms/AMAZONDASH/AMAZONDASH.mk WICED-AMAZON/platforms/AMAZONDASH/AMAZONDASH.mk
--- WICED-SDK-3.3-1.orig/platforms/AMAZONDASH/AMAZONDASH.mk 1969-12-31 19:00:00.000000000 -0500
+++ WICED-AMAZON/platforms/AMAZONDASH/AMAZONDASH.mk 2015-11-19 19:55:30.000000000 -0500
@@ -0,0 +1,66 @@
+NAME := Platform_AMAZONDASH
+
+WLAN_CHIP := 43362
+WLAN_CHIP_REVISION := A2
+HOST_MCU_FAMILY := STM32F2xx
+HOST_MCU_VARIANT := STM32F2x5
+HOST_MCU_PART_NUMBER := STM32F205RGT6
+
+INTERNAL_MEMORY_RESOURCES = $(ALL_RESOURCES)
+
+ifndef BUS
+BUS := SDIO
+endif
+
+VALID_BUSES := SDIO
+
+EXTRA_TARGET_MAKEFILES += $(MAKEFILES_PATH)/standard_platform_targets.mk
+
+WIFI_IMAGE_DOWNLOAD := direct
+GLOBAL_DEFINES += WWD_DIRECT_RESOURCES
+
+# Global includes
+GLOBAL_INCLUDES := .
+
+# Global defines
+# HSE_VALUE = STM32 crystal frequency = 26MHz (needed to make UART work correctly)
+GLOBAL_DEFINES += HSE_VALUE=26000000
+GLOBAL_DEFINES += $$(if $$(NO_CRLF_STDIO_REPLACEMENT),,CRLF_STDIO_REPLACEMENT)
+
+# Components
+$(NAME)_COMPONENTS += drivers/spi_flash
+
+# Source files
+$(NAME)_SOURCES := platform.c
+
+# WICED APPS
+# APP0 and FILESYSTEM_IMAGE are reserved main app and resources file system
+# FR_APP :=
+# DCT_IMAGE :=
+# OTA_APP :=
+# FILESYSTEM_IMAGE :=
+# WIFI_FIRMWARE :=
+# APP0 :=
+# APP1 :=
+# APP2 :=
+
+# WICED APPS LOOKUP TABLE
+APPS_LUT_HEADER_LOC := 0x0000
+APPS_START_SECTOR := 1
+
+ifneq ($(APP),bootloader)
+ifneq ($(MAIN_COMPONENT_PROCESSING),1)
+$(info +-----------------------------------------------------------------------------------------------------+ )
+$(info | IMPORTANT NOTES | )
+$(info +-----------------------------------------------------------------------------------------------------+ )
+$(info | Wi-Fi MAC Address | )
+$(info | The target Wi-Fi MAC address is defined in <WICED-SDK>/generated_mac_address.txt | )
+$(info | Ensure each target device has a unique address. | )
+$(info +-----------------------------------------------------------------------------------------------------+ )
+$(info | MCU & Wi-Fi Power Save | )
+$(info | It is *critical* that applications using WICED Powersave API functions connect an accurate 32kHz | )
+$(info | reference clock to the sleep clock input pin of the WLAN chip. Please read the WICED Powersave | )
+$(info | Application Note located in the documentation directory if you plan to use powersave features. | )
+$(info +-----------------------------------------------------------------------------------------------------+ )
+endif
+endif
diff -Naur -x '.*' WICED-SDK-3.3-1.orig/platforms/AMAZONDASH/platform.c WICED-AMAZON/platforms/AMAZONDASH/platform.c
--- WICED-SDK-3.3-1.orig/platforms/AMAZONDASH/platform.c 1969-12-31 19:00:00.000000000 -0500
+++ WICED-AMAZON/platforms/AMAZONDASH/platform.c 2015-11-19 19:52:59.000000000 -0500
@@ -0,0 +1,448 @@
+#include "platform.h"
+#include "platform_config.h"
+#include "platform_init.h"
+#include "platform_isr.h"
+#include "platform_peripheral.h"
+#include "wwd_platform_common.h"
+#include "wwd_rtos_isr.h"
+#include "wiced_defaults.h"
+#include "wiced_platform.h"
+#include "wwd_rtos.h"
+
+/******************************************************
+ * Macros
+ ******************************************************/
+#define PLATFORM_FACTORY_RESET_CHECK_PERIOD ( 100 )
+#define PLATFORM_FACTORY_RESET_TIMEOUT ( 5000 )
+
+/******************************************************
+ * Constants
+ ******************************************************/
+
+/******************************************************
+ * Enumerations
+ ******************************************************/
+
+/******************************************************
+ * Type Definitions
+ ******************************************************/
+
+/******************************************************
+ * Structures
+ ******************************************************/
+
+/******************************************************
+ * Static Function Declarations
+ ******************************************************/
+
+/******************************************************
+ * Variable Definitions
+ ******************************************************/
+
+/* GPIO pin table. Used by WICED/platform/MCU/wiced_platform_common.c */
+
+const platform_gpio_t platform_gpio_pins[] =
+{
+ [WICED_GPIO_0] = { GPIOB, 0 },
+ [WICED_GPIO_1] = { GPIOB, 6 }, // RED LED - AMAZON DASH
+ [WICED_GPIO_2] = { GPIOB, 7 }, // GREEN LED - AMAZON DASH
+ [WICED_GPIO_3] = { GPIOA, 8 }, // BLUE LED - AMAZON DASH
+ [WICED_GPIO_4] = { GPIOC, 7 }, // UART6 RX - AMAZON DASH
+ [WICED_GPIO_5] = { GPIOA, 3 },
+ [WICED_GPIO_6] = { GPIOA, 4 },
+ [WICED_GPIO_7] = { GPIOB, 3 },
+ [WICED_GPIO_8] = { GPIOB, 4 },
+ [WICED_GPIO_9] = { GPIOB, 5 },
+ [WICED_GPIO_10] = { GPIOB, 8 },
+ [WICED_GPIO_11] = { GPIOA, 1 },
+ [WICED_GPIO_12] = { GPIOC, 2 },
+ [WICED_GPIO_13] = { GPIOB, 14 },
+ [WICED_GPIO_14] = { GPIOC, 6 }, // UART6 TX - AMAZON DASH
+ [WICED_GPIO_16] = { GPIOB, 1 },
+ [WICED_GPIO_18] = { GPIOA, 15 },
+ [WICED_GPIO_19] = { GPIOB, 11 },
+ [WICED_GPIO_20] = { GPIOA, 12 },
+ [WICED_GPIO_21] = { GPIOA, 11 },
+ [WICED_GPIO_22] = { GPIOA, 9 },
+ [WICED_GPIO_23] = { GPIOA, 10 },
+ [WICED_GPIO_28] = { GPIOA, 14 },
+ [WICED_GPIO_29] = { GPIOA, 0 }, // BUTTON - AMAZON DASH Note: This button connected to some PMU chip so it only work when BATT is installed
+ [WICED_GPIO_30] = { GPIOB, 9 },
+ [WICED_GPIO_31] = { GPIOA, 5 },
+ [WICED_GPIO_32] = { GPIOA, 6 },
+ [WICED_GPIO_33] = { GPIOA, 7 },
+ [WICED_GPIO_34] = { GPIOB, 15 },
+ [WICED_GPIO_35] = { GPIOC, 3 },
+ [WICED_GPIO_36] = { GPIOC, 4 },
+
+ //maximus Testing GPIOs
+ [WICED_GPIO_106] = { GPIOA, 5 },
+ [WICED_GPIO_107] = { GPIOA, 6 },
+ [WICED_GPIO_108] = { GPIOA, 7 },
+};
+
+/* ADC peripherals. Used WICED/platform/MCU/wiced_platform_common.c */
+const platform_adc_t platform_adc_peripherals[] =
+{
+ [WICED_ADC_1] = {ADC1, ADC_Channel_3, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_5]},
+ [WICED_ADC_2] = {ADC1, ADC_Channel_4, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_6]},
+ [WICED_ADC_3] = {ADC1, ADC_Channel_1, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_11]},
+ [WICED_ADC_4] = {ADC1, ADC_Channel_12, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_12]},
+ [WICED_ADC_5] = {ADC1, ADC_Channel_9, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_16]},
+ [WICED_ADC_6] = {ADC1, ADC_Channel_0, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_29]},
+ [WICED_ADC_7] = {ADC1, ADC_Channel_5, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_31]},
+ [WICED_ADC_8] = {ADC1, ADC_Channel_6, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_32]},
+ [WICED_ADC_9] = {ADC1, ADC_Channel_13, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_35]},
+ [WICED_ADC_10] = {ADC1, ADC_Channel_14, RCC_APB2Periph_ADC1, 1, &platform_gpio_pins[WICED_GPIO_36]},
+};
+
+/* PWM peripherals. Used by WICED/platform/MCU/wiced_platform_common.c */
+const platform_pwm_t platform_pwm_peripherals[] =
+{
+ [WICED_PWM_1] = {TIM4, 1, RCC_APB1Periph_TIM4, GPIO_AF_TIM4, &platform_gpio_pins[WICED_GPIO_1]},
+ [WICED_PWM_2] = {TIM4, 2, RCC_APB1Periph_TIM4, GPIO_AF_TIM4, &platform_gpio_pins[WICED_GPIO_2]},
+// maximus64 - don't know Amazon dash pin mapping
+// [WICED_PWM_3] = {TIM2, 2, RCC_APB1Periph_TIM2, GPIO_AF_TIM2, &platform_gpio_pins[WICED_GPIO_2] }, /* or TIM5/Ch2 */
+// [WICED_PWM_4] = {TIM2, 3, RCC_APB1Periph_TIM2, GPIO_AF_TIM2, &platform_gpio_pins[WICED_GPIO_3] }, /* or TIM5/Ch3, TIM9/Ch1 */
+// [WICED_PWM_5] = {TIM2, 4, RCC_APB1Periph_TIM2, GPIO_AF_TIM2, &platform_gpio_pins[WICED_GPIO_4] }, /* or TIM5/Ch4, TIM9/Ch2 */
+// [WICED_PWM_6] = {TIM2, 1, RCC_APB1Periph_TIM2, GPIO_AF_TIM2, &platform_gpio_pins[WICED_GPIO_6] }, /* or TIM2_CH1_ETR, TIM8/Ch1N */
+// [WICED_PWM_7] = {TIM3, 1, RCC_APB1Periph_TIM3, GPIO_AF_TIM3, &platform_gpio_pins[WICED_GPIO_7] }, /* or TIM1_BKIN, TIM8_BKIN, TIM13/Ch1*/
+// [WICED_PWM_8] = {TIM3, 2, RCC_APB1Periph_TIM3, GPIO_AF_TIM3, &platform_gpio_pins[WICED_GPIO_8] }, /* or TIM8/Ch1N, TIM14/Ch1 */
+// [WICED_PWM_9] = {TIM5, 2, RCC_APB1Periph_TIM5, GPIO_AF_TIM5, &platform_gpio_pins[WICED_GPIO_2] }, /* or TIM2/Ch2 */
+};
+
+/* SPI peripherals */
+const platform_spi_t platform_spi_peripherals[] =
+{
+ [WICED_SPI_1] =
+ {
+ .port = SPI1,
+ .gpio_af = GPIO_AF_SPI1,
+ .peripheral_clock_reg = RCC_APB2Periph_SPI1,
+ .peripheral_clock_func = RCC_APB2PeriphClockCmd,
+ .pin_mosi = &platform_gpio_pins[WICED_GPIO_108],
+ .pin_miso = &platform_gpio_pins[WICED_GPIO_107],
+ .pin_clock = &platform_gpio_pins[WICED_GPIO_106],
+ .tx_dma =
+ {
+ .controller = DMA2,
+ .stream = DMA2_Stream5,
+ .channel = DMA_Channel_3,
+ .irq_vector = DMA2_Stream5_IRQn,
+ .complete_flags = DMA_HISR_TCIF5,
+ .error_flags = ( DMA_HISR_TEIF5 | DMA_HISR_FEIF5 | DMA_HISR_DMEIF5 ),
+ },
+ .rx_dma =
+ {
+ .controller = DMA2,
+ .stream = DMA2_Stream0,
+ .channel = DMA_Channel_3,
+ .irq_vector = DMA2_Stream0_IRQn,
+ .complete_flags = DMA_LISR_TCIF0,
+ .error_flags = ( DMA_LISR_TEIF0 | DMA_LISR_FEIF0 | DMA_LISR_DMEIF0 ),
+ },
+ }
+};
+
+/* UART peripherals and runtime drivers. Used by WICED/platform/MCU/wiced_platform_common.c */
+const platform_uart_t platform_uart_peripherals[] =
+{
+ [WICED_UART_1] =
+ {
+ .port = USART1,
+ .tx_pin = &platform_gpio_pins[WICED_GPIO_22 ],
+ .rx_pin = &platform_gpio_pins[WICED_GPIO_23 ],
+ .cts_pin = NULL,
+ .rts_pin = NULL,
+ .tx_dma_config =
+ {
+ .controller = DMA2,
+ .stream = DMA2_Stream7,
+ .channel = DMA_Channel_4,
+ .irq_vector = DMA2_Stream7_IRQn,
+ .complete_flags = DMA_HISR_TCIF7,
+ .error_flags = ( DMA_HISR_TEIF7 | DMA_HISR_FEIF7 ),
+ },
+ .rx_dma_config =
+ {
+ .controller = DMA2,
+ .stream = DMA2_Stream2,
+ .channel = DMA_Channel_4,
+ .irq_vector = DMA2_Stream2_IRQn,
+ .complete_flags = DMA_LISR_TCIF2,
+ .error_flags = ( DMA_LISR_TEIF2 | DMA_LISR_FEIF2 | DMA_LISR_DMEIF2 ),
+ },
+ },
+ //Added UART 6 for Amazon Dash
+ [WICED_UART_6] =
+ {
+ .port = USART6,
+ .tx_pin = &platform_gpio_pins[WICED_GPIO_14],
+ .rx_pin = &platform_gpio_pins[WICED_GPIO_4],
+ .cts_pin = NULL,
+ .rts_pin = NULL,
+ .tx_dma_config =
+ {
+ .controller = DMA2,
+ .stream = DMA2_Stream6,
+ .channel = DMA_Channel_5,
+ .irq_vector = DMA2_Stream6_IRQn,
+ .complete_flags = DMA_HISR_TCIF6,
+ .error_flags = ( DMA_HISR_TEIF6 | DMA_HISR_FEIF6 ),
+ },
+ .rx_dma_config =
+ {
+ .controller = DMA2,
+ .stream = DMA2_Stream1,
+ .channel = DMA_Channel_5,
+ .irq_vector = DMA2_Stream1_IRQn,
+ .complete_flags = DMA_LISR_TCIF1,
+ .error_flags = ( DMA_LISR_TEIF1 | DMA_LISR_FEIF1 | DMA_LISR_DMEIF1 ),
+ },
+ },
+};
+platform_uart_driver_t platform_uart_drivers[WICED_UART_MAX];
+
+
+
+/* I2C peripherals. Used by WICED/platform/MCU/wiced_platform_common.c */
+/* maximus64 - Disable I2C for now
+const platform_i2c_t platform_i2c_peripherals[] =
+{
+ [WICED_I2C_1] =
+ {
+ .port = I2C1,
+ .pin_scl = &platform_gpio_pins[WICED_GPIO_1],
+ .pin_sda = &platform_gpio_pins[WICED_GPIO_2],
+ .peripheral_clock_reg = RCC_APB1Periph_I2C1,
+ .tx_dma = DMA1,
+ .tx_dma_peripheral_clock = RCC_AHB1Periph_DMA1,
+ .tx_dma_stream = DMA1_Stream7,
+ .rx_dma_stream = DMA1_Stream5,
+ .tx_dma_stream_id = 7,
+ .rx_dma_stream_id = 5,
+ .tx_dma_channel = DMA_Channel_1,
+ .rx_dma_channel = DMA_Channel_1,
+ .gpio_af = GPIO_AF_I2C1
+ },
+};
+*/
+
+/* maximus64 - I don't think the amazon dash has NFC
+const wiced_spi_device_t wiced_nfc_device =
+{
+ .port = WICED_SPI_1,
+ .chip_select = WICED_GPIO_5,
+ .speed = 5000000,
+ .mode = (SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_HIGH | SPI_NO_DMA | SPI_MSB_FIRST),
+ .bits = 8
+};
+*/
+
+/* SPI flash. Exposed to the applications through include/wiced_platform.h */
+#if defined ( WICED_PLATFORM_INCLUDES_SPI_FLASH )
+const wiced_spi_device_t wiced_spi_flash =
+{
+ .port = WICED_SPI_1,
+ .chip_select = WICED_SPI_FLASH_CS,
+ .speed = 5000000,
+ .mode = (SPI_CLOCK_RISING_EDGE | SPI_CLOCK_IDLE_HIGH | SPI_NO_DMA | SPI_MSB_FIRST),
+ .bits = 8
+};
+#endif
+
+/* UART standard I/O configuration */
+#ifndef WICED_DISABLE_STDIO
+static platform_uart_config_t stdio_config =
+{
+ .baud_rate = 115200,
+ .data_width = DATA_WIDTH_8BIT,
+ .parity = NO_PARITY,
+ .stop_bits = STOP_BITS_1,
+ .flow_control = FLOW_CONTROL_DISABLED,
+};
+#endif
+
+/* Wi-Fi control pins. Used by WICED/platform/MCU/wwd_platform_common.c
+ * SDIO: WWD_PIN_BOOTSTRAP[1:0] = b'00
+ * gSPI: WWD_PIN_BOOTSTRAP[1:0] = b'01
+ */
+const platform_gpio_t wifi_control_pins[] =
+{
+ [WWD_PIN_POWER ] = { GPIOB, 2 }, //Correct pin for the AMAZON DASH - active high
+ [WWD_PIN_RESET ] = { GPIOB, 5 },
+#if defined ( WICED_USE_WIFI_32K_CLOCK_MCO )
+ [WWD_PIN_32K_CLK ] = { GPIOA, 13 }, //Put here some random unused pins.
+#else
+ [WWD_PIN_32K_CLK ] = { GPIOA, 11 }, //real output pin
+#endif
+ [WWD_PIN_BOOTSTRAP_0] = { GPIOB, 0 },
+ [WWD_PIN_BOOTSTRAP_1] = { GPIOB, 1 },
+};
+
+/* Wi-Fi SDIO bus pins. Used by WICED/platform/STM32F2xx/WWD/wwd_SDIO.c */
+const platform_gpio_t wifi_sdio_pins[] =
+{
+ [WWD_PIN_SDIO_OOB_IRQ] = { GPIOB, 0 },
+ [WWD_PIN_SDIO_CLK ] = { GPIOC, 12 },
+ [WWD_PIN_SDIO_CMD ] = { GPIOD, 2 },
+ [WWD_PIN_SDIO_D0 ] = { GPIOC, 8 },
+ [WWD_PIN_SDIO_D1 ] = { GPIOC, 9 },
+ [WWD_PIN_SDIO_D2 ] = { GPIOC, 10 },
+ [WWD_PIN_SDIO_D3 ] = { GPIOC, 11 },
+};
+
+/* Wi-Fi gSPI bus pins. Used by WICED/platform/STM32F2xx/WWD/wwd_SPI.c */
+const platform_gpio_t wifi_spi_pins[] =
+{
+ [WWD_PIN_SPI_IRQ ] = { GPIOC, 9 },
+ [WWD_PIN_SPI_CS ] = { GPIOC, 11 },
+ [WWD_PIN_SPI_CLK ] = { GPIOB, 13 },
+ [WWD_PIN_SPI_MOSI] = { GPIOB, 15 },
+ [WWD_PIN_SPI_MISO] = { GPIOB, 14 },
+};
+
+/******************************************************
+ * Function Definitions
+ ******************************************************/
+
+void platform_init_peripheral_irq_priorities( void )
+{
+ /* Interrupt priority setup. Called by WICED/platform/MCU/STM32F2xx/platform_init.c */
+ NVIC_SetPriority( RTC_WKUP_IRQn , 1 ); /* RTC Wake-up event */
+ NVIC_SetPriority( SDIO_IRQn , 2 ); /* WLAN SDIO */
+ NVIC_SetPriority( DMA2_Stream3_IRQn, 3 ); /* WLAN SDIO DMA */
+ NVIC_SetPriority( DMA1_Stream3_IRQn, 3 ); /* WLAN SPI DMA */
+ NVIC_SetPriority( USART1_IRQn , 6 ); /* WICED_UART_1 */
+ NVIC_SetPriority( USART6_IRQn , 6 ); /* WICED_UART_6 */
+ NVIC_SetPriority( DMA2_Stream7_IRQn, 7 ); /* WICED_UART_1 TX DMA */
+ NVIC_SetPriority( DMA2_Stream2_IRQn, 7 ); /* WICED_UART_1 RX DMA */
+ NVIC_SetPriority( DMA2_Stream6_IRQn, 7 ); /* WICED_UART_2 TX DMA */
+ NVIC_SetPriority( DMA2_Stream1_IRQn, 7 ); /* WICED_UART_2 RX DMA */
+ NVIC_SetPriority( EXTI0_IRQn , 14 ); /* GPIO */
+ NVIC_SetPriority( EXTI1_IRQn , 14 ); /* GPIO */
+ NVIC_SetPriority( EXTI2_IRQn , 14 ); /* GPIO */
+ NVIC_SetPriority( EXTI3_IRQn , 14 ); /* GPIO */
+ NVIC_SetPriority( EXTI4_IRQn , 14 ); /* GPIO */
+ NVIC_SetPriority( EXTI9_5_IRQn , 14 ); /* GPIO */
+ NVIC_SetPriority( EXTI15_10_IRQn , 14 ); /* GPIO */
+}
+
+void platform_init_external_devices( void )
+{
+ /* This function initializes the external interfaces for the platform.
+ You could use this to initialize the peripherals you use.
+ Note however that if you initialize alternative functionality of
+ JTAG and UART pins, you could lock yourself out of being able to flash
+ new firmware.
+ */
+
+ //patch added to resolve the microseconds delay hang issue.
+ do
+ {
+ // enable DWT hardware and cycle counting
+ CoreDebug->DEMCR = CoreDebug->DEMCR | CoreDebug_DEMCR_TRCENA_Msk;
+ // reset a counter
+ DWT->CYCCNT = 0;
+ // enable the counter
+ DWT->CTRL = (DWT->CTRL | DWT_CTRL_CYCCNTENA_Msk) ;
+ }
+ while(0);
+
+ /* Initialise LEDs and turn off by default */
+ platform_gpio_init( &platform_gpio_pins[WICED_LED1], OUTPUT_OPEN_DRAIN_NO_PULL );
+ platform_gpio_init( &platform_gpio_pins[WICED_LED2], OUTPUT_OPEN_DRAIN_NO_PULL );
+ platform_gpio_init( &platform_gpio_pins[WICED_LED3], OUTPUT_OPEN_DRAIN_NO_PULL );
+
+ // maximus64 - Amazon Dash LED are Active Low
+ platform_gpio_output_high( &platform_gpio_pins[WICED_LED1] );
+ platform_gpio_output_high( &platform_gpio_pins[WICED_LED2] );
+ platform_gpio_output_high( &platform_gpio_pins[WICED_LED3] );
+
+ /* Initialise buttons to input by default */
+ platform_gpio_init( &platform_gpio_pins[WICED_BUTTON1], INPUT_HIGH_IMPEDANCE );
+
+
+#ifndef WICED_DISABLE_STDIO
+ /* Initialise UART standard I/O */
+ platform_stdio_init( &platform_uart_drivers[STDIO_UART], &platform_uart_peripherals[STDIO_UART], &stdio_config );
+#endif
+}
+
+/* Checks if a factory reset is requested */
+wiced_bool_t platform_check_factory_reset( void )
+{
+ uint32_t factory_reset_counter = 0;
+ int led_state = 0;
+ while ( ( 0 != platform_gpio_input_get( &platform_gpio_pins[ WICED_BUTTON1 ] ) ) //maximus inversed this because button is active high
+ &&( ( factory_reset_counter += PLATFORM_FACTORY_RESET_CHECK_PERIOD ) <= PLATFORM_FACTORY_RESET_TIMEOUT )
+ &&( WICED_SUCCESS == (wiced_result_t)host_rtos_delay_milliseconds( PLATFORM_FACTORY_RESET_CHECK_PERIOD ) )
+ )
+ {
+ /* Factory reset button is being pressed. */
+ /* User Must press it for 5 seconds to ensure it was not accidental */
+ /* Toggle LED every 100ms */
+
+ if ( led_state == 0 )
+ {
+ platform_gpio_output_high( &platform_gpio_pins[ WICED_LED1 ] );
+ led_state = 1;
+ }
+ else
+ {
+ platform_gpio_output_low( &platform_gpio_pins[ WICED_LED1 ] );
+ led_state = 0;
+ }
+ if ( factory_reset_counter == 5000 )
+ {
+ return WICED_TRUE;
+ }
+ }
+ return WICED_FALSE;
+}
+
+/******************************************************
+ * Interrupt Handler Definitions
+ ******************************************************/
+
+WWD_RTOS_DEFINE_ISR( usart1_irq )
+{
+ platform_uart_irq( &platform_uart_drivers[WICED_UART_1] );
+}
+
+WWD_RTOS_DEFINE_ISR( usart6_irq )
+{
+ platform_uart_irq( &platform_uart_drivers[WICED_UART_6] );
+}
+
+WWD_RTOS_DEFINE_ISR( usart1_tx_dma_irq )
+{
+ platform_uart_tx_dma_irq( &platform_uart_drivers[WICED_UART_1] );
+}
+
+WWD_RTOS_DEFINE_ISR( usart6_tx_dma_irq )
+{
+ platform_uart_tx_dma_irq( &platform_uart_drivers[WICED_UART_6] );
+}
+
+WWD_RTOS_DEFINE_ISR( usart1_rx_dma_irq )
+{
+ platform_uart_rx_dma_irq( &platform_uart_drivers[WICED_UART_1] );
+}
+
+WWD_RTOS_DEFINE_ISR( usart6_rx_dma_irq )
+{
+ platform_uart_rx_dma_irq( &platform_uart_drivers[WICED_UART_6] );
+}
+
+/******************************************************
+ * Interrupt Handlers Mapping
+ ******************************************************/
+
+/* These DMA assignments can be found STM32F2xx datasheet DMA section */
+WWD_RTOS_MAP_ISR( usart1_irq , USART1_irq )
+WWD_RTOS_MAP_ISR( usart1_tx_dma_irq, DMA2_Stream7_irq )
+WWD_RTOS_MAP_ISR( usart1_rx_dma_irq, DMA2_Stream2_irq )
+WWD_RTOS_MAP_ISR( usart6_irq , USART6_irq )
+WWD_RTOS_MAP_ISR( usart6_tx_dma_irq, DMA2_Stream6_irq )
+WWD_RTOS_MAP_ISR( usart6_rx_dma_irq, DMA2_Stream1_irq )
diff -Naur -x '.*' WICED-SDK-3.3-1.orig/platforms/AMAZONDASH/platform.h WICED-AMAZON/platforms/AMAZONDASH/platform.h
--- WICED-SDK-3.3-1.orig/platforms/AMAZONDASH/platform.h 1969-12-31 19:00:00.000000000 -0500
+++ WICED-AMAZON/platforms/AMAZONDASH/platform.h 2015-11-19 19:54:23.000000000 -0500
@@ -0,0 +1,156 @@
+
+/** @file
+ * Defines peripherals available for use on Amazon Dash board
+ */
+#pragma once
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/******************************************************
+ * Enumerations
+ ******************************************************/
+
+typedef enum
+{
+ WICED_GPIO_0,
+ WICED_GPIO_1,
+ WICED_GPIO_2,
+ WICED_GPIO_3,
+ WICED_GPIO_4,
+ WICED_GPIO_5,
+ WICED_GPIO_6,
+ WICED_GPIO_7,
+ WICED_GPIO_8,
+ WICED_GPIO_9,
+ WICED_GPIO_10,
+ WICED_GPIO_11,
+ WICED_GPIO_12,
+ WICED_GPIO_13,
+ WICED_GPIO_14,
+ WICED_GPIO_15,
+ WICED_GPIO_16,
+ WICED_GPIO_17,
+ WICED_GPIO_18,
+ WICED_GPIO_19,
+ WICED_GPIO_20,
+ WICED_GPIO_21,
+ WICED_GPIO_22,
+ WICED_GPIO_23,
+ WICED_GPIO_24,
+ WICED_GPIO_25,
+ WICED_GPIO_26,
+ WICED_GPIO_27,
+ WICED_GPIO_28,
+ WICED_GPIO_29,
+ WICED_GPIO_30,
+ WICED_GPIO_31,
+ WICED_GPIO_32,
+ WICED_GPIO_33,
+ WICED_GPIO_34,
+ WICED_GPIO_35,
+ WICED_GPIO_36,
+ WICED_GPIO_37,
+ WICED_GPIO_38,
+ WICED_GPIO_39,
+ WICED_GPIO_40,
+ WICED_GPIO_41,
+ WICED_GPIO_42,
+ WICED_GPIO_43,
+ WICED_GPIO_44,
+ WICED_GPIO_106,
+ WICED_GPIO_107,
+ WICED_GPIO_108,
+ WICED_GPIO_MAX, /* Denotes the total number of GPIO port aliases. Not a valid GPIO alias */
+ WICED_GPIO_32BIT = 0x7FFFFFFF,
+} wiced_gpio_t;
+
+typedef enum
+{
+ WICED_SPI_1,
+ WICED_SPI_MAX, /* Denotes the total number of SPI port aliases. Not a valid SPI alias */
+ WICED_SPI_32BIT = 0x7FFFFFFF,
+} wiced_spi_t;
+
+typedef enum
+{
+ WICED_I2C_1,
+ WICED_I2C_MAX,
+ WICED_I2C_32BIT = 0x7FFFFFFF,
+} wiced_i2c_t;
+
+typedef enum
+{
+ WICED_PWM_1,
+ WICED_PWM_2,
+ WICED_PWM_3,
+ WICED_PWM_4,
+ WICED_PWM_5,
+ WICED_PWM_6,
+ WICED_PWM_7,
+ WICED_PWM_8,
+ WICED_PWM_9,
+ WICED_PWM_MAX, /* Denotes the total number of PWM port aliases. Not a valid PWM alias */
+ WICED_PWM_32BIT = 0x7FFFFFFF,
+} wiced_pwm_t;
+
+typedef enum
+{
+ WICED_ADC_1,
+ WICED_ADC_2,
+ WICED_ADC_3,
+ WICED_ADC_4,
+ WICED_ADC_5,
+ WICED_ADC_6,
+ WICED_ADC_7,
+ WICED_ADC_8,
+ WICED_ADC_9,
+ WICED_ADC_10,
+ WICED_ADC_MAX, /* Denotes the total number of ADC port aliases. Not a valid ADC alias */
+ WICED_ADC_32BIT = 0x7FFFFFFF,
+} wiced_adc_t;
+
+typedef enum
+{
+ WICED_UART_1,
+ WICED_UART_6,
+ WICED_UART_MAX, /* Denotes the total number of UART port aliases. Not a valid UART alias */
+ WICED_UART_32BIT = 0x7FFFFFFF,
+} wiced_uart_t;
+
+/******************************************************
+ * Constants
+ ******************************************************/
+
+/* UART port used for standard I/O */
+#define STDIO_UART ( WICED_UART_6 )