Blame | Last modification | View Log | RSS feed
@@@ Copyright 2010 TheSeven@@@ This file is part of emBIOS.@@ emBIOS is free software: you can redistribute it and/or@ modify it under the terms of the GNU General Public License as@ published by the Free Software Foundation, either version 2 of the@ License, or (at your option) any later version.@@ emBIOS is distributed in the hope that it will be useful,@ but WITHOUT ANY WARRANTY; without even the implied warranty of@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.@ See the GNU General Public License for more details.@@ You should have received a copy of the GNU General Public License@ along with emBIOS. If not, see <http://www.gnu.org/licenses/>.@@.section .icode.i2csend, "ax", %progbits.align 2.global i2csendbyte.global i2csend.type i2csendbyte, %function.type i2csend, %functioni2csendbyte:mov r3, #0@fallthroughi2csend:stmfd sp!, {r4,lr}mov r12, #0x3C000000add r12, r12, #0x00900000mov r4, #0str r4, [r12,#0x08]str r0, [r12,#0x0c]mov r4, #0xf0str r4, [r12,#0x04]mov r4, #0xf3str r4, [r12]bl i2cwaitstr r1, [r12,#0x0c]str r4, [r12]bl i2cwaitmovs r3, r3moveq r0, r2i2csend_write:ldrne r0, [r2], #1str r0, [r12,#0x0c]str r4, [r12]bl i2cwaitsubs r3, r3, #1bhi i2csend_writemov r0, #0xd0str r0, [r12,#0x04]str r4, [r12]i2csend_wait:ldr r0, [r12,#0x04]tst r0, #0x20bne i2csend_waitldmfd sp!, {r4,pc}.size i2csendbyte, .-i2csendbyte.size i2csend, .-i2csend.section .icode.i2crecv, "ax", %progbits.align 2.global i2crecvbyte.global i2crecv.type i2crecvbyte, %function.type i2crecv, %functioni2crecvbyte:mov r2, #0mov r3, #1@fallthroughi2crecv:stmfd sp!, {r0,r4,lr}mov r12, #0x3C000000add r12, r12, #0x00900000mov r4, #0str r4, [r12,#0x08]str r0, [r12,#0x0c]mov r4, #0xf0str r4, [r12,#0x04]mov r4, #0xf3str r4, [r12]bl i2cwaitstr r1, [r12,#0x0c]str r4, [r12]bl i2cwaitldr r0, [sp]orr r0, r0, #1str r1, [r12,#0x0c]mov r0, #0xb0str r0, [r12,#0x04]str r4, [r12]bl i2cwaiti2crecv_read:subs r3, r3, #1moveq r4, #0x73str r4, [r12]bl i2cwaitldr r0, [r12,#0x0c]movs r2, r2strne r0, [r2], #1movs r3, r3bne i2crecv_readmov r1, #0x90str r1, [r12,#0x04]mov r1, #0xf3str r1, [r12]i2crecv_wait:ldr r1, [r12,#0x04]tst r1, #0x20bne i2crecv_waitldmfd sp!, {r0,r4,pc}.size i2crecvbyte, .-i2crecvbyte.size i2crecv, .-i2crecv.section .icode.i2cwait, "ax", %progbits.align 2.global i2cwait.type i2cwait, %functioni2cwait:ldr r0, [r12]tst r0, #0x10beq i2cwaitmov pc, lr.size i2cwait, .-i2cwait