SwTimerLiasion#

Modules#

SSwTimerLiaison

Enumerations#

enum
ESWTIMERLIAISON_STATUS_SUCCESS = 0
ESWTIMERLIAISON_STATUS_LIST_FULL
ESWTIMERLIAISON_STATUS_ALREADY_REGISTRERED
}

Defines return values from SwTimerLiaison methods.

Typedefs#

Defines return values from SwTimerLiaison methods.

typedef struct SSwTimerLiaison

TimerLiaison object.

Functions#

void
TimerLiaisonInit(SSwTimerLiaison *pThis, uint32_t iTimerPointerArraySize, SSwTimer **pTimerPointerArray, uint8_t iTaskNotificationBitNumber, void *ReceiverTask)

Initialize TimerLiaison.

void
TimerLiaisonSetReceiverTask(SSwTimerLiaison *pThis, void *ReceiverTask)

Configures the Receiver task of callbacks.

TimerLiaisonRegister(SSwTimerLiaison *pThis, SSwTimer *pTimer, bool bAutoReload, void(*pCallback)(SSwTimer *pTimer))

Register a SwTimer to a TimerLiaison.

void
TimerLiaisonNotificationHandler(SSwTimerLiaison *pThis)

Must be called from requested callback task when the task notification bit assigned to TimerLiaison is set.

void
TimerLiaisonClearPendingTimerEvent(SSwTimerLiaison *pThis, uint32_t TimerId)

Method provided for the SwTimers to call.

void
TimerLiaisonClearPendingTimerEventFromISR(SSwTimerLiaison *pThis, uint32_t TimerId)

Method provided for the SwTimers to call from ISR.

bool
TimerLiaisonHasPendingTimerEvent(SSwTimerLiaison *pThis, uint32_t TimerId)

Method provided for the SwTimers to call.

bool
TimerLiaisonHasPendingTimerEventFromISR(SSwTimerLiaison *pThis, uint32_t TimerId)

Method provided for the SwTimers to call from ISR.

Macros#

#define
PRIVATE_STATIC_TIMER_SIZE 9

Space for holding FreeRTOS StaticTimer_t.

Enumeration Documentation#

ESwTimerLiaisonStatus#

ESwTimerLiaisonStatus

Defines return values from SwTimerLiaison methods.

Enumerator
ESWTIMERLIAISON_STATUS_SUCCESS

ESWTIMERLIAISON_STATUS_SUCCESS.

ESWTIMERLIAISON_STATUS_LIST_FULL

ESWTIMERLIAISON_STATUS_LIST_FULL.

ESWTIMERLIAISON_STATUS_ALREADY_REGISTRERED

ESWTIMERLIAISON_STATUS_ALREADY_REGISTRERED.


Typedef Documentation#

ESwTimerLiaisonStatus#

typedef enum ESwTimerLiaisonStatus ESwTimerLiaisonStatus

Defines return values from SwTimerLiaison methods.


SSwTimerLiaison#

typedef struct SSwTimerLiaison SSwTimerLiaison

TimerLiaison object.

All content is private.


Function Documentation#

TimerLiaisonInit#

void TimerLiaisonInit (SSwTimerLiaison * pThis, uint32_t iTimerPointerArraySize, SSwTimer ** pTimerPointerArray, uint8_t iTaskNotificationBitNumber, void * ReceiverTask)

Initialize TimerLiaison.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

uint32_t[in]iTimerPointerArraySize

Number of entries in provided SwTimer pointer array (range 0 - 24)

SSwTimer **[in]pTimerPointerArray

Pointer to provided array of pointers to SwTimer objects

uint8_t[in]iTaskNotificationBitNumber

Number defines which bit to use when notifying receiver task of pending timer event (range 0 - 31)

void *[in]ReceiverTask

Handle to FreeRTOS task that Timer callbacks Will be performed in. Argument may be NULL if task handle is not available at Liaison init time, but ReceiverTask must then be set with TimerLiaisonSetReceiverTask before any registered Timer times out.


TimerLiaisonSetReceiverTask#

void TimerLiaisonSetReceiverTask (SSwTimerLiaison * pThis, void * ReceiverTask)

Configures the Receiver task of callbacks.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

void *[in]ReceiverTask

Handle to FreeRTOS task that Timer callbacks will be performed in.

Provided as the TimerLiaison may be needed for registrering SwTimers before the receiver task is created, meaning TimerLiaision init is called prior to the Receiver task handle being available. Though not the intention, the receiver task can be changed run time.


TimerLiaisonRegister#

ESwTimerLiaisonStatus TimerLiaisonRegister (SSwTimerLiaison * pThis, SSwTimer * pTimer, bool bAutoReload, void(*)(SSwTimer *pTimer) pCallback)

Register a SwTimer to a TimerLiaison.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

SSwTimer *[in]pTimer

Pointer to the SwTimer object to register

bool[in]bAutoReload

Enable timer auto reload on timeout. Configuration of AutoReload cannot be changed after registration.

void(*)(SSwTimer *pTimer)[in]pCallback

Callback method of type void Callback(SSwTimer* pTimer). Argument may be NULL, in which case no callback is performed.

Initial SwTimer configuration is also performed.

Method creates a static FreeRTOS timer from the SwTimer object passed as argument. An SwTimer can NOT be registered to several TimerLiaisons. If calling method TimerLiaisonRegister on the same SwTimer object multiple times, all but the first call will be ignored. Unregistered timers are expected to be zero initialized SSwTimer structs.


TimerLiaisonNotificationHandler#

void TimerLiaisonNotificationHandler (SSwTimerLiaison * pThis)

Must be called from requested callback task when the task notification bit assigned to TimerLiaison is set.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

Method will perform pending callbacks. There is no side effects from calling method when assigned task notification bit was not set.


TimerLiaisonClearPendingTimerEvent#

void TimerLiaisonClearPendingTimerEvent (SSwTimerLiaison * pThis, uint32_t TimerId)

Method provided for the SwTimers to call.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

uint32_t[in]TimerId

Which timer to clear pending events of.

Method clears pending timeout callback (if one is pending).


TimerLiaisonClearPendingTimerEventFromISR#

void TimerLiaisonClearPendingTimerEventFromISR (SSwTimerLiaison * pThis, uint32_t TimerId)

Method provided for the SwTimers to call from ISR.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

uint32_t[in]TimerId

Which timer to clear pending events of.

Method clears pending timeout callback (if one is pending).


TimerLiaisonHasPendingTimerEvent#

bool TimerLiaisonHasPendingTimerEvent (SSwTimerLiaison * pThis, uint32_t TimerId)

Method provided for the SwTimers to call.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

uint32_t[in]TimerId

Which timer to check for pending callback.

Method returns if a timer has a pending timeout callback.


TimerLiaisonHasPendingTimerEventFromISR#

bool TimerLiaisonHasPendingTimerEventFromISR (SSwTimerLiaison * pThis, uint32_t TimerId)

Method provided for the SwTimers to call from ISR.

Parameters
TypeDirectionArgument NameDescription
SSwTimerLiaison *[in]pThis

Pointer to the TimerLiaison object

uint32_t[in]TimerId

Which timer to check for pending callback.

Method returns if a timer has a pending timeout callback.