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

📄 bf533_ez-kit_omnivision_config.asm

📁 ADI BLACKFIN BF533 的IIC驱动程序
💻 ASM
字号:
/******************************************************************************/
//
// Name: BF533 EZ-KIT video ITU-656 receive mode (8bit) for the Omnivision chip OV6630
//
/*****************************************************************************************

(C) Copyright 2003 - Analog Devices, Inc.  All rights reserved.

File Name:				BF533_EZ-KIT_Omnivision_Config.asm

Date Modified:			01/08/07		TL		Rev 2.0

Software:       		VisualDSP++4.5, Assembler 1.1.0.2, Linker 3.8.0.2

Hardware:				BF533 EZ-KIT Board (rev 1.2), Blackfin EZ-Extender (rev 1.2)

Chip:					ADSP-BF533 REV 0.2

Special Connections:  	None

Purpose:				To configure the Omnivision devices via I2C
				
				
Program Parameters:

************************************************************************************************/

#include <defBF533.h>
					

/*****************************************************************************************/
// Global and extern subroutines
/*****************************************************************************************/
.global		Config_of_Omnivision;
.extern		SCCB_Control;
.extern		SCCB_Word_Count;
.extern		SCCB_DataIn;				
.extern		SCCB_DataOut;				
.extern     SCCB_Interface;
.extern     SCCB_Read_Count;
.extern		SCCB_In_Progress;

/****************************************************************/
// Program Define Section
/****************************************************************/

#define rd_cmd				0x1				// sccb interface read command
#define wr_cmd				0x2				// sccb inteface write command
#define Omnivision_WR		0xC0			// Device address to write to the chip
#define Omnivision_RD		0xC1			// Device address to read from the chip
#define dummy_addr			0x14			// dummy read to check the ACK
#define Omni_COMB			0x13			// Register address to change output format
#define Omni_8bit_Mode		0x21
#define Omni_8bit_Mode_ITU	0x31
#define Omni_16bit_Mode_ITU	0x11
#define Omni_16bit_Mode		0x01
#define dummy				0x0        


/*************** SCCB Start Settings**************************************/
/*Before Calling the SCCB_Interface the inputs to the SCCB_Taskmanager 	 */
/*must be done. 														 */
/* Write to the "SCCB_Control" a "1" for reading from the Device or 	 */
/* a "2" for writing to the Device.										 */
/*																		 */
/* Leave the number of bytes totaly in "SCCB_Wordcount". Device Addresses*/
/* and Word Addresses included.											 */
/*																		 */
/* Write all data to the "SCCB_DataIn". 								 */
/* e.g.Writing to the device:											 */
/*																		 */
/*			SCCB_DataIn 			Device Address	(LSB must be Zero)	 */
/*									Word Address						 */
/*									Data 1								 */
/*									  .									 */
/*									  .									 */
/*************************************************************************/
/* (e.g.Reading from the device:										 */
/*			SCCB_DataIn 			Device Address	(LSB must be zero)   */
/*									Word Address						 */
/*									Device Address	(LSB must be one)	 */
/*									Data can be read via SCCB_DataOut	 */
/*************************************************************************/
/*	See below !!!!!!													 */
/*************************************************************************/

/*****************************************************************************************/
// Program
/*****************************************************************************************/
.section L1_code;

// configure the Omnivision device via I2C
Config_of_Omnivision:

	p0.l = SCCB_DataIn;
	p0.h = SCCB_DataIn;
	r0 = Omnivision_WR (z);			//Device select
	[p0++] = r0;
	r0 = Omni_COMB (z);				//Device Subregister select
	[p0++] = r0;
	r0 = Omni_8bit_Mode_ITU (z);    //Data to transfer in the register
	[p0++] = r0;
	
	p0.l = SCCB_Word_Count;
	p0.h = SCCB_Word_Count;
	r0 = 3 (z);             		// Number of transfers in total
	[p0] = r0;
	
	p0.l = SCCB_Control;
	p0.h = SCCB_Control;
	r0 = wr_cmd (z);       			//controls whether to read or to write
	[p0] = r0;
	
	p0.h = SCCB_In_Progress;       //takes care that the next transfer will not start
	p0.l = SCCB_In_Progress;       //before the last one ends
	r0 = 1;
	[p0] = r0;
	
Config_of_Omnivision.END:

RTS;
/************************************************************************************/

⌨️ 快捷键说明

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