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

📄 ssp.h

📁 SM501基于ARMV4/ARMV4I平台
💻 H
字号:
//-----------------------------------------------------------------------------
//
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//  ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//  Copyright (c) 2003 Silicon Motion, Inc.
//
//  Module Name:	ssp.h
//
//  Abstract:		SSP API
//
//-----------------------------------------------------------------------------

#ifndef _SSP_H_
#define _SSP_H_

#ifndef DISABLE_INTERRUPT_MANAGEMENT


///////////////////////////////////////////////////////////////////////////////
// SSP read buffer size.

#define SSP_READ_BUFFER_SIZE 2048


///////////////////////////////////////////////////////////////////////////////
// SSP read buffer class.

class CDataBuffer
{
public:
	CDataBuffer(DWORD dwSize = 0, PWORD pBuffer = NULL);
	~CDataBuffer();

public:
	// Buffer operations
	BOOL PutWord(WORD data);
	BOOL GetWord(WORD& data, DWORD timeout = 0);

	// Buffer status
	BOOL IsFull();
	BOOL IsEmpty();
	DWORD GetLength();

	// Reset head, tail, overrun
	VOID Reset();

	// Allocate/set a new buffer
	VOID SetBuffer(DWORD dwSize = 0, PWORD pBuffer = NULL);

public:
	BOOL m_bOverrun;

protected:
	DWORD next(DWORD pos);

protected:
	BOOL m_bOwnBuffer;
	PWORD m_pBuffer;
	DWORD m_head;
	DWORD m_tail;
	DWORD m_size;
};


///////////////////////////////////////////////////////////////////////////////
// SSP descriptor.

typedef struct _SSP_INFO
{
	BOOL Active;

	CDataBuffer readBuffer;
	CDataBuffer writeBuffer;

	HANDLE writeEvent;

	VGXINTHANDLER IntHandler;
	DWORD dwIntMask;

	DWORD dwControl0Reg;
	DWORD dwControl1Reg;
	DWORD dwDataReg;
	DWORD dwStatusReg;
	DWORD dwPrescaleReg;
	DWORD dwIntStatusReg;

	DWORD read_timeout;
	DWORD write_timeout;
}
SSP_INFO, *PSSP_INFO;

#endif
#endif

⌨️ 快捷键说明

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