📄 ad9883.c
字号:
/* * * Copyright (c) 2001-2007 Sigma Designs, Inc. * All Rights Reserved. Proprietary and Confidential. * *//** @file AD9883.c @brief device specific functions for main application @author Christian Wolff Sean.Sekwon.Choi*/// to enable or disable the debug messages of this source file, put 1 or 0 below#if 0#define LOCALDBG ENABLE#else#define LOCALDBG DISABLE#endif#include "common.h"#include "AD9883.h"#include "i2c.h"struct cap_AD9883_instance { struct RUA *pRUA; RMuint32 I2CModuleID; struct EMhwlibI2CDeviceParameter I2CDevice; RMuint8 BaseDevice; // internal state RMuint32 state;};/********************************************************************************** Capture Chip API*********************************************************************************/RMstatus cap_AD9883_open(struct RUA *pRUA, struct cap_AD9883_instance **ppAD9883, RMuint32 I2CModuleID, struct EMhwlibI2CDeviceParameter *pI2CDevice){ struct cap_AD9883_instance *pAD9883; RMDBGLOG((FUNCNAME, "%s\n",__func__)); // Sanity checks if (ppAD9883 == NULL) return RM_FATALINVALIDPOINTER; *ppAD9883 = NULL; if (pRUA == NULL) return RM_FATALINVALIDPOINTER; if (pI2CDevice == NULL) return RM_FATALINVALIDPOINTER; // Allocate and clear local instance pAD9883 = (struct cap_AD9883_instance *)RMMalloc(sizeof(struct cap_AD9883_instance)); if (pAD9883 == NULL) { RMDBGLOG((ENABLE, "FATAL! Not enough memory for struct cap_AD9883_instance!\n")); return RM_FATALOUTOFMEMORY; } RMMemset(pAD9883, 0, sizeof(struct cap_AD9883_instance)); *ppAD9883 = pAD9883; // Set default and startup values pAD9883->pRUA = pRUA; pAD9883->I2CModuleID = I2CModuleID; pAD9883->I2CDevice = *pI2CDevice; pAD9883->BaseDevice = pI2CDevice->DevAddr; return RM_OK;}RMstatus cap_AD9883_close(struct cap_AD9883_instance *pAD9883){ RMDBGLOG((FUNCNAME, "%s\n",__func__)); // Sanity checks if (pAD9883 == NULL) return RM_FATALINVALIDPOINTER; // Free all ressources RMFree(pAD9883); return RM_OK;}RMstatus cap_AD9883_init_capture(struct cap_AD9883_instance *pAD9883, enum cap_board board, enum cap_video_input video_input, RMuint32 video_input_num ){ return RM_OK;}RMstatus cap_AD9883_tristate(struct cap_AD9883_instance *pAD9883){ cap_i2c_write_dev(pAD9883, pAD9883->BaseDevice, 0x0F, 0x4C); // power down AD9883A return RM_OK;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -