31 #ifndef _FSL_COMMON_H_ 32 #define _FSL_COMMON_H_ 38 #if !defined(BOOTLOADER_HOST) 39 #include "fsl_device_registers.h" 40 #endif // BOOTLOADER_HOST 52 #define MAKE_STATUS(group, code) ((((group)*100) + (code))) 55 #define MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix)) 58 #define DEBUG_CONSOLE_DEVICE_TYPE_NONE 0U 59 #define DEBUG_CONSOLE_DEVICE_TYPE_UART 1U 60 #define DEBUG_CONSOLE_DEVICE_TYPE_LPUART 2U 61 #define DEBUG_CONSOLE_DEVICE_TYPE_LPSCI 3U 62 #define DEBUG_CONSOLE_DEVICE_TYPE_USBCDC 4U 123 #if !defined(BOOTLOADER_HOST) 124 #include "fsl_clock.h" 125 #endif // BOOTLOADER_HOST 130 #define MIN(a, b) ((a) < (b) ? (a) : (b)) 134 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 139 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 144 #define USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)((uint64_t)us * clockFreqInHz / 1000000U) 146 #define COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)count * 1000000U / clockFreqInHz) 149 #define MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)ms * clockFreqInHz / 1000U) 151 #define COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)count * 1000U / clockFreqInHz) 158 #if !defined(BOOTLOADER_HOST) 160 #if defined(__cplusplus) 173 #if defined(FSL_FEATURE_SOC_INTMUX_COUNT) && (FSL_FEATURE_SOC_INTMUX_COUNT > 0) 174 if (interrupt < FSL_FEATURE_INTMUX_IRQ_START_INDEX)
177 NVIC_EnableIRQ(interrupt);
190 #if defined(FSL_FEATURE_SOC_INTMUX_COUNT) && (FSL_FEATURE_SOC_INTMUX_COUNT > 0) 191 if (interrupt < FSL_FEATURE_INTMUX_IRQ_START_INDEX)
194 NVIC_DisableIRQ(interrupt);
208 uint32_t regPrimask = __get_PRIMASK();
227 __set_PRIMASK(primask);
238 #if defined(__cplusplus) 242 #endif // BOOTLOADER_HOST Definition: fsl_common.h:71
Definition: fsl_common.h:94
Definition: fsl_common.h:105
Definition: fsl_common.h:78
static uint32_t DisableGlobalIRQ(void)
Disable the global IRQ.
Definition: fsl_common.h:206
Definition: fsl_common.h:85
Definition: fsl_common.h:76
Definition: fsl_common.h:80
Definition: fsl_common.h:79
Definition: fsl_common.h:101
Definition: fsl_common.h:97
Definition: fsl_common.h:100
static void EnableGlobalIRQ(uint32_t primask)
Enaable the global IRQ.
Definition: fsl_common.h:225
Definition: fsl_common.h:86
_generic_status
Generic status return codes.
Definition: fsl_common.h:109
Definition: fsl_common.h:82
Definition: fsl_common.h:77
Definition: fsl_common.h:88
Definition: fsl_common.h:90
Definition: fsl_common.h:103
Definition: fsl_common.h:95
Definition: fsl_common.h:102
Definition: fsl_common.h:91
Definition: fsl_common.h:89
Definition: fsl_common.h:92
Definition: fsl_common.h:72
Definition: fsl_common.h:93
Definition: fsl_common.h:73
static void DisableIRQ(IRQn_Type interrupt)
Disable specific interrupt.
Definition: fsl_common.h:188
Definition: fsl_common.h:83
Definition: fsl_common.h:81
Definition: fsl_common.h:75
void InstallIRQHandler(IRQn_Type irq, uint32_t irqHandler)
install IRQ handler
Definition: fsl_common.c:56
Definition: fsl_common.h:87
Definition: fsl_common.h:68
Definition: fsl_common.h:99
Definition: fsl_common.h:104
Definition: fsl_common.h:96
Definition: fsl_common.h:84
Definition: fsl_common.h:67
Definition: fsl_common.h:98
Definition: fsl_common.h:70
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:121
Definition: fsl_common.h:69
static void EnableIRQ(IRQn_Type interrupt)
Enable specific interrupt.
Definition: fsl_common.h:171
Definition: fsl_common.h:74