tinyproto
win32_hal.h
1 /*
2  Copyright 2020-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 <windows.h>
32 //#include <pthread.h>
33 //#include <unistd.h>
34 #include <stdint.h>
35 #include <time.h>
36 
37 #ifndef CONFIG_ENABLE_CHECKSUM
38 #define CONFIG_ENABLE_CHECKSUM
39 #endif
40 
41 #ifndef CONFIG_ENABLE_FCS16
42 #define CONFIG_ENABLE_FCS16
43 #endif
44 
45 #ifndef CONFIG_ENABLE_FCS32
46 #define CONFIG_ENABLE_FCS32
47 #endif
48 
49 #define CONFIG_TINYHAL_THREAD_SUPPORT 1
50 
51 #ifndef DOXYGEN_SHOULD_SKIP_THIS
52 
57 typedef HANDLE tiny_mutex_t;
58 
63 typedef struct
64 {
65  uint8_t bits;
66  uint16_t waiters;
67  CRITICAL_SECTION mutex;
68  CONDITION_VARIABLE cond;
70 
71 #endif
Events group type used by Tiny Protocol implementation.
Definition: cpp_hal.h:60