AM62D FreeRTOS SDK  11.00.00
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

Introduction

This module contains APIs to program and use the SPINLOCK module.

Files

file  spinlock/v0/spinlock.h
 SPINLOCK Driver API/interface file.
 

Functions

uint32_t Spinlock_getNumLocks (uint32_t baseAddr)
 This API provides returns the number of locks supported. More...
 
int32_t Spinlock_lock (uint32_t baseAddr, uint32_t lockNumber)
 This API performs the Read operation for Lock status of the SPINLOCK_LOCK_REG, in order to acquire a Spinlock. More...
 
void Spinlock_unlock (uint32_t baseAddr, uint32_t lockNumber)
 This API performs the write operation for Lock status of the SPINLOCK_LOCK_REG, in order to Free the lock If lockNumber is invalid (out of range), no operation is performed Lock state : Write 0x0: Set the lock to Not Taken(Free) Write 0x1: No update to the lock value. More...
 
void Spinlock_moduleReset (uint32_t baseAddr)
 This API performs the module reset of the Spinlock module. It also waits until the reset process is complete.
. More...
 

Macros

#define SPINLOCK_LOCK_STATUS_FREE   (0U)
 Flag to indicate spinlock is free. More...
 
#define SPINLOCK_LOCK_STATUS_INUSE   (1U)
 Flag to indicate spinlock is in use. More...
 

Macro Definition Documentation

◆ SPINLOCK_LOCK_STATUS_FREE

#define SPINLOCK_LOCK_STATUS_FREE   (0U)

Flag to indicate spinlock is free.

◆ SPINLOCK_LOCK_STATUS_INUSE

#define SPINLOCK_LOCK_STATUS_INUSE   (1U)

Flag to indicate spinlock is in use.

Function Documentation

◆ Spinlock_getNumLocks()

uint32_t Spinlock_getNumLocks ( uint32_t  baseAddr)

This API provides returns the number of locks supported.

Parameters
baseAddrMemory address of SPINLOCK module
Returns
Number of locks in an instance

◆ Spinlock_lock()

int32_t Spinlock_lock ( uint32_t  baseAddr,
uint32_t  lockNumber 
)

This API performs the Read operation for Lock status of the SPINLOCK_LOCK_REG, in order to acquire a Spinlock.

Parameters
baseAddrMemory address of SPINLOCK module
lockNumberLock number in Spinlock module that should be acquired
Returns
Status of the Lock Register Lock state : SPINLOCK_LOCK_STATUS_FREE: Lock was previously NOT Taken (Free). The requester is granted the lock SPINLOCK_LOCK_STATUS_INUSE: Lock was previously Taken (Not Free). The requester is not granted the lock and must retry SystemP_FAILURE: lockNumber is invalid (out of range)

◆ Spinlock_unlock()

void Spinlock_unlock ( uint32_t  baseAddr,
uint32_t  lockNumber 
)

This API performs the write operation for Lock status of the SPINLOCK_LOCK_REG, in order to Free the lock If lockNumber is invalid (out of range), no operation is performed Lock state : Write 0x0: Set the lock to Not Taken(Free) Write 0x1: No update to the lock value.

Parameters
baseAddrMemory address of SPINLOCK module
lockNumberLock number in Spinlock module that should be released

◆ Spinlock_moduleReset()

void Spinlock_moduleReset ( uint32_t  baseAddr)

This API performs the module reset of the Spinlock module. It also waits until the reset process is complete.
.

Parameters
baseAddrMemory address of SPINLOCK module.