Mouse code for the MacroRat
mbed-dev/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/drivers/services/delay/delay.h@46:b156ef445742, 2017-06-03 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sat Jun 03 00:22:44 2017 +0000
- Revision:
- 46:b156ef445742
- Parent:
- 18:6a4db94011d3
Final code for internal battlebot competition.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | #ifndef DELAY_H_INCLUDED |
sahilmgandhi | 18:6a4db94011d3 | 2 | #define DELAY_H_INCLUDED |
sahilmgandhi | 18:6a4db94011d3 | 3 | |
sahilmgandhi | 18:6a4db94011d3 | 4 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 5 | extern "C" { |
sahilmgandhi | 18:6a4db94011d3 | 6 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 7 | |
sahilmgandhi | 18:6a4db94011d3 | 8 | /** |
sahilmgandhi | 18:6a4db94011d3 | 9 | * @defgroup group_common_services_delay Busy-Wait Delay Routines |
sahilmgandhi | 18:6a4db94011d3 | 10 | * |
sahilmgandhi | 18:6a4db94011d3 | 11 | * This module provides simple loop-based delay routines for those |
sahilmgandhi | 18:6a4db94011d3 | 12 | * applications requiring a brief wait during execution. Common for |
sahilmgandhi | 18:6a4db94011d3 | 13 | * API ver. 2. |
sahilmgandhi | 18:6a4db94011d3 | 14 | * |
sahilmgandhi | 18:6a4db94011d3 | 15 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 16 | */ |
sahilmgandhi | 18:6a4db94011d3 | 17 | #include <compiler.h> |
sahilmgandhi | 18:6a4db94011d3 | 18 | #include <gclk.h> |
sahilmgandhi | 18:6a4db94011d3 | 19 | |
sahilmgandhi | 18:6a4db94011d3 | 20 | // TEMP: Added by V |
sahilmgandhi | 18:6a4db94011d3 | 21 | #include "sam0/systick_counter.h" |
sahilmgandhi | 18:6a4db94011d3 | 22 | #ifdef SYSTICK_MODE |
sahilmgandhi | 18:6a4db94011d3 | 23 | #include "sam0/systick_counter.h" |
sahilmgandhi | 18:6a4db94011d3 | 24 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 25 | #ifdef CYCLE_MODE |
sahilmgandhi | 18:6a4db94011d3 | 26 | #include "sam0/cycle_counter.h" |
sahilmgandhi | 18:6a4db94011d3 | 27 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 28 | |
sahilmgandhi | 18:6a4db94011d3 | 29 | void delay_init(void); |
sahilmgandhi | 18:6a4db94011d3 | 30 | |
sahilmgandhi | 18:6a4db94011d3 | 31 | /** |
sahilmgandhi | 18:6a4db94011d3 | 32 | * \def delay_s |
sahilmgandhi | 18:6a4db94011d3 | 33 | * \brief Delay in at least specified number of seconds. |
sahilmgandhi | 18:6a4db94011d3 | 34 | * \param delay Delay in seconds |
sahilmgandhi | 18:6a4db94011d3 | 35 | */ |
sahilmgandhi | 18:6a4db94011d3 | 36 | #define delay_s(delay) cpu_delay_s(delay) |
sahilmgandhi | 18:6a4db94011d3 | 37 | |
sahilmgandhi | 18:6a4db94011d3 | 38 | /** |
sahilmgandhi | 18:6a4db94011d3 | 39 | * \def delay_ms |
sahilmgandhi | 18:6a4db94011d3 | 40 | * \brief Delay in at least specified number of milliseconds. |
sahilmgandhi | 18:6a4db94011d3 | 41 | * \param delay Delay in milliseconds |
sahilmgandhi | 18:6a4db94011d3 | 42 | */ |
sahilmgandhi | 18:6a4db94011d3 | 43 | #define delay_ms(delay) cpu_delay_ms(delay) |
sahilmgandhi | 18:6a4db94011d3 | 44 | |
sahilmgandhi | 18:6a4db94011d3 | 45 | /** |
sahilmgandhi | 18:6a4db94011d3 | 46 | * \def delay_us |
sahilmgandhi | 18:6a4db94011d3 | 47 | * \brief Delay in at least specified number of microseconds. |
sahilmgandhi | 18:6a4db94011d3 | 48 | * \param delay Delay in microseconds |
sahilmgandhi | 18:6a4db94011d3 | 49 | */ |
sahilmgandhi | 18:6a4db94011d3 | 50 | #define delay_us(delay) cpu_delay_us(delay) |
sahilmgandhi | 18:6a4db94011d3 | 51 | |
sahilmgandhi | 18:6a4db94011d3 | 52 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 53 | } |
sahilmgandhi | 18:6a4db94011d3 | 54 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 55 | |
sahilmgandhi | 18:6a4db94011d3 | 56 | /** |
sahilmgandhi | 18:6a4db94011d3 | 57 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 58 | */ |
sahilmgandhi | 18:6a4db94011d3 | 59 | |
sahilmgandhi | 18:6a4db94011d3 | 60 | #endif /* DELAY_H_INCLUDED */ |