Pci Configuration Space Access Sample Program List - NEC V850E/MA1 Application Note

32-bit single-chip microcontrollers pci host bridge macro
Hide thumbs Also See for V850E/MA1:
Table of Contents

Advertisement

5.5.4 PCI configuration space access sample program list

/////////////////////////////////////////////////////////////////////////
//
PCI configuration space access sample
//
Overview: Configuration space is accessed using procedure
//
shown below.
//
1) Write 32-bit value indicating PCI device, function
//
number, and register number to be accessed to
//
PCI_CONFIG_ADD register of PCI Host Bridge Macro.
//
2) When reading configuration space register, read
//
(word access) 32-bit value in PCI_CONFIG_DATA
//
register of PCI Host Bridge Macro.
//
When writing to configuration space register, write
//
(word access) 32-bit value to PCI_CONFIG_DATA register //
//
of PCI Host Bridge Macro.
//
//
This procedure is combined in functions PCI_ConfigRead
//
and PCI_ConfigWrite shown below.
//
Function PCI_Config_BaseAddressInit uses function
//
PCI_ConfigWrite to set base address register in
//
configuration space.
//
/////////////////////////////////////////////////////////////////////////
//////////////////////
// Type declaration //
//////////////////////
typedef char
typedef short int
typedef int
typedef unsigned char
typedef unsigned short int
typedef unsigned int
typedef volatile unsigned char
typedef volatile unsigned short int
typedef volatile unsigned int
/////////////////////////////////////////////////////////////////
// Function name: PCI_ConfigRead
// Function: Reads 32-bit value in PCI configuration space.
// Argument: ConfigAdd: Register address of configuration space//
// Return value: Read configuration space register data
/////////////////////////////////////////////////////////////////
UWORD PCI_ConfigRead(UWORD ConfigAdd)
{
V850EME2_REGW(PHBMR_PCI_CONFIG_ADD)
return V850EME2_REGW(PHBMR_PCI_CONFIG_DATA);
}
76
CHAPTER 5 APPLICATION EXAMPLES
BYTE;
HWORD;
WORD;
UBYTE;
UHWORD;
UWORD;
VUBYTE;
VUHWORD;
VUWORD;
= ConfigAdd;
Application Note U17121EJ1V1AN
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

Advertisement

Table of Contents
loading

This manual is also suitable for:

V850e/ma2V850e/ma3V850e/me2

Table of Contents