
Code Examples
Firmware
4 - 30
PPC/PMC-8260/DS1
Code Examples
This section contains C code examples which can be implemented into your driver
software to enable communication between the host and the PPC/PMC-8260/DS1
firmware via the PCI bus.
It assumes that the PowerSpan II PCI bridge has been fully initialized by the host’s
PCI enumerator and is accessible. The code printed in bold at the beginning of the
data definitions may require some modification to your host environment.
Data Definitions
/* some compatibility macros (e.g. for vxWorks) */
#define UINT32 unsigned int
#define sleep(s) taskDelay(s*sysAuxClkRateGet())
/* Set this if host is big endian */
#define BIG_ENDIAN_HOST
#define LLSB(x) ((x) & 0xff)
#define LNLSB(x) (((x) >> 8) & 0xff)
#define LNMSB(x) (((x) >> 16) & 0xff)
#define LMSB(x) (((x) >> 24) & 0xff)
#ifdef BIG_ENDIAN_HOST
#define LONGSWAP(x) ((LLSB(x) << 24) | \
(LNLSB(x) << 16)| \
(LNMSB(x) << 8) | \
(LMSB(x)))
#define NOLONGSWAP(x) (x)
#else
#define LONGSWAP(x) (x)
#define NOLONGSWAP(x) ((LLSB(x) << 24) | \
(LNLSB(x) << 16)| \
(LNMSB(x) << 8) | \
(LMSB(x)))
#endif
/* Required PowerSpan Registers */
#define PSPAN_MBOX(num) (0x00 num*4)
#define PSPAN_ISR0 (0x00000410)
#define PSPAN_IER0 (0x00000418)
#define PSPAN_INT_MBOX0 (0x00000001)
#define PSPAN_IMR_MBOX (0x00000420)
Summary of Contents for PPC/PMC-8260/DS1
Page 1: ...PPC PMC 8260 DS1 Reference Guide P N 6806800B10A July 2006 ...
Page 8: ...viii PPC PMC 8260 DS1 ...
Page 22: ...xxii PPC PMC 8260 DS1 ...
Page 26: ...xxvi PPC PMC 8260 DS1 ...
Page 30: ...xxx PPC PMC 8260 DS1 ...
Page 31: ...1 Introduction ...
Page 32: ......
Page 39: ...2 Installation ...
Page 40: ......
Page 53: ...3 Indicators and Connectors ...
Page 54: ......
Page 64: ...On Board Connectors Indicators and Connectors 3 12 PPC PMC 8260 DS1 ...
Page 65: ...4 Firmware ...
Page 66: ......
Page 104: ...Code Examples Firmware 4 40 PPC PMC 8260 DS1 ...
Page 105: ...5 Memory Map and Devices ...
Page 106: ......
Page 132: ...Resetting the Devices Memory Map and Devices 5 28 PPC PMC 8260 DS1 ...
Page 133: ...6 TDM Channel Configuration ...
Page 134: ......
Page 145: ...A Troubleshooting ...
Page 146: ......
Page 148: ...A 4 PPC PMC 8260 DS1 ...
Page 150: ...I 2 PPC PMC 8260 DS1 ...