distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
Semaphore.h File Reference

Header of C-API for distortos::Semaphore. More...

#include "estd/C-API/IntrusiveList.h"
#include <limits.h>
#include <stdint.h>
Include dependency graph for Semaphore.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  distortos_Semaphore
 C-API equivalent of distortos::Semaphore. More...
 

Macros

#define DISTORTOS_SEMAPHORE_INITIALIZER(self, value, maxValue)   {ESTD_INTRUSIVELIST_INITIALIZER((self).blockedList), (value) < (maxValue) ? (value) : (maxValue), (maxValue)}
 Initializer for distortos_Semaphore. More...
 
#define DISTORTOS_SEMAPHORE_CONSTRUCT_1(name, value, maxValue)   struct distortos_Semaphore name = DISTORTOS_SEMAPHORE_INITIALIZER(name, value, maxValue)
 C-API equivalent of distortos::Semaphore's constructor. More...
 
#define DISTORTOS_SEMAPHORE_CONSTRUCT(name, value)   DISTORTOS_SEMAPHORE_CONSTRUCT_1(name, value, UINT_MAX)
 C-API equivalent of distortos::Semaphore's constructor, maxValue == UINT_MAX. More...
 

Functions

int distortos_Semaphore_construct_1 (struct distortos_Semaphore *semaphore, unsigned int value, unsigned int maxValue)
 C-API equivalent of distortos::Semaphore's constructor. More...
 
static int distortos_Semaphore_construct (struct distortos_Semaphore *const semaphore, const unsigned int value)
 C-API equivalent of distortos::Semaphore's constructor, maxValue == UINT_MAX. More...
 
int distortos_Semaphore_destruct (struct distortos_Semaphore *semaphore)
 C-API equivalent of distortos::Semaphore's destructor. More...
 
int distortos_Semaphore_getMaxValue (const struct distortos_Semaphore *semaphore, unsigned int *maxValue)
 C-API equivalent of distortos::Semaphore::getMaxValue() More...
 
int distortos_Semaphore_getValue (const struct distortos_Semaphore *semaphore, unsigned int *value)
 C-API equivalent of distortos::Semaphore::getValue() More...
 
int distortos_Semaphore_post (struct distortos_Semaphore *semaphore)
 C-API equivalent of distortos::Semaphore::post() More...
 
int distortos_Semaphore_tryWait (struct distortos_Semaphore *semaphore)
 C-API equivalent of distortos::Semaphore::tryWait() More...
 
int distortos_Semaphore_tryWaitFor (struct distortos_Semaphore *semaphore, int64_t duration)
 C-API equivalent of distortos::Semaphore::tryWaitFor() More...
 
int distortos_Semaphore_tryWaitUntil (struct distortos_Semaphore *semaphore, int64_t timePoint)
 C-API equivalent of distortos::Semaphore::tryWaitUntil() More...
 
int distortos_Semaphore_wait (struct distortos_Semaphore *semaphore)
 C-API equivalent of distortos::Semaphore::wait() More...
 

Detailed Description

Header of C-API for distortos::Semaphore.

Author
Copyright (C) 2017-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.