Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more
Diff: OneWire_Masters/GPIO/owlink.asm
- Revision:
- 28:057bb14d3cee
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/OneWire_Masters/GPIO/owlink.asm Tue Mar 29 09:55:25 2016 -0500 @@ -0,0 +1,23 @@ +PROC_CLOCK_MHZ EQU 24 ; Processor clock in MHz +OVERHEAD_TUNING EQU 21 ; Fraction where OverheadTime(us) = OVERHEAD_TUNING / PROC_CLOCK_MHZ +; Make PROC_CLOCK_MHZ and OVERHEAD_TUNING divisible by PROC_CYCLES_PER_LOOP for best results + +PIPELINE_REFILL_PROC_CYCLES EQU 1 ; ARM specifies 1-3 cycles for pipeline refill following a branch +PROC_CYCLES_PER_LOOP EQU (2 + PIPELINE_REFILL_PROC_CYCLES) +LOOPS_PER_US EQU (PROC_CLOCK_MHZ / PROC_CYCLES_PER_LOOP) ; Number of loop passes for a 1 us delay +LOOPS_REMOVED_TUNING EQU (OVERHEAD_TUNING / PROC_CYCLES_PER_LOOP) + + SECTION owlink : CODE + +; void ow_usdelay(unsigned int time_us) + PUBLIC ow_usdelay +ow_usdelay: + mov R1, #LOOPS_PER_US + mul R0, R0, R1 + sub R0, R0, #LOOPS_REMOVED_TUNING +loop: + subs R0, R0, #1 + bne loop + bx R14 + + END \ No newline at end of file