Example program for EVAL-ADMX2001
Dependencies: ADMX2001
platform_drivers/src/delay.cpp@15:fca7551aaf0a, 2021-11-17 (annotated)
- Committer:
- nsheth
- Date:
- Wed Nov 17 18:15:37 2021 +0000
- Revision:
- 15:fca7551aaf0a
- Parent:
- 9:29db35656fcb
Updating default .lib file for eval platform
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nsheth | 9:29db35656fcb | 1 | /***************************************************************************//** |
nsheth | 9:29db35656fcb | 2 | * @file delay.cpp |
nsheth | 9:29db35656fcb | 3 | * @brief Implementation of delay functionality |
nsheth | 9:29db35656fcb | 4 | ******************************************************************************** |
nsheth | 9:29db35656fcb | 5 | * Copyright (c) 2019, 2020 Analog Devices, Inc. |
nsheth | 9:29db35656fcb | 6 | * |
nsheth | 9:29db35656fcb | 7 | * All rights reserved. |
nsheth | 9:29db35656fcb | 8 | * |
nsheth | 9:29db35656fcb | 9 | * This software is proprietary to Analog Devices, Inc. and its licensors. |
nsheth | 9:29db35656fcb | 10 | * By using this software you agree to the terms of the associated |
nsheth | 9:29db35656fcb | 11 | * Analog Devices Software License Agreement. |
nsheth | 9:29db35656fcb | 12 | *******************************************************************************/ |
nsheth | 9:29db35656fcb | 13 | |
nsheth | 9:29db35656fcb | 14 | /******************************************************************************/ |
nsheth | 9:29db35656fcb | 15 | /***************************** Include Files **********************************/ |
nsheth | 9:29db35656fcb | 16 | /******************************************************************************/ |
nsheth | 9:29db35656fcb | 17 | |
nsheth | 9:29db35656fcb | 18 | #include <mbed.h> |
nsheth | 9:29db35656fcb | 19 | #include "platform_drivers.h" |
nsheth | 9:29db35656fcb | 20 | |
nsheth | 9:29db35656fcb | 21 | /******************************************************************************/ |
nsheth | 9:29db35656fcb | 22 | /********************** Macros and Constants Definitions **********************/ |
nsheth | 9:29db35656fcb | 23 | /******************************************************************************/ |
nsheth | 9:29db35656fcb | 24 | |
nsheth | 9:29db35656fcb | 25 | /******************************************************************************/ |
nsheth | 9:29db35656fcb | 26 | /************************ Functions Definitions *******************************/ |
nsheth | 9:29db35656fcb | 27 | /******************************************************************************/ |
nsheth | 9:29db35656fcb | 28 | |
nsheth | 9:29db35656fcb | 29 | /** |
nsheth | 9:29db35656fcb | 30 | * @brief Generate microseconds delay. |
nsheth | 9:29db35656fcb | 31 | * @param usecs - Delay in microseconds. |
nsheth | 9:29db35656fcb | 32 | * @return None. |
nsheth | 9:29db35656fcb | 33 | */ |
nsheth | 9:29db35656fcb | 34 | void udelay(uint32_t usecs) |
nsheth | 9:29db35656fcb | 35 | { |
nsheth | 9:29db35656fcb | 36 | if (usecs) { |
nsheth | 9:29db35656fcb | 37 | // Unused variable - fix compiler warning |
nsheth | 9:29db35656fcb | 38 | } |
nsheth | 9:29db35656fcb | 39 | } |
nsheth | 9:29db35656fcb | 40 | |
nsheth | 9:29db35656fcb | 41 | /** |
nsheth | 9:29db35656fcb | 42 | * @brief Generate miliseconds delay. |
nsheth | 9:29db35656fcb | 43 | * @param msecs - Delay in miliseconds. |
nsheth | 9:29db35656fcb | 44 | * @return None. |
nsheth | 9:29db35656fcb | 45 | */ |
nsheth | 9:29db35656fcb | 46 | void mdelay(uint32_t msecs) |
nsheth | 9:29db35656fcb | 47 | { |
nsheth | 9:29db35656fcb | 48 | if (msecs) { |
nsheth | 9:29db35656fcb | 49 | HAL_Delay(msecs); |
nsheth | 9:29db35656fcb | 50 | } |
nsheth | 9:29db35656fcb | 51 | } |