📄 cc1000.lst
字号:
579 02b2 852F mov r24,r21
580 02b4 9927 clr r25
581 02b6 8093 0000 sts CC1000ControlM_gCurrentParameters+7,r24
190:cc1000.c ****
191:cc1000.c **** if (ActualChannel < 500000000) {
583 .LM49:
584 02ba 8D81 ldd r24,Y+5
585 02bc 9E81 ldd r25,Y+6
586 02be AF81 ldd r26,Y+7
587 02c0 B885 ldd r27,Y+8
588 02c2 8030 cpi r24,lo8(500000000)
589 02c4 E5E6 ldi r30,hi8(500000000)
590 02c6 9E07 cpc r25,r30
591 02c8 EDEC ldi r30,hlo8(500000000)
592 02ca AE07 cpc r26,r30
593 02cc EDE1 ldi r30,hhi8(500000000)
594 02ce BE07 cpc r27,r30
595 02d0 A8F4 brsh .L14
192:cc1000.c **** if (ActualChannel < 400000000) {
597 .LM50:
598 02d2 8050 subi r24,lo8(400000000)
599 02d4 9448 sbci r25,hi8(400000000)
600 02d6 A74D sbci r26,hlo8(400000000)
601 02d8 B741 sbci r27,hhi8(400000000)
602 02da 28F4 brsh .L15
193:cc1000.c **** CC1000ControlM_gCurrentParameters[0x9] = (8 << 4) | (1 << 2);
604 .LM51:
605 02dc 84E8 ldi r24,lo8(-124)
606 02de 8093 0000 sts CC1000ControlM_gCurrentParameters+9,r24
194:cc1000.c **** CC1000ControlM_gCurrentParameters[0x1d] = (9 << 4) | (1 << 0);
608 .LM52:
609 02e2 81E9 ldi r24,lo8(-111)
610 02e4 04C0 rjmp .L20
611 .L15:
195:cc1000.c **** }
196:cc1000.c **** else {
197:cc1000.c **** CC1000ControlM_gCurrentParameters[0x9] = (4 << 4) | (1 << 2);
613 .LM53:
614 02e6 84E4 ldi r24,lo8(68)
615 02e8 8093 0000 sts CC1000ControlM_gCurrentParameters+9,r24
198:cc1000.c **** CC1000ControlM_gCurrentParameters[0x1d] = (8 << 4) | (1 << 0);
617 .LM54:
618 02ec 81E8 ldi r24,lo8(-127)
619 .L20:
620 02ee 8093 0000 sts CC1000ControlM_gCurrentParameters+29,r24
199:cc1000.c **** }
200:cc1000.c **** CC1000ControlM_gCurrentParameters[0xa] = 1 << 1;
622 .LM55:
623 02f2 82E0 ldi r24,lo8(2)
624 02f4 8093 0000 sts CC1000ControlM_gCurrentParameters+10,r24
201:cc1000.c **** CC1000ControlM_gCurrentParameters[0x12] = 7 << 4;
626 .LM56:
627 02f8 80E7 ldi r24,lo8(112)
628 02fa 0AC0 rjmp .L21
629 .L14:
202:cc1000.c **** }
203:cc1000.c **** else {
204:cc1000.c **** CC1000ControlM_gCurrentParameters[0x9] = (8 << 4) | (3 << 2);
631 .LM57:
632 02fc 8CE8 ldi r24,lo8(-116)
633 02fe 8093 0000 sts CC1000ControlM_gCurrentParameters+9,r24
205:cc1000.c **** CC1000ControlM_gCurrentParameters[0x1d] = (15 << 4) | (3 << 0);
635 .LM58:
636 0302 83EF ldi r24,lo8(-13)
637 0304 8093 0000 sts CC1000ControlM_gCurrentParameters+29,r24
206:cc1000.c **** CC1000ControlM_gCurrentParameters[0xa] = ((1 << 5) | (2 << 3)) | (
639 .LM59:
640 0308 82E3 ldi r24,lo8(50)
641 030a 8093 0000 sts CC1000ControlM_gCurrentParameters+10,r24
207:cc1000.c **** 1 << 1);
208:cc1000.c **** CC1000ControlM_gCurrentParameters[0x12] = 2 << 4;
643 .LM60:
644 030e 80E2 ldi r24,lo8(32)
645 .L21:
646 0310 8093 0000 sts CC1000ControlM_gCurrentParameters+18,r24
209:cc1000.c **** }
210:cc1000.c **** CC1000ControlM_gCurrentParameters[0xc] = RefDiv << 3;
648 .LM61:
649 0314 2D89 ldd r18,Y+21
650 0316 220F lsl r18
651 0318 220F lsl r18
652 031a 220F lsl r18
653 031c 2093 0000 sts CC1000ControlM_gCurrentParameters+12,r18
654 .L13:
211:cc1000.c **** }
212:cc1000.c **** CC1000ControlM_gCurrentChannel = ActualChannel;
656 .LM62:
657 0320 8D81 ldd r24,Y+5
658 0322 9E81 ldd r25,Y+6
659 0324 AF81 ldd r26,Y+7
660 0326 B885 ldd r27,Y+8
661 0328 8093 0000 sts CC1000ControlM_gCurrentChannel,r24
662 032c 9093 0000 sts (CC1000ControlM_gCurrentChannel)+1,r25
663 0330 A093 0000 sts (CC1000ControlM_gCurrentChannel)+2,r26
664 0334 B093 0000 sts (CC1000ControlM_gCurrentChannel)+3,r27
213:cc1000.c **** return ActualChannel;
214:cc1000.c **** }
666 .LM63:
667 0338 BC01 movw r22,r24
668 033a CD01 movw r24,r26
669 /* epilogue: frame size=30 */
670 033c 6E96 adiw r28,30
671 033e 0FB6 in __tmp_reg__,__SREG__
672 0340 F894 cli
673 0342 DEBF out __SP_H__,r29
674 0344 0FBE out __SREG__,__tmp_reg__
675 0346 CDBF out __SP_L__,r28
676 0348 DF91 pop r29
677 034a CF91 pop r28
678 034c 1F91 pop r17
679 034e 0F91 pop r16
680 0350 FF90 pop r15
681 0352 EF90 pop r14
682 0354 DF90 pop r13
683 0356 CF90 pop r12
684 0358 BF90 pop r11
685 035a AF90 pop r10
686 035c 9F90 pop r9
687 035e 8F90 pop r8
688 0360 7F90 pop r7
689 0362 6F90 pop r6
690 0364 5F90 pop r5
691 0366 4F90 pop r4
692 0368 3F90 pop r3
693 036a 2F90 pop r2
694 036c 0895 ret
695 /* epilogue end (size=25) */
696 /* function CC1000ControlComputeFreq size 444 (393) */
714 .global CC1000HPLInit
716 CC1000HPLInit:
215:cc1000.c ****
216:cc1000.c **** uint32_t CC1000ControlTuneManual(uint32_t DesiredFreq)
217:cc1000.c **** {
218:cc1000.c **** uint32_t actualFreq;
219:cc1000.c ****
220:cc1000.c **** actualFreq = CC1000ControlComputeFreq(DesiredFreq);
221:cc1000.c ****
222:cc1000.c **** CC1000ControlCC1000SetFreq();
223:cc1000.c ****
224:cc1000.c **** return actualFreq;
225:cc1000.c **** }
226:cc1000.c ****
227:cc1000.c **** void CC1000ControlCC1000SetModem(void)
228:cc1000.c **** {
229:cc1000.c **** CC1000HPLWrite(0x0F, CC1000ControlM_gCurrentParameters[0x0f]);
230:cc1000.c **** CC1000HPLWrite(0x10, CC1000ControlM_gCurrentParameters[0x10]);
231:cc1000.c **** CC1000HPLWrite(0x11, CC1000ControlM_gCurrentParameters[0x11]);
232:cc1000.c **** return;
233:cc1000.c **** }
234:cc1000.c ****
235:cc1000.c **** result_t CC1000HPLInit(void)
236:cc1000.c **** {
718 .LM64:
719 /* prologue: frame size=0 */
720 /* prologue end (size=0) */
237:cc1000.c **** OSH_MAKE_CC_CHP_OUT_INPUT();
722 .LM65:
723 036e 0E94 0000 call OSH_MAKE_CC_CHP_OUT_INPUT
238:cc1000.c **** OSH_MAKE_CC_PALE_OUTPUT();
725 .LM66:
726 0372 0E94 0000 call OSH_MAKE_CC_PALE_OUTPUT
239:cc1000.c **** OSH_MAKE_CC_PCLK_OUTPUT();
728 .LM67:
729 0376 0E94 0000 call OSH_MAKE_CC_PCLK_OUTPUT
240:cc1000.c **** OSH_MAKE_CC_PDATA_OUTPUT();
731 .LM68:
732 037a 0E94 0000 call OSH_MAKE_CC_PDATA_OUTPUT
241:cc1000.c **** OSH_SET_CC_PALE_PIN();
734 .LM69:
735 037e 0E94 0000 call OSH_SET_CC_PALE_PIN
242:cc1000.c **** OSH_SET_CC_PDATA_PIN();
737 .LM70:
738 0382 0E94 0000 call OSH_SET_CC_PDATA_PIN
243:cc1000.c **** OSH_SET_CC_PCLK_PIN();
740 .LM71:
741 0386 0E94 0000 call OSH_SET_CC_PCLK_PIN
244:cc1000.c **** return SUCCESS;
245:cc1000.c **** }
743 .LM72:
744 038a 81E0 ldi r24,lo8(1)
745 038c 90E0 ldi r25,hi8(1)
746 /* epilogue: frame size=0 */
747 038e 0895 ret
748 /* epilogue end (size=1) */
749 /* function CC1000HPLInit size 17 (16) */
754 .global CC1000HPLWrite
756 CC1000HPLWrite:
246:cc1000.c ****
247:cc1000.c **** result_t CC1000ControlStdControlInit(void)
248:cc1000.c **** {
249:cc1000.c **** CC1000HPLInit();
250:cc1000.c **** CC1000HPLWrite(0x00, (((
251:cc1000.c **** 1 << 5) | (1 << 4)) | (
252:cc1000.c **** 1 << 3)) | (1 << 1));
253:cc1000.c **** CC1000HPLWrite(0x00, ((((
254:cc1000.c **** 1 << 5) | (1 << 4)) | (
255:cc1000.c **** 1 << 3)) | (1 << 1)) | (
256:cc1000.c **** 1 << 0));
257:cc1000.c **** OSH_uwait(2000);
258:cc1000.c ****
259:cc1000.c **** // CC1000ControlM_gCurrentParameters[0xb] = (8 << 4) | (0 << 0);
260:cc1000.c **** CC1000ControlM_gCurrentParameters[0xb] = POWERLEVEL; //调整功率
261:cc1000.c **** CC1000HPLWrite(0x0B, CC1000ControlM_gCurrentParameters[0xb]);
262:cc1000.c ****
263:cc1000.c **** CC1000ControlM_gCurrentParameters[0xd] = 9 << 4;
264:cc1000.c **** CC1000HPLWrite(4, CC1000ControlM_gCurrentParameters[0xd]);
265:cc1000.c ****
266:cc1000.c **** CC1000ControlM_gCurrentParameters[0xf] = 0;
267:cc1000.c ****
268:cc1000.c **** CC1000ControlM_gCurrentParameters[0x10] = (((3 << 5) | (1 << 3)) | (
269:cc1000.c **** 3 << 1)) | (1 << 0);
270:cc1000.c ****
271:cc1000.c **** CC1000ControlM_gCurrentParameters[0x11] = ((5 << 4) | (1 << 2)) | (
272:cc1000.c **** 1 << 0);
273:cc1000.c ****
274:cc1000.c **** CC1000ControlCC1000SetModem();
275:cc1000.c ****
276:cc1000.c **** CC1000ControlM_gCurrentParameters[0x13] = 1 << 0;
277:cc1000.c **** CC1000HPLWrite(0x13, CC1000ControlM_gCurrentParameters[0x13]);
278:cc1000.c ****
279:cc1000.c **** CC1000ControlM_gCurrentParameters[0x1e] = TRUE;
280:cc1000.c ****
281:cc1000.c **** CC1000ControlTuneManual(433300000);
282:cc1000.c ****
283:cc1000.c **** return SUCCESS;
284:cc1000.c **** }
285:cc1000.c ****
286:cc1000.c ****
287:cc1000.c **** result_t CC1000ControlBIASOn(void)
288:cc1000.c **** {
289:cc1000.c **** CC1000HPLWrite(0x00, (((
290:cc1000.c **** 1 << 5) | (1 << 4)) | (
291:cc1000.c **** 1 << 3)) | (
292:cc1000.c **** 1 << 0));
293:cc1000.c ****
294:cc1000.c **** OSH_uwait(200);
295:cc1000.c **** return SUCCESS;
296:cc1000.c **** }
297:cc1000.c ****
298:cc1000.c **** result_t CC1000ControlStdControlStart(void)
299:cc1000.c **** {
300:cc1000.c ****
301:cc1000.c **** CC1000HPLWrite(0x00, ((((
302:cc1000.c **** 1 << 5) | (1 << 4)) | (
303:cc1000.c **** 1 << 3)) | (1 << 1)) | (
304:cc1000.c **** 1 << 0));
305:cc1000.c ****
306:cc1000.c **** OSH_uwait(2000);
307:cc1000.c **** return SUCCESS;
308:cc1000.c **** }
309:cc1000.c ****
310:cc1000.c **** result_t CC1000ControlTxMode(void)
311:cc1000.c **** {
312:cc1000.c **** CC1000HPLWrite(0x00, (((
313:cc1000.c **** 1 << 7) | (1 << 6)) | (1 << 5)) | (
314:cc1000.c **** 1 << 0));
315:cc1000.c ****
316:cc1000.c **** CC1000HPLWrite(0x09, CC1000ControlM_gCurrentParameters[29]);
317:cc1000.c **** OSH_uwait(250);
318:cc1000.c **** CC1000HPLWrite(0x0B, CC1000ControlM_gCurrentParameters[0xb]);
319:cc1000.c **** OSH_uwait(20);
320:cc1000.c **** return SUCCESS;
321:cc1000.c **** }
322:cc1000.c ****
323:cc1000.c **** result_t CC1000ControlRxMode(void)
324:cc1000.c **** {
325:cc1000.c **** CC1000HPLWrite(0x00, (
326:cc1000.c **** 1 << 4) | (1 << 0));
327:cc1000.c ****
328:cc1000.c **** CC1000HPLWrite(0x09, CC1000ControlM_gCurrentParameters[0x09]);
329:cc1000.c **** CC1000HPLWrite(0x0B, 0x00);
330:cc1000.c **** OSH_uwait(250);
331:cc1000.c **** return SUCCESS;
332:cc1000.c **** }
333:cc1000.c ****
334:cc1000.c **** result_t CC1000ControlStdControlStop(void)
335:cc1000.c **** {
336:cc1000.c **** CC1000HPLWrite(0x0B, 0x00);
337:cc1000.c **** CC1000HPLWrite(0x00, (((((
338:cc1000.c **** 1 << 5) | (1 << 4)) | (
339:cc1000.c **** 1 << 3)) | (1 << 2)) | (1 << 1)) | (
340:cc1000.c **** 1 << 0));
341:cc1000.c ****
342:cc1000.c **** return SUCCESS;
343:cc1000.c **** }
344:cc1000.c ****
345:cc1000.c **** result_t CC1000HPLWrite(uint8_t addr, uint8_t data)
346:cc1000.c **** {
758 .LM73:
759 /* prologue: frame size=0 */
760 0390 0F93 push r16
761 0392 1F93 push r17
762 0394 CF93 push r28
763 /* prologue end (size=3) */
764 0396 062F mov r16,r22
347:cc1000.c **** char cnt = 0;
348:cc1000.c ****
349:cc1000.c **** addr <<= 1;
766 .LM74:
767 0398 C82F mov r28,r24
768 039a CC0F lsl r28
350:cc1000.c **** OSH_CLR_CC_PALE_PIN();
770 .LM75:
771 039c 0E94 0000 call OSH_CLR_CC_PALE_PIN
772 03a0 16E0 ldi r17,lo8(6)
773 .L29:
351:cc1000.c **** for (cnt = 0; cnt < 7; cnt++)
352:cc1000.c **** {
353:cc1000.c **** if (addr & 0x80) {
775 .LM76:
776 03a2 C7FF sbrs r28,7
777 03a4 03C0 rjmp .L27
354:cc1000.c **** OSH_SET_CC_PDATA_PIN();
779 .LM77:
780 03a6 0E94 0000 call OSH_SET_CC_PDATA_PIN
781 03aa 02C0 rjmp .L28
782 .L27:
355:cc1000.c **** }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -