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
OneWire_Masters/GPIO/owlink.s@29:5c51a17cfbf5, 2016-03-29 (annotated)
- Committer:
- IanBenzMaxim
- Date:
- Tue Mar 29 15:29:37 2016 +0000
- Revision:
- 29:5c51a17cfbf5
- Parent:
- OneWire_Masters/GPIO/owlink.asm@28:057bb14d3cee
- Child:
- 30:fdd7a0f82f2f
Rename "owlink.asm" to "owlink.s" for online compiler to recognize. Change IAR assembler directives to armasm assembler directives. Need a more compatible solution.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
IanBenzMaxim | 28:057bb14d3cee | 1 | PROC_CLOCK_MHZ EQU 24 ; Processor clock in MHz |
IanBenzMaxim | 28:057bb14d3cee | 2 | OVERHEAD_TUNING EQU 21 ; Fraction where OverheadTime(us) = OVERHEAD_TUNING / PROC_CLOCK_MHZ |
IanBenzMaxim | 28:057bb14d3cee | 3 | ; Make PROC_CLOCK_MHZ and OVERHEAD_TUNING divisible by PROC_CYCLES_PER_LOOP for best results |
IanBenzMaxim | 28:057bb14d3cee | 4 | |
IanBenzMaxim | 28:057bb14d3cee | 5 | PIPELINE_REFILL_PROC_CYCLES EQU 1 ; ARM specifies 1-3 cycles for pipeline refill following a branch |
IanBenzMaxim | 28:057bb14d3cee | 6 | PROC_CYCLES_PER_LOOP EQU (2 + PIPELINE_REFILL_PROC_CYCLES) |
IanBenzMaxim | 28:057bb14d3cee | 7 | LOOPS_PER_US EQU (PROC_CLOCK_MHZ / PROC_CYCLES_PER_LOOP) ; Number of loop passes for a 1 us delay |
IanBenzMaxim | 28:057bb14d3cee | 8 | LOOPS_REMOVED_TUNING EQU (OVERHEAD_TUNING / PROC_CYCLES_PER_LOOP) |
IanBenzMaxim | 28:057bb14d3cee | 9 | |
IanBenzMaxim | 29:5c51a17cfbf5 | 10 | ; SECTION owlink : CODE |
IanBenzMaxim | 29:5c51a17cfbf5 | 11 | AREA owlink, CODE |
IanBenzMaxim | 28:057bb14d3cee | 12 | |
IanBenzMaxim | 28:057bb14d3cee | 13 | ; void ow_usdelay(unsigned int time_us) |
IanBenzMaxim | 29:5c51a17cfbf5 | 14 | ; PUBLIC ow_usdelay |
IanBenzMaxim | 29:5c51a17cfbf5 | 15 | EXPORT ow_usdelay |
IanBenzMaxim | 29:5c51a17cfbf5 | 16 | ow_usdelay |
IanBenzMaxim | 28:057bb14d3cee | 17 | mov R1, #LOOPS_PER_US |
IanBenzMaxim | 28:057bb14d3cee | 18 | mul R0, R0, R1 |
IanBenzMaxim | 28:057bb14d3cee | 19 | sub R0, R0, #LOOPS_REMOVED_TUNING |
IanBenzMaxim | 29:5c51a17cfbf5 | 20 | loop |
IanBenzMaxim | 28:057bb14d3cee | 21 | subs R0, R0, #1 |
IanBenzMaxim | 28:057bb14d3cee | 22 | bne loop |
IanBenzMaxim | 28:057bb14d3cee | 23 | bx R14 |
IanBenzMaxim | 28:057bb14d3cee | 24 | |
IanBenzMaxim | 28:057bb14d3cee | 25 | END |