HAL Q Functions

Q Initialization and de-initialization functions

group Q_Exported_Functions_Group1

This section provides functions allowing to initialize and de-initialize the logical Q object :

  • Call the function HAL_Q_Init() initialize the logical Q object and associate its operation information.

  • Call the function HAL_Q_DeInit() to de-initialize the logical Q object and unlink its nodes.

Functions

hal_status_t HAL_Q_Init ( hal_q_t * p_q , const hal_q_desc_ops_t * p_desc_ops )

Initialize the logical Q object and associate its operation information.

Note

The p_desc_ops is a constant provided by HAL PPP modules that supports linked-list feature titled HAL_PPP_{mode}_DescOps or HAL_PPP_DescOps.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_desc_ops – Pointer to a hal_q_desc_ops_t structure that contains Q operation information.

Return values :
  • HAL_OK – In case of valid initialization.

  • HAL_INVALID_PARAM – In case of invalid parameter.

void HAL_Q_DeInit ( hal_q_t * p_q )

Deinitialize the logical Q object and unlink its node(s).

Parameters :

p_q – Pointer to a hal_q_t structure that contains Q information.

Q node insertion functions

group Q_Exported_Functions_Group2

This section provides functions allowing to insert new node in any Q position :

Functions

hal_status_t HAL_Q_InsertNode ( hal_q_t * p_q , const void * p_node , void * p_new_node )

Insert a new node after a previous node in a Q.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_node – Pointer to node that specifies insertion position. When null, the new node is placed at the head of Q

  • p_new_node – Pointer to new node.

Return values :
  • HAL_OK – In case of node inserted successfully.

  • HAL_INVALID_PARAM – In case of invalid parameter.

  • HAL_ERROR – In case of p_prev_node node not found in the Q.

hal_status_t HAL_Q_InsertNode_Head ( hal_q_t * p_q , void * p_new_node )

Insert a new node in the head of the Q.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_new_node – Pointer to a new node.

Return values :
  • HAL_OK – In case of node inserted successfully in the head of the Q.

  • HAL_ERROR – In case of node not inserted.

  • HAL_INVALID_PARAM – In case of invalid parameter.

hal_status_t HAL_Q_InsertNode_Tail ( hal_q_t * p_q , void * p_new_node )

Insert a new node in the tail of the Q.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_new_node – Pointer to a new node.

Return values :
  • HAL_OK – In case of node inserted successfully in the tail of the Q.

  • HAL_ERROR – In case of node not inserted.

  • HAL_INVALID_PARAM – In case of invalid parameter.

Q node removing functions

group Q_Exported_Functions_Group3

This section provides functions allowing to remove any existing node from a Q :

Functions

hal_status_t HAL_Q_RemoveNode ( hal_q_t * p_q , const void * p_node )

Remove node from the Q.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_node – Pointer to a previous node.

Return values :
  • HAL_OK – In case of node removed successfully.

  • HAL_INVALID_PARAM – In case of invalid parameter.

  • HAL_ERROR – In case of node not found in the Q.

hal_status_t HAL_Q_RemoveNode_Head ( hal_q_t * p_q )

Remove the head node of Q.

Parameters :

p_q – Pointer to a hal_q_t structure that contains Q information.

Return values :
  • HAL_OK – In case of head node removed successfully.

  • HAL_ERROR – In case of node not found.

  • HAL_INVALID_PARAM – In case of invalid parameter.

hal_status_t HAL_Q_RemoveNode_Tail ( hal_q_t * p_q )

Remove the tail node of Q.

Parameters :

p_q – Pointer to a hal_q_t structure that contains Q information.

Return values :
  • HAL_OK – In case of tail node removed successfully.

  • HAL_ERROR – In case of node not found.

  • HAL_INVALID_PARAM – In case of invalid parameter.

Q node replacing functions

group Q_Exported_Functions_Group4

This section provides functions allowing to replace any existing node in a Q :

Functions

hal_status_t HAL_Q_ReplaceNode ( hal_q_t * p_q , const void * p_old_node , void * p_new_node )

Replace node in the Q.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_old_node – Pointer to a old node.

  • p_new_node – Pointer to a new node.

Return values :
  • HAL_OK – In case of node replaced successfully.

  • HAL_INVALID_PARAM – In case of invalid parameter.

  • HAL_ERROR – In case of old node not found in the Q.

