44 uart_init(INC,MOD,SAMP);
46 *mem32(0x00401ffc) = 0x01234567;
47 *mem32(0x00407ffc) = 0xdeadbeef;
48 *mem32(0x0040fffc) = 0xface00ff;
49 *mem32(0x00410000) = 0xabcd0123;
51 putstr(
"sleep test\n\r");
52 putstr(
"0x00401ffc: ");
53 put_hex32(*mem32(0x00401ffc));
55 putstr(
"0x00407ffc: ");
56 put_hex32(*mem32(0x00407ffc));
58 putstr(
"0x0040fffc: ");
59 put_hex32(*mem32(0x0040fffc));
61 putstr(
"0x00410000: ");
62 put_hex32(*mem32(0x00410000));
72 putstr(
"enabling 32kHz crystal\n\r");
76 clear_bit(*CRM_RINGOSC_CNTL,0);
78 set_bit(*CRM_XTAL32_CNTL,0);
83 set_bit(*CRM_SYS_CNTL,5);
85 static volatile uint32_t old;
87 putstr(
"waiting for xtal\n\r");
88 while(*CRM_RTC_COUNT == old) {
93 set_bit(*CRM_SYS_CNTL,5);
94 putstr(
"32kHZ xtal started\n\r");
106 *CRM_WU_TIMEOUT = 327680*2;
108 *CRM_WU_TIMEOUT = 20000;
120 *CRM_SLEEP_CNTL = 0x71;
132 while((*CRM_STATUS & 0x1) == 0) {
continue; }
139 while((*CRM_STATUS & 0x1) == 0) {
continue; }
143 putstr(
"\n\r\n\r\n\r");
144 putstr(
"0x00401ffc: ");
145 put_hex32(*mem32(0x00401ffc));
147 putstr(
"0x00407ffc: ");
148 put_hex32(*mem32(0x00407ffc));
150 putstr(
"0x0040fffc: ");
151 put_hex32(*mem32(0x0040fffc));
153 putstr(
"0x00410000: ");
154 put_hex32(*mem32(0x00410000));
157 *GPIO_PAD_DIR0 = LED_RED;
163 *GPIO_DATA0 = LED_RED;
165 for(i=0; i<DELAY; i++) {
continue; }
169 for(i=0; i<DELAY; i++) {
continue; }