📄 5800.asm
字号:
include "5800.inc"
;===============================================
; Function:FmTune check fm Frequency
;===============================================
FmTune:
call I2cStart
; Device Id : (A = I2cDevId)
mov A,@0x20
call I2cSendByte
call I2cGetAck
jbs A_buff,ACK
jmp FmTuneDone1
mov a,Rd5800_Reg_02H
call I2cSendByte
call I2cGetAck
jbs A_buff,ACK
jmp FmTuneDone1
mov a,Rd5800_Reg_02L
call I2cSendByte
call I2cGetAck
jbs A_buff,ACK
jmp FmTuneDone1
mov a,Rd5800_Channel
call I2cSendByte
call I2cGetAck
jbs A_buff,ACK
jmp FmTuneDone1
mov a,Rd5800_Reg_03L
call I2cSendByte
call I2cGetAck
jbs A_buff,ACK
jmp FmTuneDone1
FmTuneDone1:
call I2cStop
mov A,A_buff
ret
;===============================================
; Function:5800_init_I2c(I2cAddr,I2cData)
;===============================================
R5800_Init_I2c:
call I2cStart
; Device Id : (A = I2cDevId)
mov A,@0x20
call I2cSendByte
call I2cGetAck
jbs A_buff,ACK
jmp I2cWriteDone1
mov a,@0x00
mov I2cAddr,a
con_init_i2c:
mov a,I2cAddr
call TblFmDefault_bal
call I2cSendByte
call I2cGetAck
jbs A_buff,ACK
jmp I2cWriteDone1
inc I2cAddr
mov a,I2cAddr
sub a,@0x56
jbs FLAG,@Z
jmp con_init_i2c
; return true!
mov A,@1
NOP
I2cWriteDone1:
call I2cStop
mov A,A_buff
ret
;===============================================
; Function:SetFmMode(A=FM_MODE)
;===============================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -