1 /* 2 * Copyright (c) 2020 - 2024 Renesas Electronics Corporation and/or its affiliates 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef BSP_DELAY_H 8 #define BSP_DELAY_H 9 10 /*********************************************************************************************************************** 11 * Includes <System Includes> , "Project Includes" 12 **********************************************************************************************************************/ 13 14 /** Common macro for FSP header files. There is also a corresponding FSP_FOOTER macro at the end of this file. */ 15 FSP_HEADER 16 17 #include "bsp_compiler_support.h" 18 19 /*******************************************************************************************************************//** 20 * @addtogroup BSP_MCU 21 * @{ 22 **********************************************************************************************************************/ 23 24 /*********************************************************************************************************************** 25 * Macro definitions 26 **********************************************************************************************************************/ 27 28 /* The number of cycles required per software delay loop. */ 29 #ifndef BSP_DELAY_LOOP_CYCLES 30 #define BSP_DELAY_LOOP_CYCLES (100) 31 #endif 32 33 /** Available delay units for R_BSP_SoftwareDelay(). These are ultimately used to calculate a total # of microseconds */ 34 typedef enum 35 { 36 BSP_DELAY_UNITS_SECONDS = 1000000, ///< Requested delay amount is in seconds 37 BSP_DELAY_UNITS_MILLISECONDS = 1000, ///< Requested delay amount is in milliseconds 38 BSP_DELAY_UNITS_MICROSECONDS = 1 ///< Requested delay amount is in microseconds 39 } bsp_delay_units_t; 40 41 /** @} (end addtogroup BSP_MCU) */ 42 43 /*********************************************************************************************************************** 44 * Exported global variables 45 **********************************************************************************************************************/ 46 47 /*********************************************************************************************************************** 48 * Exported global functions (to be accessed by other files) 49 **********************************************************************************************************************/ 50 BSP_ATTRIBUTE_STACKLESS void bsp_prv_software_delay_loop(uint32_t loop_cnt); 51 52 /** Common macro for FSP header files. There is also a corresponding FSP_HEADER macro at the top of this file. */ 53 FSP_FOOTER 54 55 #endif 56