⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.s

📁 我写的atmega16驱动的nrf24l01程序
💻 S
📖 第 1 页 / 共 4 页
字号:
	inc R20
L37:
	.dbline 11
	cp R20,R22
	brlo L34
	.dbline 18
	sbi 0x18,4
	.dbline 19
	clr R2
	sts _bSpiTxing,R2
	.dbline -2
	.dbline 20
L33:
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbsym r No 22 c
	.dbsym r nrfRxBuf 18 pc
	.dbsym r nrfTxBuf 16 pc
	.dbend
	.dbfunc e nRF_SendData _nRF_SendData fV
;         Length -> R20
	.even
_nRF_SendData::
	xcall push_gset1
	mov R20,R16
	sbiw R28,1
	.dbline -1
	.dbline 28
	.dbline 29
	ldi R24,32
	sts _nrfTxBuf,R24
	.dbline 30
	ldi R24,14
	sts _nrfTxBuf+1,R24
	.dbline 31
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 33
	ldi R24,160
	sts _nrfTxDataBuf,R24
	.dbline 34
	std y+0,R20
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxDataBuf
	ldi R17,>_nrfTxDataBuf
	xcall _SPI_SendData
	.dbline 36
	ldi R24,39
	sts _nrfTxBuf,R24
	.dbline 37
	ldi R24,112
	sts _nrfTxBuf+1,R24
	.dbline 38
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 40
	sbi 0x15,2
	.dbline 42
	sbi 0x18,3
	.dbline 43
	nop
	.dbline 43
	nop
	.dbline 43
	nop
	.dbline 43
	nop
	.dbline 44
	nop
	.dbline 44
	nop
	.dbline 44
	nop
	.dbline 44
	nop
	.dbline 45
	nop
	.dbline 45
	nop
	.dbline 45
	nop
	.dbline 45
	nop
	.dbline 46
	nop
	.dbline 46
	nop
	.dbline 46
	nop
	.dbline 46
	nop
	.dbline 47
	cbi 0x18,3
	.dbline -2
	.dbline 48
L41:
	adiw R28,1
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r Length 20 c
	.dbend
	.dbfunc e nrf24l01_init _nrf24l01_init fV
	.even
_nrf24l01_init::
	sbiw R28,1
	.dbline -1
	.dbline 56
	.dbline 58
	ldi R24,85
	sts _bBusy,R24
	.dbline 68
	ldi R24,33
	sts _nrfTxBuf,R24
	.dbline 69
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,255  ; offset = 1
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 70
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 72
	ldi R24,34
	sts _nrfTxBuf,R24
	.dbline 73
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 74
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 76
	ldi R24,35
	sts _nrfTxBuf,R24
	.dbline 77
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,253  ; offset = 3
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 78
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 80
	ldi R24,36
	sts _nrfTxBuf,R24
	.dbline 81
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,252  ; offset = 4
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 82
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 84
	ldi R24,37
	sts _nrfTxBuf,R24
	.dbline 85
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,251  ; offset = 5
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 86
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 88
	ldi R24,38
	sts _nrfTxBuf,R24
	.dbline 90
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,250  ; offset = 6
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 91
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 93
	ldi R24,39
	sts _nrfTxBuf,R24
	.dbline 94
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,249  ; offset = 7
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 95
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 97
	ldi R24,42
	sts _nrfTxBuf,R24
	.dbline 98
	ldi R16,<_II2C_RxPipe0Addr
	ldi R17,>_II2C_RxPipe0Addr
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 99
	ldi R16,<_II2C_RxPipe0Addr
	ldi R17,>_II2C_RxPipe0Addr
	subi R16,255  ; offset = 1
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+2,R16
	.dbline 100
	ldi R16,<_II2C_RxPipe0Addr
	ldi R17,>_II2C_RxPipe0Addr
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+3,R16
	.dbline 101
; }
	ldi R16,<_II2C_RxPipe0Addr
	ldi R17,>_II2C_RxPipe0Addr
	subi R16,253  ; offset = 3
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+4,R16
	.dbline 102
; }
	ldi R16,<_II2C_RxPipe0Addr
	ldi R17,>_II2C_RxPipe0Addr
	subi R16,252  ; offset = 4
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+5,R16
	.dbline 103
; }
	ldi R24,6
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 105
; }
; }
	ldi R24,43
	sts _nrfTxBuf,R24
	.dbline 106
; }
	ldi R16,<_II2C_RxPipe1Addr
	ldi R17,>_II2C_RxPipe1Addr
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 107
; }
	ldi R16,<_II2C_RxPipe1Addr
	ldi R17,>_II2C_RxPipe1Addr
	subi R16,255  ; offset = 1
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+2,R16
	.dbline 108
; }
	ldi R16,<_II2C_RxPipe1Addr
	ldi R17,>_II2C_RxPipe1Addr
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+3,R16
	.dbline 109
; }
	ldi R16,<_II2C_RxPipe1Addr
	ldi R17,>_II2C_RxPipe1Addr
	subi R16,253  ; offset = 3
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+4,R16
	.dbline 110
; }
	ldi R16,<_II2C_RxPipe1Addr
	ldi R17,>_II2C_RxPipe1Addr
	subi R16,252  ; offset = 4
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+5,R16
	.dbline 111
; }
	ldi R24,6
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 113
; }
; }
	ldi R24,44
	sts _nrfTxBuf,R24
	.dbline 114
; }
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,244  ; offset = 12
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 115
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 117
; }
; }
	ldi R24,45
	sts _nrfTxBuf,R24
	.dbline 118
; }
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,243  ; offset = 13
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 119
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 120
; }
	ldi R24,46
	sts _nrfTxBuf,R24
	.dbline 121
