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

📄 s3c6410_spi.h

📁 SAMSUNG S3C6410 CPU BSP for winmobile6
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//------------------------------------------------------------------------------
//
//  Header: s3c6410_spi.h
//
//  Defines the Serial Peripheral Interface (SPI) controller CPU register layout and
//  definitions.
//
#ifndef __S3C6410_SPI_H
#define __S3C6410_SPI_H

#if __cplusplus
	extern "C"
	{
#endif

#include <winioctl.h>
#include <ceddk.h>

typedef struct  
{
	UINT32      CH_CFG;        // 00
	UINT32      CLK_CFG;       // 04
	UINT32      MODE_CFG;      // 08
	UINT32      SLAVE_SEL;     // 0C
	UINT32      SPI_INT_EN;    // 10
	UINT32      SPI_STATUS;    // 14
	UINT32      SPI_TX_DATA;   // 18
	UINT32      SPI_RX_DATA;   // 1C
	UINT32      PACKET_COUNT;  // 20
	UINT32      PENDING_CLEAR; // 24
	UINT32      SWAP_CFG;      // 28
	UINT32      FB_CLK_SEL;    // 2C
} S3C6410_SPI_REG, *PS3C6410_SPI_REG; 


// IOCTL Commands
#define	SPI_IOCTL_SET_CONFIG			CTL_CODE(FILE_DEVICE_SERIAL_PORT, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define	SPI_IOCTL_START				CTL_CODE(FILE_DEVICE_SERIAL_PORT, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)


#define	SPI_MASTER_MODE	1
#define	SPI_SLAVE_MODE		0


typedef struct {
	PVOID            	VirtualAddress;
	PVOID			PhysicalAddress;
} DMA_BUFFER, *PDMA_BUFFER;

typedef struct {
	DWORD					dwMode;

	BOOL					bUseFullDuflex;

	DWORD					dwRxBurstDataLen;
	BOOL					bUseRxDMA;
	BOOL					bUseRxIntr;

	DWORD					dwTxBurstDataLen;
	BOOL					bUseTxDMA;
	BOOL					bUseTxIntr;

	DWORD					dwPrescaler;
	DWORD					dwTimeOutVal;
} SET_CONFIG, *PSET_CONFIG;



//------------------------------------------------------------------------------

#if __cplusplus
   	}
#endif

#endif	// __S3C6410_SPI_H

⌨️ 快捷键说明

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