Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 6642f69a367fe913f5bf17a1771419903a51e53c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*******************************************************************************
 * Copyright (c) 2013 protos software gmbh (http://www.protos.de).
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * CONTRIBUTORS:
 * 		Thomas Schuetz (initial contribution)
 *
 *******************************************************************************/

#ifndef _ETSEMA_H_
#define _ETSEMA_H_

/**
 * \file etSema.h
 *
 * etSema.h defines a generic interface for platform specific implementations of a semaphore
 *
 * \author Thomas Schuetz
 */

#include "etDatatypes.h"

/**
 * etSema holds the object data for a semaphore (for self pointer)
 */
typedef struct etSema {
	etOSSemaData osData;
} etSema;

/**
 * initializes the semaphore
 * \param self the 'this' pointer of the semaphore
 */
void etSema_construct(etSema* self);

/**
 * destroys the semaphore
 * \param self the 'this' pointer of the semaphore
 */
void etSema_destruct(etSema* self);

/**
 * wakes up the semaphore
 * \param self the 'this' pointer of the semaphore
 */
void etSema_wakeup(etSema* self);
void etSema_wakeupFromISR(etSema* self);

/**
 * make the semaphore waiting for a wakeup
 * \param self the 'this' pointer of the semaphore
 */
void etSema_waitForWakeup(etSema* self);


#endif /* _ETSEMA_H_ */

Back to the top