The 10 Slider Switches are mapped to a single 32-bit register whose bits correspond directly to each switch. For example, bit 0 gives the value for switch 0. Bits [31:10] are not used.
Device | Slider Switches |
Configuration | One 32-bit register |
Input/Output | Input only |
Address Base | 0xFF200040 |
Address Map | base - maps directly to the register |
.equ ADDR_SLIDESWITCHES, 0xFF200040 movia r2,ADDR_SLIDESWITCHES ldwio r3,0(r2) # Read switches
#define SWITCHES ((volatile long *) 0xFF200040) #define RLEDs ((volatile long *) 0xFF000000) int main() { long Swval; unsigned long Sw4val; while (1) { Swval = *SWITCHES; Sw4val = Swval ^ 0x10; // Invert bit 4 *RLEDs = Swval; } }