; }
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,242  ; offset = 14
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 122
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 123
; }
	ldi R24,47
	sts _nrfTxBuf,R24
	.dbline 124
; }
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,241  ; offset = 15
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 125
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 127
; }
; }
	ldi R24,48
	sts _nrfTxBuf,R24
	.dbline 128
; }
	ldi R16,<_II2C_TxPipeAddr
	ldi R17,>_II2C_TxPipeAddr
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 129
; }
	ldi R16,<_II2C_TxPipeAddr
	ldi R17,>_II2C_TxPipeAddr
	subi R16,255  ; offset = 1
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+2,R16
	.dbline 130
; }
	ldi R16,<_II2C_TxPipeAddr
	ldi R17,>_II2C_TxPipeAddr
	subi R16,254  ; offset = 2
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+3,R16
	.dbline 131
; }
	ldi R16,<_II2C_TxPipeAddr
	ldi R17,>_II2C_TxPipeAddr
	subi R16,253  ; offset = 3
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+4,R16
	.dbline 132
; }
	ldi R16,<_II2C_TxPipeAddr
	ldi R17,>_II2C_TxPipeAddr
	subi R16,252  ; offset = 4
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+5,R16
	.dbline 133
; }
	ldi R24,6
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 135
; }
; }
	ldi R24,49
	sts _nrfTxBuf,R24
	.dbline 136
; }
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	subi R16,239  ; offset = 17
	sbci R17,255
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 137
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 139
; }
; }
	ldi R24,32
	sts _nrfTxBuf,R24
	.dbline 140
; }
	ldi R16,<_II2C_UserConfig
	ldi R17,>_II2C_UserConfig
	xcall _EEPROMread
	sts _nrfTxBuf+1,R16
	.dbline 141
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 144
; }
; }
; }
	cbi 0x15,2
	.dbline 146
; }
; }
	ldi R24,225
	sts _nrfTxBuf,R24
	.dbline 147
; }
	ldi R24,1
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 149
; }
; }
	ldi R24,226
	sts _nrfTxBuf,R24
	.dbline 150
; }
	ldi R24,1
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 152
; }
; }
	clr R2
	sts _bBusy,R2
	.dbline -2
	.dbline 153
; }
L44:
	adiw R28,1
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e SetRxMode _SetRxMode fV
	.even
_SetRxMode::
	sbiw R28,1
	.dbline -1
	.dbline 158
; }
; }
; }
; }
; }
	.dbline 159
; }
	ldi R24,85
	sts _bBusy,R24
	.dbline 161
; }
; }
	ldi R24,32
	sts _nrfTxBuf,R24
	.dbline 162
; }
	ldi R24,15
	sts _nrfTxBuf+1,R24
	.dbline 163
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 165
; }
; }
	ldi R24,225
	sts _nrfTxBuf,R24
	.dbline 166
; }
	ldi R24,1
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 168
; }
; }
	sbi 0x18,3
	.dbline 170
; }
; }
	nop
	.dbline 170
	nop
	.dbline 170
	nop
	.dbline 171
; }
	cbi 0x15,2
	.dbline 172
; }
	clr R2
	sts _bBusy,R2
	.dbline -2
	.dbline 173
; }
L73:
	adiw R28,1
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e SetTxMode _SetTxMode fV
	.even
_SetTxMode::
	sbiw R28,1
	.dbline -1
	.dbline 183
; }
; }
; }
; }
; }
; }
; }
; }
; }
; }
	.dbline 184
; }
	ldi R24,85
	sts _bBusy,R24
	.dbline 186
; }
; }
	ldi R24,32
	sts _nrfTxBuf,R24
	.dbline 187
; }
	ldi R24,14
	sts _nrfTxBuf+1,R24
	.dbline 188
; }
	ldi R24,2
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 190
; }
; }
	ldi R24,225
	sts _nrfTxBuf,R24
	.dbline 191
; }
	ldi R24,1
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 193
; }
; }
	sbi 0x15,2
	.dbline 194
; }
	clr R2
	sts _bBusy,R2
	.dbline -2
	.dbline 195
; }
L75:
	adiw R28,1
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e SendTest _SendTest fV
;              i -> R20
	.even
_SendTest::
	xcall push_gset1
	sbiw R28,1
	.dbline -1
	.dbline 204
; }
; }
; }
; }
; }
; }
; }
; }
; }
	.dbline 207
; }
; }
; }
	ldi R24,225
	sts _nrfTxBuf,R24
	.dbline 208
; }
	ldi R24,1
	std y+0,R24
	ldi R18,<_nrfRxBuf
	ldi R19,>_nrfRxBuf
	ldi R16,<_nrfTxBuf
	ldi R17,>_nrfTxBuf
	xcall _SPI_SendData
	.dbline 210
; }
; }
	ldi R20,1
	xjmp L81
L78:
	.dbline 211
	.dbline 212
	ldi R24,<_nrfTxDataBuf
	ldi R25,>_nrfTxDataBuf
	mov R30,R20
	clr R31
	add R30,R24
	adc R31,R25
	std z+0,R20
	.dbline 213
L79:
	.dbline 210
	inc R20
L81:
	.dbline 210
	cpi R20,33
	brlo L78
	.dbline 214
; }
; }
; }
; }
	ldi R16,33
	xcall _nRF_SendData
	.dbline -2
	.dbline 215
; }
L77:
	adiw R28,1
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c
	.dbend
	.dbfunc e ReadRegisters _ReadRegisters fV
;              i -> R20
;             pt -> R22,R23
;              k -> R10
;              j -> R12
	.even
_ReadRegisters::
	xcall push_gset4
	sbiw R28,1
	.dbline -1
	.dbline 220
; }
; }
; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -