/* * DESCRIPTION for iomacros.h * Read/Write macros for memory mapped I/O */ #ifndef _IOMACROS_H #define _IOMACROS_H #include "type.h" /**************************************************************************** Constants Definitions ****************************************************************************/ #define IO_READ8(p) (Uint8)(*(volatile Uint8 *)(p)) #define IO_WRITE8(p,c) (*((volatile Uint8 *)(p)) = ((Uint8)(c))) #define IO_READ16(p) (Uint16)(*(volatile Uint16 *)(p)) #define IO_WRITE16(p,v) (*((volatile Uint16 *)(p)) = (Uint16)(v)) #define IO_READ32(p) (Uint32)(*(volatile Uint32 *)(p)) #define IO_WRITE32(p,v) (*((volatile Uint32 *)(p)) = (Uint32)(v)) //bit operation #define BSET32(reg, bit) ((reg) |= (bit)) #define BCLR32(reg, bit) ((reg) &= ~(bit)) #endif