23 #ifndef __HARDWAREACCESS_H__
24 #define __HARDWAREACCESS_H__
28 #include <altera_avalon_pio_regs.h>
30 #define PIO_KEY_RS_IR0_MSK (0b0001)
31 #define PIO_KEY_MINUS_IR2_MSK (0b0100)
32 #define PIO_KEY_PLUS_IR3_MSK (0b1000)
33 #define PIO_SW_LR_MSK (0b0000000001)
34 #define PIO_SW_MODE_MSK (0b0000011110)
35 #define PIO_SW_DEBUG_MSK (0b1000000000)
47 IOWR_ALTERA_AVALON_PIO_IRQ_MASK(PIO_KEY_BASE, enablebits);
56 IOWR_ALTERA_AVALON_PIO_EDGE_CAP(PIO_KEY_BASE, clearbits);
64 return (IORD_ALTERA_AVALON_PIO_EDGE_CAP(PIO_KEY_BASE));
77 IOWR_ALTERA_AVALON_PIO_IRQ_MASK(PIO_SW_BASE, enablebits);
86 IOWR_ALTERA_AVALON_PIO_EDGE_CAP(PIO_SW_BASE, clearbits);
96 return (IORD_ALTERA_AVALON_PIO_DATA(PIO_SW_BASE));
111 IOWR_ALTERA_AVALON_PIO_DATA(PIO_LED9_BASE, ledValue);
126 IOWR_ALTERA_AVALON_PIO_DATA(PIO_HEX0_BASE, ~segmentValues);
137 IOWR_ALTERA_AVALON_PIO_DATA(PIO_HEX1_BASE, ~segmentValues);
148 IOWR_ALTERA_AVALON_PIO_DATA(PIO_HEX2_BASE, ~segmentValues);
159 IOWR_ALTERA_AVALON_PIO_DATA(PIO_HEX3_BASE, ~segmentValues);
162 #endif // __HARDWAREACCESS_H__
static __inline__ void PIO_KEY_SetIRMsk(uint32_t enablebits)
Function to enable interrupts for pio key.
static __inline__ void PIO_HEX1_Set(uint32_t segmentValues)
Function to set segments on hex1 display.
static __inline__ void PIO_HEX2_Set(uint32_t segmentValues)
Function to set segments on hex2 display.
static __inline__ void PIO_KEY_ClearEdgeCptBits(uint32_t clearbits)
Function to clear bits of keys edgecapture register.
static __inline__ void PIO_HEX3_Set(uint32_t segmentValues)
Function to set segments on hex3 display.
static __inline__ void PIO_LED9_Set(uint32_t ledValue)
Function to set led9 for heartbeat.
static __inline__ void PIO_SW_SetIRMsk(uint32_t enablebits)
Function to enable interrupts for pio sw.
static __inline__ uint32_t PIO_SW_GetValues(void)
Function to read content of switches data register.
static __inline__ uint32_t PIO_KEY_GetEdgeCpt(void)
Function to read content of keys edgecapture register.
static __inline__ void PIO_SW_ClearEdgeCptBits(uint32_t clearbits)
Function to clear bits of switches edgecapture register.
static __inline__ void PIO_HEX0_Set(uint32_t segmentValues)
Function to set segments on hex0 display.