Created
October 10, 2012 20:17
-
-
Save jboone/3868137 to your computer and use it in GitHub Desktop.
SGPIO Source Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void sgpio_irqhandler() { | |
SGPIO_CLR_STATUS_1 = 0xFFFFFFFF; | |
uint32_t* const p32 = &usb_bulk_buffer[buffer_offset]; | |
volatile const uint32_t* const sgpio_reg_ss_base = SGPIO_PORT_BASE + 0x100; | |
p32[7] = SGPIO_REG_SS(SGPIO_SLICE_A); | |
p32[6] = SGPIO_REG_SS(SGPIO_SLICE_I); | |
p32[5] = SGPIO_REG_SS(SGPIO_SLICE_E); | |
p32[4] = SGPIO_REG_SS(SGPIO_SLICE_J); | |
p32[3] = SGPIO_REG_SS(SGPIO_SLICE_C); | |
p32[2] = SGPIO_REG_SS(SGPIO_SLICE_K); | |
p32[1] = SGPIO_REG_SS(SGPIO_SLICE_F); | |
p32[0] = SGPIO_REG_SS(SGPIO_SLICE_L); | |
buffer_offset = (buffer_offset + 32) & buffer_mask; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10000274 <sgpio_irqhandler>: | |
10000274: f641 7330 movw r3, #7984 ; 0x1f30 | |
10000278: f2c4 0310 movt r3, #16400 ; 0x4010 | |
1000027c: f640 0200 movw r2, #2048 ; 0x800 | |
10000280: f2c1 0208 movt r2, #4104 ; 0x1008 | |
10000284: f04f 31ff mov.w r1, #4294967295 ; 0xffffffff | |
10000288: 6019 str r1, [r3, #0] | |
1000028a: 6c13 ldr r3, [r2, #64] ; 0x40 | |
1000028c: f44f 5188 mov.w r1, #4352 ; 0x1100 | |
10000290: f2c4 0110 movt r1, #16400 ; 0x4010 | |
10000294: f103 5300 add.w r3, r3, #536870912 ; 0x20000000 | |
10000298: 6808 ldr r0, [r1, #0] | |
1000029a: f503 4380 add.w r3, r3, #16384 ; 0x4000 | |
1000029e: f44f 5189 mov.w r1, #4384 ; 0x1120 | |
100002a2: f2c4 0110 movt r1, #16400 ; 0x4010 | |
100002a6: 61d8 str r0, [r3, #28] | |
100002a8: 6808 ldr r0, [r1, #0] | |
100002aa: f241 1110 movw r1, #4368 ; 0x1110 | |
100002ae: f2c4 0110 movt r1, #16400 ; 0x4010 | |
100002b2: 6198 str r0, [r3, #24] | |
100002b4: 6808 ldr r0, [r1, #0] | |
100002b6: f241 1124 movw r1, #4388 ; 0x1124 | |
100002ba: f2c4 0110 movt r1, #16400 ; 0x4010 | |
100002be: 6158 str r0, [r3, #20] | |
100002c0: 6808 ldr r0, [r1, #0] | |
100002c2: f241 1108 movw r1, #4360 ; 0x1108 | |
100002c6: f2c4 0110 movt r1, #16400 ; 0x4010 | |
100002ca: 6118 str r0, [r3, #16] | |
100002cc: 6808 ldr r0, [r1, #0] | |
100002ce: f241 1128 movw r1, #4392 ; 0x1128 | |
100002d2: f2c4 0110 movt r1, #16400 ; 0x4010 | |
100002d6: 60d8 str r0, [r3, #12] | |
100002d8: 6808 ldr r0, [r1, #0] | |
100002da: f241 1114 movw r1, #4372 ; 0x1114 | |
100002de: f2c4 0110 movt r1, #16400 ; 0x4010 | |
100002e2: 6098 str r0, [r3, #8] | |
100002e4: 6808 ldr r0, [r1, #0] | |
100002e6: f241 112c movw r1, #4396 ; 0x112c | |
100002ea: f2c4 0110 movt r1, #16400 ; 0x4010 | |
100002ee: 6058 str r0, [r3, #4] | |
100002f0: 6809 ldr r1, [r1, #0] | |
100002f2: 6c10 ldr r0, [r2, #64] ; 0x40 | |
100002f4: 6019 str r1, [r3, #0] | |
100002f6: f100 0320 add.w r3, r0, #32 | |
100002fa: 045b lsls r3, r3, #17 | |
100002fc: 0c5b lsrs r3, r3, #17 | |
100002fe: 6413 str r3, [r2, #64] ; 0x40 | |
10000300: 4770 bx lr | |
10000302: bf00 nop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef volatile uint32_t __RW; | |
typedef struct { | |
__RW OUT_MUXCFG[16]; | |
__RW SGPIO_MUX_CFG[16]; | |
__RW SLICE_MUX_CFG[16]; | |
__RW REG[16]; | |
__RW REG_SS[16]; | |
} sgpio_t; | |
static sgpio_t* const SGPIO = ((sgpio_t*)0x40101000); | |
void sgpio_irqhandler() { | |
SGPIO_CLR_STATUS_1 = 0xFFFFFFFF; | |
uint32_t* const p32 = &usb_bulk_buffer[buffer_offset]; | |
volatile const uint32_t* const sgpio_reg_ss_base = SGPIO_PORT_BASE + 0x100; | |
p32[7] = SGPIO->REG_SS[SGPIO_SLICE_A]; | |
p32[6] = SGPIO->REG_SS[SGPIO_SLICE_I]; | |
p32[5] = SGPIO->REG_SS[SGPIO_SLICE_E]; | |
p32[4] = SGPIO->REG_SS[SGPIO_SLICE_J]; | |
p32[3] = SGPIO->REG_SS[SGPIO_SLICE_C]; | |
p32[2] = SGPIO->REG_SS[SGPIO_SLICE_K]; | |
p32[1] = SGPIO->REG_SS[SGPIO_SLICE_F]; | |
p32[0] = SGPIO->REG_SS[SGPIO_SLICE_L]; | |
buffer_offset = (buffer_offset + 32) & buffer_mask; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10000274 <sgpio_irqhandler>: | |
10000274: f641 7330 movw r3, #7984 ; 0x1f30 | |
10000278: f2c4 0310 movt r3, #16400 ; 0x4010 | |
1000027c: f640 0100 movw r1, #2048 ; 0x800 | |
10000280: f2c1 0108 movt r1, #4104 ; 0x1008 | |
10000284: f04f 32ff mov.w r2, #4294967295 ; 0xffffffff | |
10000288: 601a str r2, [r3, #0] | |
1000028a: 6c0a ldr r2, [r1, #64] ; 0x40 | |
1000028c: f44f 5380 mov.w r3, #4096 ; 0x1000 | |
10000290: f2c4 0310 movt r3, #16400 ; 0x4010 | |
10000294: f102 5200 add.w r2, r2, #536870912 ; 0x20000000 | |
10000298: f8d3 0100 ldr.w r0, [r3, #256] ; 0x100 | |
1000029c: f502 4280 add.w r2, r2, #16384 ; 0x4000 | |
100002a0: 61d0 str r0, [r2, #28] | |
100002a2: f8d3 0120 ldr.w r0, [r3, #288] ; 0x120 | |
100002a6: 6190 str r0, [r2, #24] | |
100002a8: f8d3 0110 ldr.w r0, [r3, #272] ; 0x110 | |
100002ac: 6150 str r0, [r2, #20] | |
100002ae: f8d3 0124 ldr.w r0, [r3, #292] ; 0x124 | |
100002b2: 6110 str r0, [r2, #16] | |
100002b4: f8d3 0108 ldr.w r0, [r3, #264] ; 0x108 | |
100002b8: 60d0 str r0, [r2, #12] | |
100002ba: f8d3 0128 ldr.w r0, [r3, #296] ; 0x128 | |
100002be: 6090 str r0, [r2, #8] | |
100002c0: f8d3 0114 ldr.w r0, [r3, #276] ; 0x114 | |
100002c4: 6050 str r0, [r2, #4] | |
100002c6: f8d3 012c ldr.w r0, [r3, #300] ; 0x12c | |
100002ca: 6c0b ldr r3, [r1, #64] ; 0x40 | |
100002cc: 6010 str r0, [r2, #0] | |
100002ce: 3320 adds r3, #32 | |
100002d0: 045b lsls r3, r3, #17 | |
100002d2: 0c5b lsrs r3, r3, #17 | |
100002d4: 640b str r3, [r1, #64] ; 0x40 | |
100002d6: 4770 bx lr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment