arduino-audio-tools
Loading...
Searching...
No Matches
src
AudioTools
Concurrency
Zephyr
MutexZephyr.h
Go to the documentation of this file.
1
#pragma once
2
#include "
AudioToolsConfig.h
"
3
#include "
AudioTools/Concurrency/Mutex.h
"
4
5
#include <zephyr/kernel.h>
6
7
namespace
audio_tools
{
8
16
class
MutexZephyr
:
public
MutexBase
{
17
public
:
18
MutexZephyr
() {
k_mutex_init
(&
mutex
); }
19
virtual
~MutexZephyr
() =
default
;
20
21
void
lock
()
override
{
k_mutex_lock
(&
mutex
,
K_FOREVER
); }
22
23
void
unlock
()
override
{
k_mutex_unlock
(&
mutex
); }
24
25
protected
:
26
struct
k_mutex
mutex
;
27
};
28
33
class
MutexRecursiveZephyr
:
public
MutexBase
{
34
public
:
35
MutexRecursiveZephyr
() {
k_mutex_init
(&
mutex
); }
36
virtual
~MutexRecursiveZephyr
() =
default
;
37
38
void
lock
()
override
{
k_mutex_lock
(&
mutex
,
K_FOREVER
); }
39
40
void
unlock
()
override
{
k_mutex_unlock
(&
mutex
); }
41
42
protected
:
43
struct
k_mutex
mutex
;
44
};
45
47
using
MutexRTOS
=
MutexZephyr
;
48
using
MutexRecursiveRTOS
=
MutexRecursiveZephyr
;
49
52
using
Mutex
=
MutexZephyr
;
53
54
}
// namespace audio_tools
AudioToolsConfig.h
Mutex.h
audio_tools::MutexBase
Empty Mutex implementation which does nothing.
Definition
Mutex.h:18
audio_tools::MutexRP2040
Mutex API for non IRQ mutual exclusion between cores. Mutexes are application level locks usually use...
Definition
MutexRP2040.h:38
audio_tools::MutexRTOS
Mutex implemntation using FreeRTOS.
Definition
MutexRTOS.h:25
audio_tools::MutexRecursiveRTOS
Recursive Mutex implemntation using FreeRTOS.
Definition
MutexRTOS.h:52
audio_tools::MutexRecursiveZephyr
Recursive Mutex implementation using Zephyr kernel mutex.
Definition
MutexZephyr.h:33
audio_tools::MutexRecursiveZephyr::~MutexRecursiveZephyr
virtual ~MutexRecursiveZephyr()=default
audio_tools::MutexRecursiveZephyr::unlock
void unlock() override
Definition
MutexZephyr.h:40
audio_tools::MutexRecursiveZephyr::MutexRecursiveZephyr
MutexRecursiveZephyr()
Definition
MutexZephyr.h:35
audio_tools::MutexRecursiveZephyr::mutex
struct k_mutex mutex
Definition
MutexZephyr.h:43
audio_tools::MutexRecursiveZephyr::lock
void lock() override
Definition
MutexZephyr.h:38
audio_tools::MutexZephyr
Mutex implementation using Zephyr kernel mutex.
Definition
MutexZephyr.h:16
audio_tools::MutexZephyr::MutexZephyr
MutexZephyr()
Definition
MutexZephyr.h:18
audio_tools::MutexZephyr::unlock
void unlock() override
Definition
MutexZephyr.h:23
audio_tools::MutexZephyr::mutex
struct k_mutex mutex
Definition
MutexZephyr.h:26
audio_tools::MutexZephyr::lock
void lock() override
Definition
MutexZephyr.h:21
audio_tools::MutexZephyr::~MutexZephyr
virtual ~MutexZephyr()=default
audio_tools
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition
AudioCodecsBase.h:10
audio_tools::writeData
size_t writeData(Print *p_out, T *data, int samples, int maxSamples=512)
Definition
AudioTypes.h:508
Generated by
1.9.8