?? ci_config.s
字號(hào):
.module CI_Config.c
.area text(rom, con, rel)
.dbfile O:\2007全國(guó)電子設(shè)計(jì)大賽\鍵盤顯示模塊\CI_Config.c
.dbfunc e MSG_Map_CommunicationInterface_INIT _MSG_Map_CommunicationInterface_INIT fV
.dbstruct 0 3 MsgMapItem
.dbfield 0 cCMD c
.dbfield 1 pMsgFunc pfc
.dbend
.dbstruct 0 3 MsgMap
.dbfield 0 cItemCount c
.dbfield 1 pMsgItems pS[MsgMapItem]
.dbend
; pMsgMap -> R16,R17
; Reg2 -> R10,R11
; n1 -> R18
.even
_MSG_Map_CommunicationInterface_INIT::
st -y,R10
st -y,R11
.dbline -1
.dbline 77
; /***********************************************************
; * 函數(shù)庫(kù)說(shuō)明:指令解析系統(tǒng)函數(shù)庫(kù) *
; * 版本: v0.30 *
; * 作者: 王卓然 *
; * 創(chuàng)建日期: 2007年9月02日 *
; * -------------------------------------------------------- *
; * [支 持 庫(kù)] *
; * 支持庫(kù)名稱: *
; * 需要版本: *
; * 聲明庫(kù)說(shuō)明: *
; * -------------------------------------------------------- *
; * [版本更新] *
; * 修改: *
; * 修改日期: *
; * 版本: *
; * -------------------------------------------------------- *
; * [版本歷史] *
; * -------------------------------------------------------- *
; * [使用說(shuō)明] *
; ***********************************************************/
;
; /********************
; * 頭 文 件 配 置 區(qū) *
; ********************/
; # include "RD_MacroAndConst.h"
; # include "CI_Config.h"
; # include "LIB_Config.h"
; # include "RD_ADT_QUEUE.h"
; # include "RD_ADT_MSGMap.h"
; # include "RD_UseSerialFrame_PROC.h"
; # include "CI_MSGMap.h"
;
; /********************
; * 系 統(tǒng) 宏 定 義 *
; ********************/
;
; /*------------------*
; * 常 數(shù) 宏 定 義 *
; *------------------*/
;
; /*------------------*
; * 動(dòng) 作 宏 定 義 *
; *------------------*/
;
; /********************
; * 用戶變量類型定義 *
; ********************/
;
; /********************
; * 結(jié)構(gòu)體定義區(qū) *
; ********************/
;
; /********************
; * 模塊函數(shù)聲明區(qū) *
; ********************/
; void Communication_INIT(void);
; BOOL Send_MSG(uint8 cCMD,uint8 *pData,uint8 Length);
; BOOL Serial_Frame_Process_Refresh(void);
;
; /********************
; * 全局函數(shù)聲明區(qū) *
; ********************/
;
; /********************
; * 模塊變量聲明區(qū) *
; ********************/
;
; /********************
; * 全局變量聲明區(qū) *
; ********************/
;
; /********************
; * 自定義數(shù)據(jù)結(jié)構(gòu)區(qū) *
; ********************/
;
; //機(jī)器人平臺(tái)
; START_DEFINE_MSG_MAP(CommunicationInterface,4)
.dbline 77
.dbline 77
ldi R16,<_MSGMapCommunicationInterface
ldi R17,>_MSGMapCommunicationInterface
.dbline 77
ldi R24,<_MSGMapCommunicationInterfaceItemArray
ldi R25,>_MSGMapCommunicationInterfaceItemArray
movw R30,R16
std z+2,R25
std z+1,R24
.dbline 77
ldi R24,4
std z+0,R24
.dbline 77
clr R18
xjmp L5
L2:
.dbline 77
.dbline 77
ldi R24,3
mul R24,R18
movw R10,R0
ldi R24,<_MSGMapCommunicationInterfaceItemArray
ldi R25,>_MSGMapCommunicationInterfaceItemArray
movw R30,R10
add R30,R24
adc R31,R25
clr R2
std z+0,R2
.dbline 77
ldi R24,<_MSGMapCommunicationInterfaceItemArray+1
ldi R25,>_MSGMapCommunicationInterfaceItemArray+1
movw R30,R10
add R30,R24
adc R31,R25
ldi R24,<PL_MSG_NULL_PROC
ldi R25,>PL_MSG_NULL_PROC
std z+1,R25
std z+0,R24
.dbline 77
L3:
.dbline 77
inc R18
L5:
.dbline 77
cpi R18,4
brlo L2
X0:
.dbline 77
.dbline 78
; ADD_NEW_MSG_MAP_ITEM(CMD_ACK,PROC_Acknowledge)
movw R30,R16
ldd R2,z+0
clr R3
cp R3,R2
brsh L7
X1:
.dbline 78
.dbline 78
clr R4
clr R5
ldd R2,z+1
ldd R3,z+2
movw R30,R4
add R30,R2
adc R31,R3
ldi R24,172
std z+0,R24
.dbline 78
movw R30,R16
ldd R2,z+1
ldd R3,z+2
movw R30,R4
add R30,R2
adc R31,R3
ldi R24,<PL_PROC_Acknowledge
ldi R25,>PL_PROC_Acknowledge
std z+2,R25
std z+1,R24
.dbline 78
.dbline 78
L7:
.dbline -2
L1:
.dbline 0 ; func end
ld R11,y+
ld R10,y+
ret
.dbsym r pMsgMap 16 pS[MsgMap]
.dbsym r Reg2 10 S
.dbsym r n1 18 c
.dbend
.dbfunc e SFP_CommunicationShell_INIT _SFP_CommunicationShell_INIT fV
.dbstruct 0 18 AbstructDataTypeQueue
.dbfield 0 pBuffer pc
.dbfield 2 nSize i
.dbfield 4 nHead i
.dbfield 6 nTail i
.dbfield 8 nCount i
.dbfield 10 fnAddToBuffer pfc
.dbfield 12 fnGetFromBuffer pfc
.dbfield 14 fnCheckEmpty pfc
.dbfield 16 fnPeekFromBuffer pfc
.dbend
.dbstruct 0 4 MsgItem
.dbfield 0 cCMD c
.dbfield 1 cDataLength c
.dbfield 2 pData pc
.dbend
.dbstruct 0 37 SerialFrameProcess
.dbfield 0 FrameBuffer S[AbstructDataTypeQueue]
.dbfield 18 pMsgMap pS[MsgMap]
.dbfield 20 MsgItem S[MsgItem]
.dbfield 24 cHeadByte c
.dbfield 25 cEndByte c
.dbfield 26 cFixLength c
.dbfield 27 cAddress c
.dbfield 28 InputDataFunc pfc
.dbfield 30 OutputDataFunc pfc
.dbfield 32 PeekDataFunc pfc
.dbfield 34 cActionFlag c
.dbfield 35 cXORCheck c
.dbfield 36 cFrameSize c
.dbend
; pSFP -> R16,R17
.even
_SFP_CommunicationShell_INIT::
.dbline -1
.dbline 81
; END_DEFINE_MSG_MAP
;
; START_DEFINE_SERIAL_FRAME_PROCESS(CommunicationShell,16,MSG_MAP(CommunicationInterface))
.dbline 81
ldi R16,<_SFPCommunicationShell
ldi R17,>_SFPCommunicationShell
.dbline 81
ldi R24,<_MSGMapCommunicationInterface
ldi R25,>_MSGMapCommunicationInterface
movw R30,R16
std z+19,R25
std z+18,R24
.dbline 81
.dbline 81
ldi R24,<_SFPCommunicationShellBuffer
ldi R25,>_SFPCommunicationShellBuffer
sts _SFPCommunicationShell+1,R25
sts _SFPCommunicationShell,R24
.dbline 81
ldi R24,16
ldi R25,0
sts _SFPCommunicationShell+2+1,R25
sts _SFPCommunicationShell+2,R24
.dbline 81
clr R2
clr R3
sts _SFPCommunicationShell+4+1,R3
sts _SFPCommunicationShell+4,R2
.dbline 81
sts _SFPCommunicationShell+6+1,R3
sts _SFPCommunicationShell+6,R2
.dbline 81
sts _SFPCommunicationShell+8+1,R3
sts _SFPCommunicationShell+8,R2
.dbline 81
ldi R24,<PL_ADT_Queue_Add_To_Buffer
ldi R25,>PL_ADT_Queue_Add_To_Buffer
sts _SFPCommunicationShell+10+1,R25
sts _SFPCommunicationShell+10,R24
.dbline 81
ldi R24,<PL_ADT_Queue_Get_From_Buffer
ldi R25,>PL_ADT_Queue_Get_From_Buffer
sts _SFPCommunicationShell+12+1,R25
sts _SFPCommunicationShell+12,R24
.dbline 81
ldi R24,<PL_ADT_Queue_Check_Empty
ldi R25,>PL_ADT_Queue_Check_Empty
sts _SFPCommunicationShell+14+1,R25
sts _SFPCommunicationShell+14,R24
.dbline 81
ldi R24,<PL_ADT_Queue_Peek_From_Buffer
ldi R25,>PL_ADT_Queue_Peek_From_Buffer
sts _SFPCommunicationShell+16+1,R25
sts _SFPCommunicationShell+16,R24
.dbline 81
.dbline 81
ldi R24,<_SFPCommunicationShellMsgItem
ldi R25,>_SFPCommunicationShellMsgItem
std z+23,R25
std z+22,R24
.dbline 81
ldi R24,170
std z+24,R24
.dbline 81
ldi R24,85
std z+25,R24
.dbline 81
std z+26,R2
.dbline 81
std z+27,R2
.dbline 81
std z+34,R2
.dbline 81
std z+35,R2
.dbline 81
std z+36,R2
.dbline 81
ldi R24,<PL_SFP_NULL_Input_Data_Function
ldi R25,>PL_SFP_NULL_Input_Data_Function
std z+29,R25
std z+28,R24
.dbline 81
ldi R24,<PL_SFP_NULL_Output_Data_Function
ldi R25,>PL_SFP_NULL_Output_Data_Function
std z+31,R25
std z+30,R24
.dbline 81
ldi R24,<PL_SFP_NULL_Peek_Data_Function
ldi R25,>PL_SFP_NULL_Peek_Data_Function
std z+33,R25
std z+32,R24
.dbline 83
;
; SET_INPUT_DATA_FUNCTION(UARTgetDataFromRxBuff)
ldi R24,<PL_UARTgetDataFromRxBuff
ldi R25,>PL_UARTgetDataFromRxBuff
std z+29,R25
std z+28,R24
.dbline 84
; SET_OUTPUT_DATA_FUNCTION(UARTaddDataToTxBuff)
ldi R24,<PL_UARTaddDataToTxBuff
ldi R25,>PL_UARTaddDataToTxBuff
std z+31,R25
std z+30,R24
.dbline 85
; SET_PEEK_DATA_FUNCTION(UARTPeekDataFromRxBuff)
ldi R24,<PL_UARTPeekDataFromRxBuff
ldi R25,>PL_UARTPeekDataFromRxBuff
std z+33,R25
std z+32,R24
.dbline -2
L9:
.dbline 0 ; func end
ret
.dbsym r pSFP 16 pS[SerialFrameProcess]
.dbend
.dbfunc e Communication_INIT _Communication_INIT fV
.even
_Communication_INIT::
.dbline -1
.dbline 96
;
; END_DEFINE_SERIAL_FRAME_PROCESS
;
; /***********************************************************
; * 函數(shù)說(shuō)明:指令解析系統(tǒng)初始化函數(shù) *
; * 輸入: 無(wú) *
; * 輸出: 無(wú) *
; * 調(diào)用函數(shù):無(wú) *
; ***********************************************************/
; void Communication_INIT(void)
; {
.dbline 97
; INIT_MSG_MAP(CommunicationInterface)
xcall _MSG_Map_CommunicationInterface_INIT
.dbline 98
; INIT_SERIAL_FRAME_PROCESS(CommunicationShell)
xcall _SFP_CommunicationShell_INIT
.dbline -2
L18:
.dbline 0 ; func end
ret
.dbend
.dbfunc e Send_MSG _Send_MSG fc
; Length -> y+7
; pData -> R12,R13
; cCMD -> R10
.even
_Send_MSG::
xcall push_xgset003C
movw R12,R18
mov R10,R16
sbiw R28,3
.dbline -1
.dbline 108
; }
;
; /***********************************************************
; * 函數(shù)說(shuō)明:消息發(fā)送函數(shù) *
; * 輸入: 指令,要發(fā)送的數(shù)據(jù),數(shù)據(jù)的長(zhǎng)度 *
; * 輸出: 指令是否發(fā)送成功 *
; * 調(diào)用函數(shù):SPF_Send_MSG() *
; ***********************************************************/
; BOOL Send_MSG(uint8 cCMD,uint8 *pData,uint8 Length)
; {
.dbline 109
; return SPF_Send_MSG
ldd R0,y+7
std y+2,R0
std y+1,R13
std y+0,R12
mov R18,R10
ldi R16,<_SFPCommunicationShell
ldi R17,>_SFPCommunicationShell
xcall _SPF_Send_MSG
.dbline -2
L19:
.dbline 0 ; func end
adiw R28,3
xjmp pop_xgset003C
.dbsym l Length 7 c
.dbsym r pData 12 pc
.dbsym r cCMD 10 c
.dbend
.dbfunc e Serial_Frame_Process_Refresh _Serial_Frame_Process_Refresh fc
.even
_Serial_Frame_Process_Refresh::
.dbline -1
.dbline 125
; (
; &SERIAL_FRAME_PROC(CommunicationShell),
; cCMD,
; pData,
; Length
; );
; }
;
; /***********************************************************
; * 函數(shù)說(shuō)明:下位機(jī)指令系統(tǒng)進(jìn)程 *
; * 輸入: 無(wú) *
; * 輸出: 恒為TRUE *
; * 調(diào)用函數(shù):SERIAL_FRAME_PROCESS(RobotPlatformShell) *
; ***********************************************************/
; BOOL Serial_Frame_Process_Refresh(void)
; {
.dbline 128
; //SERIAL_FRAME_PROCESS(CommunicationShell);
;
; return TRUE;
ldi R16,1
.dbline -2
L20:
.dbline 0 ; func end
ret
.dbend
.area bss(ram, con, rel)
.dbfile O:\2007全國(guó)電子設(shè)計(jì)大賽\鍵盤顯示模塊\CI_Config.c
_SFPCommunicationShellMsgItem::
.blkb 16
.dbsym e SFPCommunicationShellMsgItem _SFPCommunicationShellMsgItem A[16:16]c
_SFPCommunicationShellBuffer::
.blkb 16
.dbsym e SFPCommunicationShellBuffer _SFPCommunicationShellBuffer A[16:16]c
_SFPCommunicationShell::
.blkb 37
.dbsym e SFPCommunicationShell _SFPCommunicationShell S[SerialFrameProcess]
_MSGMapCommunicationInterfaceItemArray::
.blkb 12
.dbsym e MSGMapCommunicationInterfaceItemArray _MSGMapCommunicationInterfaceItemArray A[12:4]S[MsgMapItem]
_MSGMapCommunicationInterface::
.blkb 3
.dbsym e MSGMapCommunicationInterface _MSGMapCommunicationInterface S[MsgMap]
; }
.area func_lit
PL_UARTPeekDataFromRxBuff: .word `_UARTPeekDataFromRxBuff
PL_UARTaddDataToTxBuff: .word `_UARTaddDataToTxBuff
PL_UARTgetDataFromRxBuff: .word `_UARTgetDataFromRxBuff
PL_SFP_NULL_Peek_Data_Function: .word `_SFP_NULL_Peek_Data_Function
PL_SFP_NULL_Output_Data_Function: .word `_SFP_NULL_Output_Data_Function
PL_SFP_NULL_Input_Data_Function: .word `_SFP_NULL_Input_Data_Function
PL_ADT_Queue_Peek_From_Buffer: .word `_ADT_Queue_Peek_From_Buffer
PL_ADT_Queue_Check_Empty: .word `_ADT_Queue_Check_Empty
PL_ADT_Queue_Get_From_Buffer: .word `_ADT_Queue_Get_From_Buffer
PL_ADT_Queue_Add_To_Buffer: .word `_ADT_Queue_Add_To_Buffer
PL_PROC_Acknowledge: .word `_PROC_Acknowledge
PL_MSG_NULL_PROC: .word `_MSG_NULL_PROC
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -