
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)
Содержание PPC/PMC-8260/DS1
Страница 1: ...PPC PMC 8260 DS1 Reference Guide P N 6806800B10A July 2006 ...
Страница 8: ...viii PPC PMC 8260 DS1 ...
Страница 22: ...xxii PPC PMC 8260 DS1 ...
Страница 26: ...xxvi PPC PMC 8260 DS1 ...
Страница 30: ...xxx PPC PMC 8260 DS1 ...
Страница 31: ...1 Introduction ...
Страница 32: ......
Страница 39: ...2 Installation ...
Страница 40: ......
Страница 53: ...3 Indicators and Connectors ...
Страница 54: ......
Страница 64: ...On Board Connectors Indicators and Connectors 3 12 PPC PMC 8260 DS1 ...
Страница 65: ...4 Firmware ...
Страница 66: ......
Страница 104: ...Code Examples Firmware 4 40 PPC PMC 8260 DS1 ...
Страница 105: ...5 Memory Map and Devices ...
Страница 106: ......
Страница 132: ...Resetting the Devices Memory Map and Devices 5 28 PPC PMC 8260 DS1 ...
Страница 133: ...6 TDM Channel Configuration ...
Страница 134: ......
Страница 145: ...A Troubleshooting ...
Страница 146: ......
Страница 148: ...A 4 PPC PMC 8260 DS1 ...
Страница 150: ...I 2 PPC PMC 8260 DS1 ...