tinyproto
linux_hal.h
1 /*
2  Copyright 2016-2024 (C) Alexey Dynda
3 
4  This file is part of Tiny Protocol Library.
5 
6  GNU General Public License Usage
7 
8  Protocol Library is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  Protocol Library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with Protocol Library. If not, see <http://www.gnu.org/licenses/>.
20 
21  Commercial License Usage
22 
23  Licensees holding valid commercial Tiny Protocol licenses may use this file in
24  accordance with the commercial license agreement provided in accordance with
25  the terms contained in a written agreement between you and Alexey Dynda.
26  For further information contact via email on github account.
27 */
28 
29 #pragma once
30 
31 #include <pthread.h>
32 #include <unistd.h>
33 #include <stdint.h>
34 #include <time.h>
35 
36 #ifndef CONFIG_ENABLE_CHECKSUM
37 #define CONFIG_ENABLE_CHECKSUM
38 #endif
39 
40 #ifndef CONFIG_ENABLE_FCS16
41 #define CONFIG_ENABLE_FCS16
42 #endif
43 
44 #ifndef CONFIG_ENABLE_FCS32
45 #define CONFIG_ENABLE_FCS32
46 #endif
47 
48 #define CONFIG_TINYHAL_THREAD_SUPPORT 1
49 
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51 
56 typedef pthread_mutex_t tiny_mutex_t;
57 
62 typedef struct
63 {
64  uint8_t bits;
65  uint16_t waiters;
66  pthread_mutex_t mutex;
67  pthread_cond_t cond;
69 
70 #endif
Events group type used by Tiny Protocol implementation.
Definition: cpp_hal.h:60