📄 main.lss
字号:
7de: 5f ef ldi r21, 0xFF ; 255
7e0: e2 0e add r14, r18
7e2: f3 1e adc r15, r19
7e4: 04 1f adc r16, r20
7e6: 15 1f adc r17, r21
diff = Channel - desiredFreq;
7e8: d8 01 movw r26, r16
7ea: c7 01 movw r24, r14
7ec: 29 81 ldd r18, Y+1 ; 0x01
7ee: 3a 81 ldd r19, Y+2 ; 0x02
7f0: 4b 81 ldd r20, Y+3 ; 0x03
7f2: 5c 81 ldd r21, Y+4 ; 0x04
7f4: 82 1b sub r24, r18
7f6: 93 0b sbc r25, r19
7f8: a4 0b sbc r26, r20
7fa: b5 0b sbc r27, r21
if (diff < 0) {
7fc: b7 ff sbrs r27, 7
7fe: 07 c0 rjmp .+14 ; 0x80e
diff = 0 - diff;
800: b0 95 com r27
802: a0 95 com r26
804: 90 95 com r25
806: 81 95 neg r24
808: 9f 4f sbci r25, 0xFF ; 255
80a: af 4f sbci r26, 0xFF ; 255
80c: bf 4f sbci r27, 0xFF ; 255
}
if (diff < Offset) {
80e: 29 89 ldd r18, Y+17 ; 0x11
810: 3a 89 ldd r19, Y+18 ; 0x12
812: 4b 89 ldd r20, Y+19 ; 0x13
814: 5c 89 ldd r21, Y+20 ; 0x14
816: 82 17 cp r24, r18
818: 93 07 cpc r25, r19
81a: a4 07 cpc r26, r20
81c: b5 07 cpc r27, r21
81e: e4 f4 brge .+56 ; 0x858
RXFreq = RXCalc;
820: 29 86 std Y+9, r2 ; 0x09
822: 3a 86 std Y+10, r3 ; 0x0a
824: 4b 86 std Y+11, r4 ; 0x0b
826: 5c 86 std Y+12, r5 ; 0x0c
TXFreq = TXCalc;
828: 6d 86 std Y+13, r6 ; 0x0d
82a: 7e 86 std Y+14, r7 ; 0x0e
82c: 8f 86 std Y+15, r8 ; 0x0f
82e: 98 8a std Y+16, r9 ; 0x10
ActualChannel = Channel;
830: ed 82 std Y+5, r14 ; 0x05
832: fe 82 std Y+6, r15 ; 0x06
834: 0f 83 std Y+7, r16 ; 0x07
836: 18 87 std Y+8, r17 ; 0x08
FSep = CC1000ControlM_FSepTbl[i];
838: 2b 8d ldd r18, Y+27 ; 0x1b
83a: 3c 8d ldd r19, Y+28 ; 0x1c
83c: 20 50 subi r18, 0x00 ; 0
83e: 3f 4f sbci r19, 0xFF ; 255
840: f9 01 movw r30, r18
842: 20 81 ld r18, Z
844: 31 81 ldd r19, Z+1 ; 0x01
846: 2d 8f std Y+29, r18 ; 0x1d
848: 3e 8f std Y+30, r19 ; 0x1e
RefDiv = i + 6;
84a: fe 89 ldd r31, Y+22 ; 0x16
84c: fa 5f subi r31, 0xFA ; 250
84e: fd 8b std Y+21, r31 ; 0x15
Offset = diff;
850: 89 8b std Y+17, r24 ; 0x11
852: 9a 8b std Y+18, r25 ; 0x12
854: ab 8b std Y+19, r26 ; 0x13
856: bc 8b std Y+20, r27 ; 0x14
858: 2e 89 ldd r18, Y+22 ; 0x16
85a: 2f 5f subi r18, 0xFF ; 255
85c: 2e 8b std Y+22, r18 ; 0x16
85e: 4b 8d ldd r20, Y+27 ; 0x1b
860: 5c 8d ldd r21, Y+28 ; 0x1c
862: 4e 5f subi r20, 0xFE ; 254
864: 5f 4f sbci r21, 0xFF ; 255
866: 4b 8f std Y+27, r20 ; 0x1b
868: 5c 8f std Y+28, r21 ; 0x1c
86a: 89 8d ldd r24, Y+25 ; 0x19
86c: 9a 8d ldd r25, Y+26 ; 0x1a
86e: 02 96 adiw r24, 0x02 ; 2
870: 89 8f std Y+25, r24 ; 0x19
872: 9a 8f std Y+26, r25 ; 0x1a
874: 29 30 cpi r18, 0x09 ; 9
876: 08 f4 brcc .+2 ; 0x87a
878: 1f cf rjmp .-450 ; 0x6b8
}
}
if (RefDiv != 0) {
87a: 9d 89 ldd r25, Y+21 ; 0x15
87c: 99 23 and r25, r25
87e: 09 f4 brne .+2 ; 0x882
880: 60 c0 rjmp .+192 ; 0x942
CC1000ControlM_gCurrentParameters[0x3] = (uint8_t )(RXFreq & 0xFF);
882: a9 85 ldd r26, Y+9 ; 0x09
884: a0 93 6b 01 sts 0x016B, r26
CC1000ControlM_gCurrentParameters[0x2] = (uint8_t )((RXFreq >> 8) & 0xFF);
888: 29 85 ldd r18, Y+9 ; 0x09
88a: 3a 85 ldd r19, Y+10 ; 0x0a
88c: 4b 85 ldd r20, Y+11 ; 0x0b
88e: 5c 85 ldd r21, Y+12 ; 0x0c
890: bb 27 eor r27, r27
892: a5 2f mov r26, r21
894: 94 2f mov r25, r20
896: 83 2f mov r24, r19
898: 80 93 6a 01 sts 0x016A, r24
CC1000ControlM_gCurrentParameters[0x1] = (uint8_t )((RXFreq >> 16) & 0xFF);
89c: ca 01 movw r24, r20
89e: aa 27 eor r26, r26
8a0: bb 27 eor r27, r27
8a2: 80 93 69 01 sts 0x0169, r24
CC1000ControlM_gCurrentParameters[0x6] = (uint8_t )(TXFreq & 0xFF);
8a6: 3d 85 ldd r19, Y+13 ; 0x0d
8a8: 30 93 6e 01 sts 0x016E, r19
CC1000ControlM_gCurrentParameters[0x5] = (uint8_t )((TXFreq >> 8) & 0xFF);
8ac: 2d 85 ldd r18, Y+13 ; 0x0d
8ae: 3e 85 ldd r19, Y+14 ; 0x0e
8b0: 4f 85 ldd r20, Y+15 ; 0x0f
8b2: 58 89 ldd r21, Y+16 ; 0x10
8b4: bb 27 eor r27, r27
8b6: a5 2f mov r26, r21
8b8: 94 2f mov r25, r20
8ba: 83 2f mov r24, r19
8bc: 80 93 6d 01 sts 0x016D, r24
CC1000ControlM_gCurrentParameters[0x4] = (uint8_t )((TXFreq >> 16) & 0xFF);
8c0: ca 01 movw r24, r20
8c2: aa 27 eor r26, r26
8c4: bb 27 eor r27, r27
8c6: 80 93 6c 01 sts 0x016C, r24
CC1000ControlM_gCurrentParameters[0x8] = (uint8_t )(FSep & 0xFF);
8ca: 3d 8d ldd r19, Y+29 ; 0x1d
8cc: 30 93 70 01 sts 0x0170, r19
CC1000ControlM_gCurrentParameters[0x7] = (uint8_t )((FSep >> 8) & 0xFF);
8d0: 4d 8d ldd r20, Y+29 ; 0x1d
8d2: 5e 8d ldd r21, Y+30 ; 0x1e
8d4: 85 2f mov r24, r21
8d6: 99 27 eor r25, r25
8d8: 80 93 6f 01 sts 0x016F, r24
if (ActualChannel < 500000000) {
8dc: 8d 81 ldd r24, Y+5 ; 0x05
8de: 9e 81 ldd r25, Y+6 ; 0x06
8e0: af 81 ldd r26, Y+7 ; 0x07
8e2: b8 85 ldd r27, Y+8 ; 0x08
8e4: 80 30 cpi r24, 0x00 ; 0
8e6: e5 e6 ldi r30, 0x65 ; 101
8e8: 9e 07 cpc r25, r30
8ea: ed ec ldi r30, 0xCD ; 205
8ec: ae 07 cpc r26, r30
8ee: ed e1 ldi r30, 0x1D ; 29
8f0: be 07 cpc r27, r30
8f2: a8 f4 brcc .+42 ; 0x91e
if (ActualChannel < 400000000) {
8f4: 80 50 subi r24, 0x00 ; 0
8f6: 94 48 sbci r25, 0x84 ; 132
8f8: a7 4d sbci r26, 0xD7 ; 215
8fa: b7 41 sbci r27, 0x17 ; 23
8fc: 28 f4 brcc .+10 ; 0x908
CC1000ControlM_gCurrentParameters[0x9] = (8 << 4) | (1 << 2);
8fe: 84 e8 ldi r24, 0x84 ; 132
900: 80 93 71 01 sts 0x0171, r24
CC1000ControlM_gCurrentParameters[0x1d] = (9 << 4) | (1 << 0);
904: 81 e9 ldi r24, 0x91 ; 145
906: 04 c0 rjmp .+8 ; 0x910
}
else {
CC1000ControlM_gCurrentParameters[0x9] = (4 << 4) | (1 << 2);
908: 84 e4 ldi r24, 0x44 ; 68
90a: 80 93 71 01 sts 0x0171, r24
CC1000ControlM_gCurrentParameters[0x1d] = (8 << 4) | (1 << 0);
90e: 81 e8 ldi r24, 0x81 ; 129
910: 80 93 85 01 sts 0x0185, r24
}
CC1000ControlM_gCurrentParameters[0xa] = 1 << 1;
914: 82 e0 ldi r24, 0x02 ; 2
916: 80 93 72 01 sts 0x0172, r24
CC1000ControlM_gCurrentParameters[0x12] = 7 << 4;
91a: 80 e7 ldi r24, 0x70 ; 112
91c: 0a c0 rjmp .+20 ; 0x932
}
else {
CC1000ControlM_gCurrentParameters[0x9] = (8 << 4) | (3 << 2);
91e: 8c e8 ldi r24, 0x8C ; 140
920: 80 93 71 01 sts 0x0171, r24
CC1000ControlM_gCurrentParameters[0x1d] = (15 << 4) | (3 << 0);
924: 83 ef ldi r24, 0xF3 ; 243
926: 80 93 85 01 sts 0x0185, r24
CC1000ControlM_gCurrentParameters[0xa] = ((1 << 5) | (2 << 3)) | (
92a: 82 e3 ldi r24, 0x32 ; 50
92c: 80 93 72 01 sts 0x0172, r24
1 << 1);
CC1000ControlM_gCurrentParameters[0x12] = 2 << 4;
930: 80 e2 ldi r24, 0x20 ; 32
932: 80 93 7a 01 sts 0x017A, r24
}
CC1000ControlM_gCurrentParameters[0xc] = RefDiv << 3;
936: 2d 89 ldd r18, Y+21 ; 0x15
938: 22 0f add r18, r18
93a: 22 0f add r18, r18
93c: 22 0f add r18, r18
93e: 20 93 74 01 sts 0x0174, r18
}
CC1000ControlM_gCurrentChannel = ActualChannel;
942: 8d 81 ldd r24, Y+5 ; 0x05
944: 9e 81 ldd r25, Y+6 ; 0x06
946: af 81 ldd r26, Y+7 ; 0x07
948: b8 85 ldd r27, Y+8 ; 0x08
94a: 80 93 87 01 sts 0x0187, r24
94e: 90 93 88 01 sts 0x0188, r25
952: a0 93 89 01 sts 0x0189, r26
956: b0 93 8a 01 sts 0x018A, r27
return ActualChannel;
}
95a: bc 01 movw r22, r24
95c: cd 01 movw r24, r26
95e: 6e 96 adiw r28, 0x1e ; 30
960: 0f b6 in r0, 0x3f ; 63
962: f8 94 cli
964: de bf out 0x3e, r29 ; 62
966: 0f be out 0x3f, r0 ; 63
968: cd bf out 0x3d, r28 ; 61
96a: df 91 pop r29
96c: cf 91 pop r28
96e: 1f 91 pop r17
970: 0f 91 pop r16
972: ff 90 pop r15
974: ef 90 pop r14
976: df 90 pop r13
978: cf 90 pop r12
97a: bf 90 pop r11
97c: af 90 pop r10
97e: 9f 90 pop r9
980: 8f 90 pop r8
982: 7f 90 pop r7
984: 6f 90 pop r6
986: 5f 90 pop r5
988: 4f 90 pop r4
98a: 3f 90 pop r3
98c: 2f 90 pop r2
98e: 08 95 ret
00000990 <CC1000HPLInit>:
uint32_t CC1000ControlTuneManual(uint32_t DesiredFreq)
{
uint32_t actualFreq;
actualFreq = CC1000ControlComputeFreq(DesiredFreq);
CC1000ControlCC1000SetFreq();
return actualFreq;
}
void CC1000ControlCC1000SetModem(void)
{
CC1000HPLWrite(0x0F, CC1000ControlM_gCurrentParameters[0x0f]);
CC1000HPLWrite(0x10, CC1000ControlM_gCurrentParameters[0x10]);
CC1000HPLWrite(0x11, CC1000ControlM_gCurrentParameters[0x11]);
return;
}
result_t CC1000HPLInit(void)
{
OSH_MAKE_CC_CHP_OUT_INPUT();
990: 0e 94 9d 06 call 0xd3a
OSH_MAKE_CC_PALE_OUTPUT();
994: 0e 94 8b 06 call 0xd16
OSH_MAKE_CC_PCLK_OUTPUT();
998: 0e 94 87 06 call 0xd0e
OSH_MAKE_CC_PDATA_OUTPUT();
99c: 0e 94 89 06 call 0xd12
OSH_SET_CC_PALE_PIN();
9a0: 0e 94 d8 06 call 0xdb0
OSH_SET_CC_PDATA_PIN();
9a4: 0e 94 d6 06 call 0xdac
OSH_SET_CC_PCLK_PIN();
9a8: 0e 94 d4 06 call 0xda8
return SUCCESS;
}
9ac: 81 e0 ldi r24, 0x01 ; 1
9ae: 90 e0 ldi r25, 0x00 ; 0
9b0: 08 95 ret
000009b2 <CC1000HPLWrite>:
result_t CC1000ControlStdControlInit(void)
{
CC1000HPLInit();
CC1000HPLWrite(0x00, (((
1 << 5) | (1 << 4)) | (
1 << 3)) | (1 << 1));
CC1000HPLWrite(0x00, ((((
1 << 5) | (1 << 4)) | (
1 << 3)) | (1 << 1)) | (
1 << 0));
OSH_uwait(2000);
// CC1000ControlM_gCurrentParameters[0xb] = (8 << 4) | (0 << 0);
CC1000ControlM_gCurrentParameters[0xb] = 0xF0;
CC1000HPLWrite(0x0B, CC1000ControlM_gCurrentParameters[0xb]);
CC1000ControlM_gCurrentParameters[0xd] = 9 << 4;
CC1000HPLWrite(4, CC1000ControlM_gCurrentParameters[0xd]);
CC1000ControlM_gCurrentParameters[0xf] = 0;
CC1000ControlM_gCurrentParameters[0x10] = (((3 << 5) | (1 << 3)) | (
3 << 1)) | (1 << 0);
CC1000ControlM_gCurrentParameters[0x11] = ((5 << 4) | (1 << 2)) | (
1 << 0);
CC1000ControlCC1000SetModem();
CC1000ControlM_gCurrentParameters[0x13] = 1 << 0;
CC1000HPLWrite(0x13, CC1000ControlM_gCurrentParameters[0x13]);
CC1000ControlM_gCurrentParameters[0x1e] = TRUE;
CC1000ControlTuneManual(433300000);//914998000
return SUCCESS;
}
result_t CC1000ControlBIASOn(void)
{
CC1000HPLWrite(0x00, (((
1 << 5) | (1 << 4)) | (
1 << 3)) | (
1 << 0));
OSH_uwait(200);
return SUCCESS;
}
result_t CC1000ControlStdControlStart(void)
{
CC1000HPLWrite(0x00, ((((
1 << 5) | (1 << 4)) | (
1 << 3)) | (1 << 1)) | (
1 << 0));
OSH_uwait(2000);
return SUCCESS;
}
result_t CC1000ControlTxMode(void)
{
CC1000HPLWrite(0x00, (((
1 << 7) | (1 << 6)) | (1 << 5)) | (
1 << 0));
CC1000HPLWrite(0x09, CC1000ControlM_gCurrentParameters[29]);
OSH_uwait(250);
CC1000HPLWrite(0x0B, CC1000ControlM_gCurrentParameters[0xb]);
OSH_uwait(20);
return SUCCESS;
}
result_t CC1000ControlRxMode(void)
{
CC1000HPLWrite(0x00, (
1 << 4) | (1 << 0));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -