95 baseAddr = g_flexioBase[instance];
106 deviceState->resourceAllocation = 0U;
110 deviceState->flexioStatePtr[count] = NULL;
130 baseAddr = g_flexioBase[instance];
155 baseAddr = g_flexioBase[instance];
174 uint8_t resourceAllocation;
179 baseAddr = g_flexioBase[instance];
181 step = driver->resourceCount;
184 mask = (uint8_t)((1U << step) - 1U);
189 if ((resourceAllocation & mask) == 0U)
192 driver->resourceIndex = count;
217 mask = (uint8_t)((1U << driver->resourceCount) - 1U);
218 mask <<= driver->resourceIndex;
234 uint8_t resourceCount;
235 uint8_t resourceIndex;
238 baseAddr = g_flexioBase[instance];
239 resourceCount = driver->resourceCount;
240 resourceIndex = driver->resourceIndex;
241 for (resource = resourceIndex; resource < (resourceIndex + resourceCount); resource++)
269 flexio_common_state_t **flexioStatePtr;
283 if (flexioStatePtr[count] == NULL)
286 flexioStatePtr[count] = driver;
291 DEV_ASSERT(count < FEATURE_FLEXIO_MAX_SHIFTER_COUNT);
298 driver->instance = instance;
314 flexio_common_state_t **flexioStatePtr;
316 instance = driver->instance;
322 if (flexioStatePtr[count] == driver)
325 flexioStatePtr[count] = NULL;
329 DEV_ASSERT(count < FEATURE_FLEXIO_MAX_SHIFTER_COUNT);
338 #if (FLEXIO_INSTANCE_COUNT > 0U)
349 uint32_t resourceMask;
350 uint32_t shifterEvents;
351 uint32_t shifterErrorEvents;
352 uint32_t timerEvents;
353 uint32_t enabledInterrupts;
355 flexio_common_state_t *
const *driverList;
356 flexio_common_state_t *driverState;
359 baseAddr = g_flexioBase[instance];
373 driverState = driverList[count];
375 if ((driverState != NULL) && (driverState->isr != NULL))
378 resourceMask = ((1UL << driverState->resourceCount) - 1U) << driverState->resourceIndex;
380 if (((shifterEvents & resourceMask) != 0U) ||
381 ((shifterErrorEvents & resourceMask) != 0U) ||
382 ((timerEvents & resourceMask) != 0U))
385 (driverState->isr)(driverState);
status_t OSIF_MutexDestroy(const mutex_t *const pMutex)
Destroys a previously created mutex.
static void FLEXIO_HAL_SetShifterInterrupt(FLEXIO_Type *baseAddr, uint8_t interruptMask, bool enable)
Enables or disables the shifter interrupts.
static void FLEXIO_HAL_SetShifterMode(FLEXIO_Type *baseAddr, uint8_t shifter, flexio_shifter_mode_t mode)
Sets the mode of the specified shifter.
static status_t FLEXIO_DRV_Allocate(uint32_t instance, flexio_common_state_t *driver)
status_t OSIF_MutexUnlock(const mutex_t *const pMutex)
Unlocks a previously locked mutex.
static void FLEXIO_HAL_SetTimerMode(FLEXIO_Type *baseAddr, uint8_t timer, flexio_timer_mode_t mode)
Sets the mode of the specified timer.
status_t OSIF_MutexLock(const mutex_t *const pMutex, const uint32_t timeout)
Waits for a mutex and locks it.
FLEXIO_Type *const g_flexioBase[FLEXIO_INSTANCE_COUNT]
static uint32_t FLEXIO_HAL_GetAllShifterStatus(const FLEXIO_Type *baseAddr)
Returns the current status flags for all shifters.
#define FLEXIO_INSTANCE_COUNT
static uint8_t FLEXIO_HAL_GetShifterNum(const FLEXIO_Type *baseAddr)
Returns the number of shifters of the FlexIO module.
IRQn_Type
Defines the Interrupt Numbers definitions.
static void FLEXIO_HAL_ClearTimerStatus(FLEXIO_Type *baseAddr, uint8_t timer)
Clears the status of the specified timer.
static void FLEXIO_HAL_SetTimerInterrupt(FLEXIO_Type *baseAddr, uint8_t interruptMask, bool enable)
Enables or disables the timer interrupts.
status_t FLEXIO_DRV_DeinitDriver(const flexio_common_state_t *driver)
void INT_SYS_DisableIRQ(IRQn_Type irqNumber)
Disables an interrupt for a given IRQ number.
status_t FLEXIO_DRV_Reset(uint32_t instance)
Resets the FlexIO device.
static void FLEXIO_DRV_ResourcesInit(uint32_t instance, const flexio_common_state_t *driver)
status_t OSIF_MutexCreate(mutex_t *const pMutex)
Create an unlocked mutex.
const IRQn_Type g_flexioIrqId[FLEXIO_INSTANCE_COUNT]
static uint32_t FLEXIO_HAL_GetAllTimerStatus(const FLEXIO_Type *baseAddr)
Returns the current status of all timers.
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
static uint32_t FLEXIO_HAL_GetAllShifterErrorStatus(const FLEXIO_Type *baseAddr)
Returns the current error status for all shifters.
const uint8_t g_flexioDMASrc[FLEXIO_INSTANCE_COUNT][FEATURE_FLEXIO_MAX_SHIFTER_COUNT]
void FLEXIO_HAL_Init(FLEXIO_Type *baseAddr)
Initializes the FlexIO module to a known state.
static uint32_t FLEXIO_HAL_GetAllShifterErrorInterrupt(const FLEXIO_Type *baseAddr)
Returns the current status of all the shifter error interrupts.
status_t FLEXIO_DRV_InitDriver(uint32_t instance, flexio_common_state_t *driver)
clock_names_t
Clock names.
#define OSIF_WAIT_FOREVER
static void FLEXIO_DRV_Deallocate(uint32_t instance, const flexio_common_state_t *driver)
void FLEXIO_IRQHandler(void)
flexio_device_state_t * g_flexioDeviceStatePtr[FLEXIO_INSTANCE_COUNT]
status_t FLEXIO_DRV_DeinitDevice(uint32_t instance)
De-initializes the FlexIO device.
#define FEATURE_FLEXIO_MAX_SHIFTER_COUNT
void INT_SYS_EnableIRQ(IRQn_Type irqNumber)
Enables an interrupt for a given IRQ number.
static void FLEXIO_HAL_ClearShifterErrorStatus(FLEXIO_Type *baseAddr, uint8_t shifter)
Clears the error status of the specified shifter.
static void FLEXIO_HAL_SetShifterErrorInterrupt(FLEXIO_Type *baseAddr, uint8_t interruptMask, bool enable)
Enables or disables the shifter error interrupts.
const clock_names_t g_flexioClock[FLEXIO_INSTANCE_COUNT]
status_t FLEXIO_DRV_InitDevice(uint32_t instance, flexio_device_state_t *deviceState)
Initializes the FlexIO device.
static void FLEXIO_HAL_SetEnable(FLEXIO_Type *baseAddr, bool enable)
Enables of disables the FlexIO module.
static uint32_t FLEXIO_HAL_GetAllShifterInterrupt(const FLEXIO_Type *baseAddr)
Returns the current status of all the shifter interrupts.
static void FLEXIO_HAL_ClearShifterStatus(FLEXIO_Type *baseAddr, uint8_t shifter)
Clears the status of the specified shifter.
static void FLEXIO_HAL_SetShifterDMARequest(FLEXIO_Type *baseAddr, uint8_t requestMask, bool enable)
Enables or disables the shifter DMA requests.
static uint32_t FLEXIO_HAL_GetAllTimerInterrupt(const FLEXIO_Type *baseAddr)
Returns the current status of all the timer interrupts.