hal_status_t HAL_Q_ReplaceNode_Head ( hal_q_t * p_q , void * p_new_node )

Replace the head node in the Q.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_new_node – Pointer to a new node.

Return values :
  • HAL_OK – In case of head node replaced successfully.

  • HAL_ERROR – In case of old node not found in the Q.

  • HAL_INVALID_PARAM – In case of invalid parameter.

hal_status_t HAL_Q_ReplaceNode_Tail ( hal_q_t * p_q , void * p_new_node )

Replace the tail node in the Q.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_new_node – Pointer to a new node.

Return values :
  • HAL_OK – In case of tail node replaced successfully.

  • HAL_ERROR – In case of old node not found in the Q.

  • HAL_INVALID_PARAM – In case of invalid parameter.

Q inserting Q functions

group Q_Exported_Functions_Group5

This section provides functions allowing to insert a source Q in any destination Q position :

Functions

hal_status_t HAL_Q_InsertQ ( hal_q_t * p_dest_q , hal_q_t * p_src_q , const void * p_node )

Insert a source Q directly after the previous node in the destination Q.

Parameters :
  • p_dest_q – Pointer to a hal_q_t structure that contains Q information.

  • p_src_q – Pointer to a hal_q_t structure that contains Q information.

  • p_node – Pointer to a previous node. When null, the source Q node(s) is placed at the head of destination Q.

Return values :
  • HAL_OK – In case of source Q inserted successfully in destination Q.

  • HAL_INVALID_PARAM – In case of invalid parameter.

  • HAL_ERROR – In case of p_prev_node node not found in the Q.

hal_status_t HAL_Q_InsertQ_Head ( hal_q_t * p_dest_q , hal_q_t * p_src_q )

Insert a source Q in the head of destination Q.

Parameters :
  • p_dest_q – Pointer to a hal_q_t structure that contains Q information.

  • p_src_q – Pointer to a hal_q_t structure that contains Q information.

Return values :
  • HAL_OK – In case of head source Q inserted successfully in head destination Q.

  • HAL_ERROR – In case of source Q not inserted in destination Q.

  • HAL_INVALID_PARAM – In case of invalid parameter.

hal_status_t HAL_Q_InsertQ_Tail ( hal_q_t * p_dest_q , hal_q_t * p_src_q )

Insert a source Q in the tail of destination Q.

Parameters :
  • p_dest_q – Pointer to a hal_q_t structure that contains Q information.

  • p_src_q – Pointer to a hal_q_t structure that contains Q information.

Return values :
  • HAL_OK – In case of tail source Q inserted successfully in tail destination Q.

  • HAL_ERROR – In case of source Q not inserted in destination Q.

  • HAL_INVALID_PARAM – In case of invalid parameter.

Q circularizing Q functions

group Q_Exported_Functions_Group6

This section provides functions allowing to set and clear a circular link to any node in not empty Q :

Functions

hal_status_t HAL_Q_SetCircularLinkQ ( hal_q_t * p_q , void * p_node )

Set circular link to any selected Q node.

Parameters :
  • p_q – Pointer to a hal_q_t structure that contains Q information.

  • p_node – Pointer to first circular node.

Return values :
  • HAL_OK – In case of Q is circularized.

  • HAL_INVALID_PARAM – In case of invalid parameter.

  • HAL_ERROR – In case of p_node node not found in the Q.

hal_status_t HAL_Q_SetCircularLinkQ_Head ( hal_q_t * p_q )

Set Q circular mode.

Parameters :

p_q – Pointer to a hal_q_t structure that contains Q information.

Return values :
  • HAL_OK – In case of Q is circularized on Head.

  • HAL_INVALID_PARAM – In case of invalid parameter.

hal_status_t HAL_Q_SetCircularLinkQ_Tail ( hal_q_t * p_q )

Set Q circular mode.

Parameters :

p_q – Pointer to a hal_q_t structure that contains Q information.

Return values :
  • HAL_OK – In case of Q is circularized on Tail.

  • HAL_INVALID_PARAM – In case of invalid parameter.

hal_status_t HAL_Q_ClearCircularLinkQ ( hal_q_t * p_q )

Clear circular mode of Q.

Parameters :

p_q – Pointer to a hal_q_t structure that contains Q information.

Return values :

HAL_OK – In case of Q is Cleared.