A helper API for Task creation for the user domain and also a wrapper module for the task creation functions of FreeRTOS.

This module is used to control and limit the use of task creation by the user so to accommodate easy backward compatibility in the future.

  • This module is limited to when the RTOS Scheduler is not running

  • 2020 Silicon Laboratories Inc.

Modules#

ZW_UserTask_Buffer_t

ZW_UserTask_t

Enumerations#

enum
USERTASK_PRIORITY_BACKGROUND = 0
USERTASK_PRIORITY_NORMAL
USERTASK_PRIORITY_HIGHEST
}
enum
Code_Success = 0
Code_Fail_Unknown
Code_Fail_NoMemory
Code_Fail_LimitReached
Code_Fail_NotFound
Code_Fail_Suspended
Code_Fail_InvalidState
Code_Fail_InvalidOperation
Code_Fail_InvalidParameter
Code_DependencyUnavailable
Code_Fail_Busy
Code_Fail_Timeout
Code_Fail_Driver
Code_Fail_NotImplemented
Code_Fail_NotAllowed
}

Return code used by the functions in this module.

Functions#

Initializes this module.

ZW_UserTask_CreateTask(ZW_UserTask_t *task, TaskHandle_t *xHandle)

Used to create user application level tasks.

bool
ZW_UserTask_ApplicationRegisterTask(void(*appTaskFunc)(SApplicationHandles *), uint8_t iZwRxQueueTaskNotificationBitNumber, uint8_t iZwCommandStatusQueueTaskNotificationBitNumber, const SProtocolConfig_t *pProtocolConfig)

Used to create the main application task at highest UserTask priority.

Enumeration Documentation#

ZW_UserTask_Priority_t#

ZW_UserTask_Priority_t
Enumerator
USERTASK_PRIORITY_BACKGROUND

Right above idle priority. Good for HMI and worker threads.

USERTASK_PRIORITY_NORMAL

The default 'APP'-task priority.

USERTASK_PRIORITY_HIGHEST

High priority UserTask. Good for handling interrupts requests.


Definition at line 42 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZWave/API/ZW_UserTask.h

ReturnCode_t#

ReturnCode_t

Return code used by the functions in this module.

Enumerator
Code_Success

Success.

Code_Fail_Unknown

Default failed code with no helping indication.

Code_Fail_NoMemory

Failed due to lack of memory.

Code_Fail_LimitReached

A set limit is reached for this operation.

Code_Fail_NotFound

A specific entity could not be found.

Code_Fail_Suspended

The operation or the entire module is globally suspended and cannot be utilized at this point in time.

Code_Fail_InvalidState

Not in an appropriate state for this call.

Code_Fail_InvalidOperation

This operation can not be allowed at this point.

Code_Fail_InvalidParameter

Wrong/invalid input parameters.

Code_DependencyUnavailable

A required resource or dependency that this operation relies on was not setup or available. Perhaps wrong initialization order.

Code_Fail_Busy

A resource needed by this operation or call is busy. Try again later. Potential racing condition or untimely action.

Code_Fail_Timeout

Failed due to timeout.

Code_Fail_Driver

Error occurred at the driver level.

Code_Fail_NotImplemented

This operation is not supported due to limited implementation or need.

Code_Fail_NotAllowed

This operation cannot be performed, since it is blocked or not allowed.


Definition at line 60 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZWave/API/ZW_UserTask.h

Function Documentation#

ZW_UserTask_Init#

ReturnCode_t ZW_UserTask_Init (void )

Initializes this module.

Parameters
N/A
  • Should not be used directly.

Return Returns ReturnCode_t. See Also


Definition at line 84 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZWave/API/ZW_UserTask.h

ZW_UserTask_CreateTask#

ReturnCode_t ZW_UserTask_CreateTask (ZW_UserTask_t * task, TaskHandle_t * xHandle)

Used to create user application level tasks.

Parameters
[out]task

Used to return the task handle. Can be NULL Return Returns ReturnCode_t. See ReturnCode_t for more info.

N/AxHandle

See Also


Definition at line 93 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZWave/API/ZW_UserTask.h

ZW_UserTask_ApplicationRegisterTask#

bool ZW_UserTask_ApplicationRegisterTask (void(*)(SApplicationHandles *) appTaskFunc, uint8_t iZwRxQueueTaskNotificationBitNumber, uint8_t iZwCommandStatusQueueTaskNotificationBitNumber, const SProtocolConfig_t * pProtocolConfig)

Used to create the main application task at highest UserTask priority.

Parameters
N/AappTaskFunc

Application task that will be triggered by FreeRTOS. (function pointer)

N/AiZwRxQueueTaskNotificationBitNumber

The bit number set by Protocol when a message has been put on the ZW Rx queue. (Receiving EAPPLICATIONEVENT_ZWRX events)

N/AiZwCommandStatusQueueTaskNotificationBitNumber

The bit number Set by Protocol when a message has been put on the ZW command status queue. (Receiving EAPPLICATIONEVENT_ZWCOMMANDSTATUS events)

N/ApProtocolConfig

Pointer to a statically allocated Protocol Config structure.

This function further registers Queue Notification Bit Numbers so that an association is created between the bit number and the event handle to invoke for that event, when it occurs.

This function should only be called once, or false is returned

  • This task is the only UserTask that should use the ZAF API functions. Accessing the ZAF API functions from any other ZW_UserTask.h generated tasks will lead to undefined behavior

See Also

Returns

  • true if the main APP task was created successfully, false if not.


Definition at line 115 of file /mnt/raid/workspaces/ws.Mh9rMZz8x/overlay/gsdk/protocol/z-wave/ZWave/API/ZW_UserTask.h