📄 driveri2c.h
字号:
/*+++ *******************************************************************\
*
* Copyright and Disclaimer:
*
* ---------------------------------------------------------------
* This software is provided "AS IS" without warranty of any kind,
* either expressed or implied, including but not limited to the
* implied warranties of noninfringement, merchantability and/or
* fitness for a particular purpose.
* ---------------------------------------------------------------
*
* Copyright (c) 2008 Conexant Systems, Inc.
* All rights reserved.
*
\******************************************************************* ---*/
#ifndef _DRIVER_I2C_H_
#define _DRIVER_I2C_H_
extern "C"
{
#include <wdm.h>
}
#include <windef.h>
#include "i2cIF.h"
#include "UsbI2cInterface.h"
#define TRANSFER_SIZE_A0 16
#define TRANSFER_SIZE_T0 4
class DriverI2C : public I2cIF
{
public:
DriverI2C(UsbI2cInterface* p_usb_i2c_interface, BYTE channel);
~DriverI2C();
virtual NTSTATUS setCommandFormat(BOOLEAN first,BOOLEAN last);
// Increments the reference count for the calling interface on an
// object. QueryInferface calls addRef on the returned interface
// pointer on behalf of the caller.
virtual INT addRef();
// Decrements the reference count for the calling interface
// on a object. If the reference count on the object falls
// to 0, the object is freed from memory.
virtual INT release();
virtual BOOLEAN read(
BYTE device_adr,
INT size,
BYTE *p_buf)
{
return TRUE;
}
virtual BOOLEAN write(
BYTE device_adr,
INT size,
BYTE *p_buf)
{
return TRUE;
}
virtual BOOLEAN writeThenRead(
BYTE device_adr,
INT write_size,
const BYTE *p_write_buf,
INT read_size,
BYTE *p_read_buf)
{
return TRUE;
}
// the next 2 I2c interface added for Polaris
// because Polaris only support single read & write
virtual BOOLEAN read(
BYTE device_adr,
INT subaddr_size,
const BYTE *p_subaddr_buf,
INT read_size,
BYTE *p_read_buf);
virtual BOOLEAN write(
BYTE device_adr,
INT subaddr_size,
const BYTE *p_subaddr_buf,
INT write_size,
BYTE *p_write_buf);
DWORD maxTransferSize();
protected:
private:
private:
UsbI2cInterface* _p_usb_i2c_interface;
BYTE _channel;
DWORD _max_transfer_size;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -