Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
pio.c
Package: ST_5105DTV.rar [view]
Upload User: fy98168
Upload Date: 2015-06-26
Package Size: 13771k
Code Size: 2k
Category:
DVD
Development Platform:
C/C++
- #ifdef REPORT_TO_CONSOLE
- #include <stdio.h>
- #endif
- #include "stdevice.h"
- #include "stpio.h"
- #include "gendef.h"
- #include "section.h"
- #include "pio.h"
- ST_DeviceName_t PIO_DeviceName[] = {"PIO0","PIO1","PIO2","PIO3",
- #if KB_PIO_PORTS > 4
- "PIO4",
- #endif
- #if KB_PIO_PORTS > 5
- "PIO5",
- #endif
- #if KB_PIO_PORTS > 6
- "PIO6",
- #endif
- #if KB_PIO_PORTS > 7
- "PIO7"
- #endif
- };
- static STPIO_InitParams_t STPIO_InitParams[KB_PIO_PORTS] = {
- { (U32*) PIO_0_BASE_ADDRESS, PIO_0_INTERRUPT, PIO_0_INTERRUPT_LEVEL },
- { (U32*) PIO_1_BASE_ADDRESS, PIO_1_INTERRUPT, PIO_1_INTERRUPT_LEVEL },
- { (U32*) PIO_2_BASE_ADDRESS, PIO_2_INTERRUPT, PIO_2_INTERRUPT_LEVEL },
- { (U32*) PIO_3_BASE_ADDRESS, PIO_3_INTERRUPT, PIO_3_INTERRUPT_LEVEL },
- #if KB_PIO_PORTS > 4
- { (U32*) KB_PIO_4_BASE_ADDRESS, KB_PIO_4_INTERRUPT, KB_PIO_4_INTERRUPT_LEVEL },
- #endif
- #if KB_PIO_PORTS > 5
- { (U32*) KB_PIO_5_BASE_ADDRESS, KB_PIO_5_INTERRUPT, PIO_5_INTERRUPT_LEVEL },
- #endif
- #if KB_PIO_PORTS > 6
- { (U32*) PIO_6_BASE_ADDRESS, PIO_6_INTERRUPT, PIO_6_INTERRUPT_LEVEL },
- #endif
- #if KB_PIO_PORTS > 7
- { (U32*) PIO_7_BASE_ADDRESS, PIO_7_INTERRUPT, PIO_7_INTERRUPT_LEVEL }
- #endif
- };
- ST_ErrorCode_t KB_PIOSetup( void )
- {
- ST_ErrorCode_t ST_ErrorCode = ST_NO_ERROR;
- int Instance;
- for (Instance = 0; Instance < KB_PIO_PORTS; Instance++)
- {
- STPIO_InitParams[Instance].DriverPartition = SystemPartition;
- ST_ErrorCode |= STPIO_Init( PIO_DeviceName[Instance], &STPIO_InitParams[Instance] );
- #ifdef REPORT_TO_CONSOLE
- Print("KB_PIOSetup(%s)=", PIO_DeviceName[Instance]);
- if (ST_ErrorCode != ST_NO_ERROR)
- Print("nSTPIO_Init Error");
- else
- Print("%sn", STPIO_GetRevision() );
- #endif
- }
- return ( ST_ErrorCode );
- }
- /* EOF */