File indexing completed on 2025-05-11 08:22:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _FSL_COMMON_DSP_H_
0010 #define _FSL_COMMON_DSP_H_
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #define USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)(((uint64_t)(us) * (clockFreqInHz)) / 1000000U)
0025
0026 #define COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count) * 1000000U / (clockFreqInHz))
0027
0028
0029 #define MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)(ms) * (clockFreqInHz) / 1000U)
0030
0031 #define COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count) * 1000U / (clockFreqInHz))
0032
0033
0034 #define SDK_ISR_EXIT_BARRIER
0035
0036
0037
0038
0039 #define SDK_ALIGN(var, alignbytes) var __attribute__((aligned(alignbytes)))
0040
0041
0042 #if defined(FSL_FEATURE_L1DCACHE_LINESIZE_BYTE)
0043 #define SDK_L1DCACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L1DCACHE_LINESIZE_BYTE)
0044 #endif
0045
0046
0047 #if defined(FSL_FEATURE_L2CACHE_LINESIZE_BYTE)
0048 #define SDK_L2CACHE_ALIGN(var) SDK_ALIGN(var, FSL_FEATURE_L2CACHE_LINESIZE_BYTE)
0049 #endif
0050
0051
0052 #define SDK_SIZEALIGN(var, alignbytes) \
0053 ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U)))
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064 #define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var
0065 #define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable"))) var
0066 #define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \
0067 __attribute__((section("NonCacheable.init"))) var __attribute__((aligned(alignbytes)))
0068 #define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \
0069 __attribute__((section("NonCacheable"))) var __attribute__((aligned(alignbytes)))
0070
0071
0072
0073
0074
0075
0076
0077 #if (defined(FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE) && FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE)
0078
0079 #define AT_QUICKACCESS_SECTION_CODE(func) __attribute__((section("CodeQuickAccess"), __noinline__)) func
0080 #define AT_QUICKACCESS_SECTION_DATA(func) __attribute__((section("DataQuickAccess"))) func
0081
0082 #else
0083
0084 #define AT_QUICKACCESS_SECTION_CODE(func) func
0085 #define AT_QUICKACCESS_SECTION_DATA(func) func
0086
0087 #endif
0088
0089
0090
0091 #define NVIC_SetPriorityGrouping(value) do {} while(0)
0092 #define NVIC_GetPriorityGrouping() do {} while(0)
0093 #define NVIC_EnableIRQ(value) do {} while(0)
0094 #define NVIC_GetEnableIRQ(value) do {} while(0)
0095 #define NVIC_DisableIRQ(value) do {} while(0)
0096 #define NVIC_GetPendingIRQ(value) do {} while(0)
0097 #define NVIC_SetPendingIRQ(value) do {} while(0)
0098 #define NVIC_ClearPendingIRQ(value) do {} while(0)
0099 #define NVIC_GetActive(value) do {} while(0)
0100
0101
0102
0103
0104
0105 #include "fsl_clock.h"
0106
0107
0108
0109
0110
0111 #if defined(__cplusplus)
0112 extern "C" {
0113 #endif
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123 static inline status_t EnableIRQ(IRQn_Type interrupt)
0124 {
0125 return kStatus_Success;
0126 }
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136 static inline status_t DisableIRQ(IRQn_Type interrupt)
0137 {
0138 return kStatus_Success;
0139 }
0140
0141
0142
0143
0144
0145
0146
0147
0148 static inline uint32_t DisableGlobalIRQ(void)
0149 {
0150 return 0;
0151 }
0152
0153
0154
0155
0156
0157
0158
0159
0160 static inline void EnableGlobalIRQ(uint32_t primask)
0161 {
0162 }
0163
0164 #if defined(__cplusplus)
0165 }
0166 #endif
0167
0168
0169
0170 #endif