#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "fsl_device_registers.h"
#include "fsl_clock.h"
Go to the source code of this file.
Macros | |
#define | MAKE_STATUS(group, code) ((((group)*100) + (code))) |
Construct a status code value from a group and code number. More... | |
#define | MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix)) |
Construct the version number for drivers. More... | |
Min/max macros | |
#define | ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
Computes the number of elements in an array. More... | |
#define | MAX(a, b) (((a) > (b)) ? (a) : (b)) |
#define | MIN(a, b) (((a) < (b)) ? (a) : (b)) |
UINT16_MAX/UINT32_MAX value | |
#define | UINT16_MAX ((uint16_t)-1) |
#define | UINT32_MAX ((uint32_t)-1) |
Timer utilities | |
#define | COUNT_TO_MSEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count) * 1000U / (clockFreqInHz)) |
#define | COUNT_TO_USEC(count, clockFreqInHz) (uint64_t)((uint64_t)(count) * 1000000U / (clockFreqInHz)) |
#define | MSEC_TO_COUNT(ms, clockFreqInHz) (uint64_t)((uint64_t)(ms) * (clockFreqInHz) / 1000U) |
#define | USEC_TO_COUNT(us, clockFreqInHz) (uint64_t)(((uint64_t)(us) * (clockFreqInHz)) / 1000000U) |
ISR exit barrier | |
ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping exception return operation might vector to incorrect interrupt. For Cortex-M7, if core speed much faster than peripheral register write speed, the peripheral interrupt flags may be still set after exiting ISR, this results to the same error similar with errata 83869. | |
#define | SDK_ISR_EXIT_BARRIER |
Alignment variable definition macros | |
#define | SDK_ALIGN(var, alignbytes) var |
#define | SDK_SIZEALIGN(var, alignbytes) ((unsigned int)((var) + ((alignbytes)-1U)) & (unsigned int)(~(unsigned int)((alignbytes)-1U))) |
Non-cacheable region definition macros | |
#define | AT_NONCACHEABLE_SECTION(var) var |
#define | AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) var |
#define | AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) var |
#define | AT_NONCACHEABLE_SECTION_INIT(var) var |
Suppress fallthrough warning macro | |
static uint32_t | DisableGlobalIRQ (void) |
Disable the global IRQ. More... | |
static status_t | DisableIRQ (IRQn_Type interrupt) |
Disable specific interrupt. More... | |
static void | EnableGlobalIRQ (uint32_t primask) |
Enable the global IRQ. More... | |
static status_t | EnableIRQ (IRQn_Type interrupt) |
Enable specific interrupt. More... | |
void | SDK_DelayAtLeastUs (uint32_t delay_us, uint32_t coreClock_Hz) |
Delay at least for some time. Please note that, this API uses while loop for delay, different run-time environments make the time not precise, if precise delay count was needed, please implement a new delay function with hardware timer. More... | |
void | SDK_Free (void *ptr) |
Free memory. More... | |
void * | SDK_Malloc (size_t size, size_t alignbytes) |
Allocate memory with given alignment and aligned size. More... | |
#define | SUPPRESS_FALL_THROUGH_WARNING() |