main.asm
来自「ADI公司SHARC与BlackFin通过SPI协议相互通信的源代码」· 汇编 代码 · 共 109 行
ASM
109 行
/*****************************************************************************
** **
** Name: BF537 SPI SLAVE **
** **
******************************************************************************
(C) Copyright 2006-2008 - Analog Devices, Inc. All rights reserved.
Project Name: BF537_SPI_SLAVE
Date Modified: 05/07/2008 v1.0
History: 09/11/2006 initial version
Tested
Software: VisualDSP++ 5.0 (Update 2)
Hint: Optimized for VisualDSP++ 5.0.0.0 and above
Tested
Hardware: ADSP-BF537 EZ-KIT Lite Rev. 1.3 Silicon Rev. 0.2
ADSP-BF537 EZ-KIT Lite Rev. 2.2 Silicon Rev. 0.3
Supported
Plattforms: ADSP-BF537 EZ-KIT Lite
Connections: ADDS-HPUSB-ICE
Settings: Default
Purpose: Communication between two ADSP-BF537 EZ-KIT Lite via SPI
Single Master <-> Single Slave Environment
One Master, initializing data transfer, drives SSEL and SCLK
One Slave, receiving/transmitting data
All relevant settings are done in 'configurations.h'
All supported modes are described in 'configurations.h'
*****************************************************************************/
/****************************************************************************
Include Section
*****************************************************************************/
#include "global.h"
#include "INIT.h"
#include "SPI.h"
#include "data.h"
/*****************************************************************************
Prototypes
******************************************************************************/
.GLOBAL _main;
/****************************************************************************
Main Program
*****************************************************************************/
.SECTION L1_code;
_main:
call __clear_reg;
call __gpio_ports_setup;
call __interrupts_setup;
START:
#if defined SPI_MODE_TRC /* Transmit->Receive->Compare */
call __spi_run_tx;
call __spi_run_rx;
IMM32(I0,rx_buf);IMM32(I1,tx_buf);IMM32(P5,n);
call __compare;
#endif
#if defined SPI_MODE_RCT /* Receive->Cop->Transmit */
call __spi_run_rx;
IMM32(I0,rx_buf);IMM32(I1,tx_buf);IMM32(P5,n);
call __copy;
call __spi_run_tx;
#endif
#if defined SPI_TRANSMIT
call __spi_run_tx;
#endif
#if defined SPI_RECEIVE
call __spi_run_rx;
IMM32(I0,rx_buf);IMM32(I1,tx_buf);IMM32(P5,n);
call __compare;
#endif
R4 += 1;
call __led_all_blink_inf;
EMUEXCPT; nop;
jump START;
again: jump again;
_main.end:
/*****************************************************************************
EOF
******************************************************************************/
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?