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

📄 cameraosdepend.c.svn-base

📁 PXA270 平台 Windows Mobile 5 摄像头驱动
💻 SVN-BASE
字号:
/****************************************************************************** 
** INTEL CONFIDENTIAL
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors.  Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel抯
** prior express written permission.

** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
********************************************************************************/
#include <windows.h>
#include <types.h>
#include <string.h>
#include <stdio.h>
#include <tchar.h>

#include <bulverde.h>
#include <mainstoneii.h>

#include "xllp_defs.h"
#include "xllp_serialization.h"
#include "xllp_camera.h"
#include "xllp_bcr.h"
#include "xllp_ost.h"
#include "xllp_dmac.h"
#include "xllp_i2c.h"

extern void msWait(unsigned int);

void OS_Delay(int ms)
{
	msWait(ms);
}

void OS_FrameRateDisplay(int fps)
{
	//RETAILMSG(1,(TEXT("FPS %d count %d OSCR %d\r\n"),fps, count++, current));
	//v_pBoardLevelRegister->hex_led = fps; // = (count++ << 16) | fps;
}


int OS_I2CInit()
{
	int status;

	status = XllpI2cInit((P_XLLP_I2C_T)(v_pI2C), (P_XLLP_GPIO_T) v_pGPIORegs, (P_XLLP_CLKMGR_T) v_pClkRegs, (XLLP_UINT32_T) 0);

	return status;
}


int OS_I2CMasterWriteData(XLLP_UINT8_T slaveAddr, const XLLP_UINT8_T * bytesBuf, int bytesCount)
{
	int status;
	XLLP_BOOL_T bSENDSTOP = XLLP_TRUE;

	status = XllpI2CWrite((P_XLLP_I2C_T)(v_pI2C), (P_XLLP_OST_T)(v_pOSTRegs), slaveAddr, bytesBuf, bytesCount, bSENDSTOP);

	return status;
}

int OS_I2CMasterReadData(XLLP_UINT8_T slaveAddr, XLLP_UINT8_T * bytesBuf, int bufLen)
{
	int status;

	XLLP_BOOL_T bSENDSTOP = XLLP_TRUE;

	status = XllpI2CRead((P_XLLP_I2C_T)(v_pI2C), (P_XLLP_OST_T)(v_pOSTRegs), slaveAddr, bytesBuf, bufLen, bSENDSTOP);

	return status;
}

// Allocate one DMA channel with desired priority
XLLP_STATUS_T OS_DmaAllocChannel(P_XLLP_DMAC_CHANNEL_T pChannel, XLLP_DMAC_CHANNEL_PRIORITY_T aChannelPriority)
{
	return XllpDmacAllocChannel(pChannel, aChannelPriority);	
}

// Free the channel and the request to channel mapping
void OS_DmaFreeChannel(XLLP_DMAC_CHANNEL_T aChannel, XLLP_DMAC_DEVICE_T aDevice)
{
    XllpDmacFreeChannel(aChannel, aDevice);
}

// Fill the channel dma register with the descriptor, Set up device request to channel mapping, Set up proper alignment
void OS_DmaCfgChannelDescTransfer(  P_XLLP_DMAC_DESCRIPTOR_T pDescVir, P_XLLP_DMAC_DESCRIPTOR_T pDescPhy, 
									XLLP_DMAC_CHANNEL_T aChannel, 
									XLLP_DMAC_DEVICE_T aDevice, 
									XLLP_DMAC_ALIGNMENT_T aLignment)
{
	XllpDmacCfgChannelDescTransfer( pDescPhy, aChannel, aDevice, aLignment);
}

// Start the specified channel
void OS_DmaStartTransfer(XLLP_DMAC_CHANNEL_T aChannel)
{
	XllpDmacStartTransfer(aChannel);
}
									
// Stop the specified channel
void OS_DmaStopTransfer(XLLP_DMAC_CHANNEL_T aChannel)
{
	XllpDmacStopTransfer(aChannel);
}

⌨️ 快捷键说明

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