Macros
fsl_common.h File Reference
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "fsl_device_registers.h"
#include "fsl_clock.h"
Include dependency graph for fsl_common.h:
This graph shows which files directly or indirectly include this file:

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
 

Driver version

enum  {
  kStatus_Success = MAKE_STATUS(kStatusGroup_Generic, 0), kStatus_Fail = MAKE_STATUS(kStatusGroup_Generic, 1), kStatus_ReadOnly = MAKE_STATUS(kStatusGroup_Generic, 2), kStatus_OutOfRange = MAKE_STATUS(kStatusGroup_Generic, 3),
  kStatus_InvalidArgument = MAKE_STATUS(kStatusGroup_Generic, 4), kStatus_Timeout = MAKE_STATUS(kStatusGroup_Generic, 5), kStatus_NoTransferInProgress = MAKE_STATUS(kStatusGroup_Generic, 6)
}
 Generic status return codes. More...
 
enum  _status_groups {
  kStatusGroup_Generic = 0, kStatusGroup_FLASH = 1, kStatusGroup_LPSPI = 4, kStatusGroup_FLEXIO_SPI = 5,
  kStatusGroup_DSPI = 6, kStatusGroup_FLEXIO_UART = 7, kStatusGroup_FLEXIO_I2C = 8, kStatusGroup_LPI2C = 9,
  kStatusGroup_UART = 10, kStatusGroup_I2C = 11, kStatusGroup_LPSCI = 12, kStatusGroup_LPUART = 13,
  kStatusGroup_SPI = 14, kStatusGroup_XRDC = 15, kStatusGroup_SEMA42 = 16, kStatusGroup_SDHC = 17,
  kStatusGroup_SDMMC = 18, kStatusGroup_SAI = 19, kStatusGroup_MCG = 20, kStatusGroup_SCG = 21,
  kStatusGroup_SDSPI = 22, kStatusGroup_FLEXIO_I2S = 23, kStatusGroup_FLEXIO_MCULCD = 24, kStatusGroup_FLASHIAP = 25,
  kStatusGroup_FLEXCOMM_I2C = 26, kStatusGroup_I2S = 27, kStatusGroup_IUART = 28, kStatusGroup_CSI = 29,
  kStatusGroup_MIPI_DSI = 30, kStatusGroup_SDRAMC = 35, kStatusGroup_POWER = 39, kStatusGroup_ENET = 40,
  kStatusGroup_PHY = 41, kStatusGroup_TRGMUX = 42, kStatusGroup_SMARTCARD = 43, kStatusGroup_LMEM = 44,
  kStatusGroup_QSPI = 45, kStatusGroup_DMA = 50, kStatusGroup_EDMA = 51, kStatusGroup_DMAMGR = 52,
  kStatusGroup_FLEXCAN = 53, kStatusGroup_LTC = 54, kStatusGroup_FLEXIO_CAMERA = 55, kStatusGroup_LPC_SPI = 56,
  kStatusGroup_LPC_USART = 57, kStatusGroup_DMIC = 58, kStatusGroup_SDIF = 59, kStatusGroup_SPIFI = 60,
  kStatusGroup_OTP = 61, kStatusGroup_MCAN = 62, kStatusGroup_CAAM = 63, kStatusGroup_ECSPI = 64,
  kStatusGroup_USDHC = 65, kStatusGroup_LPC_I2C = 66, kStatusGroup_DCP = 67, kStatusGroup_MSCAN = 68,
  kStatusGroup_ESAI = 69, kStatusGroup_FLEXSPI = 70, kStatusGroup_MMDC = 71, kStatusGroup_PDM = 72,
  kStatusGroup_SDMA = 73, kStatusGroup_ICS = 74, kStatusGroup_SPDIF = 75, kStatusGroup_LPC_MINISPI = 76,
  kStatusGroup_HASHCRYPT = 77, kStatusGroup_LPC_SPI_SSP = 78, kStatusGroup_I3C = 79, kStatusGroup_LPC_I2C_1 = 97,
  kStatusGroup_NOTIFIER = 98, kStatusGroup_DebugConsole = 99, kStatusGroup_SEMC = 100, kStatusGroup_ApplicationRangeStart = 101,
  kStatusGroup_IAP = 102, kStatusGroup_SFA = 103, kStatusGroup_SPC = 104, kStatusGroup_PUF = 105,
  kStatusGroup_HAL_GPIO = 121, kStatusGroup_HAL_UART = 122, kStatusGroup_HAL_TIMER = 123, kStatusGroup_HAL_SPI = 124,
  kStatusGroup_HAL_I2C = 125, kStatusGroup_HAL_FLASH = 126, kStatusGroup_HAL_PWM = 127, kStatusGroup_HAL_RNG = 128,
  kStatusGroup_TIMERMANAGER = 135, kStatusGroup_SERIALMANAGER = 136, kStatusGroup_LED = 137, kStatusGroup_BUTTON = 138,
  kStatusGroup_EXTERN_EEPROM = 139, kStatusGroup_SHELL = 140, kStatusGroup_MEM_MANAGER = 141, kStatusGroup_LIST = 142,
  kStatusGroup_OSA = 143, kStatusGroup_COMMON_TASK = 144, kStatusGroup_MSG = 145, kStatusGroup_SDK_OCOTP = 146,
  kStatusGroup_SDK_FLEXSPINOR = 147, kStatusGroup_CODEC = 148, kStatusGroup_ASRC = 149, kStatusGroup_OTFAD = 150,
  kStatusGroup_SDIOSLV = 151
}
 Status group numbers. More...
 
#define DEBUG_CONSOLE_DEVICE_TYPE_FLEXCOMM   5U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_IUART   6U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_LPSCI   3U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_LPUART   2U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_MINI_USART   8U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_NONE   0U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_SWO   9U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_UART   1U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_USBCDC   4U
 
#define DEBUG_CONSOLE_DEVICE_TYPE_VUSART   7U
 
#define FSL_COMMON_DRIVER_VERSION   (MAKE_VERSION(2, 2, 4))
 common driver version 2.2.4. More...
 
#define FSL_DRIVER_TRANSFER_DOUBLE_WEAK_IRQ   1
 
typedef int32_t status_t
 Type used for all status and error return values. More...
 

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()
 


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:57