S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
p_sopc_synchronisation.h
Go to the documentation of this file.
1/*
2 * Licensed to Systerel under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work
4 * for additional information regarding copyright ownership.
5 * Systerel licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this
7 * file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef P_SYNCHRONISATION_H
21#define P_SYNCHRONISATION_H
22
23#include <limits.h> /* stdlib includes */
24#include <stdbool.h>
25#include <stddef.h>
26#include <stdint.h>
27#include <stdio.h>
28#include <string.h>
29
30#include "sopc_enums.h"
31#include "sopc_mutexes.h"
32
33#include "FreeRTOS.h"
34#include "semphr.h"
35#include "task.h"
36
37#include "p_sopc_utils.h"
38
39/*****Private condition variable api*****/
40
41/* Warning: MAX_WAITERS shall be equal to or smaller than MAX_P_UTILS_LIST */
42#define MAX_WAITERS (MAX_P_UTILS_LIST)
43
44#define JOINTURE_SIGNAL (0x80000000)
45#define JOINTURE_CLEAR_SIGNAL (0x40000000)
46#define APP_DEFAULT_SIGNAL (0x20000000)
47#define APP_CLEARING_SIGNAL (0x10000000)
48
50{
51 E_COND_VAR_STATUS_NOT_INITIALIZED, // Condition variable not initialized
52 E_COND_VAR_STATUS_INITIALIZED, // Condition variable initialized
53 E_COND_VAR_STATUS_SIZEOF = INT32_MAX
55
57{
58 eConditionVariableStatus status; // Status condition variable
59 SemaphoreHandle_t handleLockCounter; // Critical section token
60 tUtilsList taskList; // List of task with signal expected, calling unlock and wait
61};
62
64{
65 QueueHandle_t handle;
66};
67
68#endif
enum T_CONDITION_VARIABLE_STATUS eConditionVariableStatus
T_CONDITION_VARIABLE_STATUS
Definition p_sopc_synchronisation.h:50
@ E_COND_VAR_STATUS_SIZEOF
Definition p_sopc_synchronisation.h:53
@ E_COND_VAR_STATUS_INITIALIZED
Definition p_sopc_synchronisation.h:52
@ E_COND_VAR_STATUS_NOT_INITIALIZED
Definition p_sopc_synchronisation.h:51
Definition p_sopc_synchronisation.h:57
tUtilsList taskList
Definition p_sopc_synchronisation.h:60
SemaphoreHandle_t handleLockCounter
Definition p_sopc_synchronisation.h:59
eConditionVariableStatus status
Definition p_sopc_synchronisation.h:58
Definition p_sopc_synchronisation.h:64
QueueHandle_t handle
Definition p_sopc_synchronisation.h:65
Definition p_sopc_utils.h:43