tinyproto
cpp_hal.h
1 /*
2  Copyright 2022 (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 <stdint.h>
32 
33 /* For fastest version of protocol assign all defines to zero.
34  * In this case protocol supports no CRC field, and
35  * all api functions become not thread-safe.
36  */
37 
38 #ifndef CONFIG_ENABLE_CHECKSUM
39 #define CONFIG_ENABLE_CHECKSUM
40 #endif
41 
42 #ifndef CONFIG_ENABLE_FCS16
43 #define CONFIG_ENABLE_FCS16
44 #endif
45 
46 #ifndef CONFIG_ENABLE_FCS32
47 #define CONFIG_ENABLE_FCS32
48 #endif
49 
54 typedef uintptr_t tiny_mutex_t;
55 
60 typedef struct
61 {
63  tiny_mutex_t mutex;
65  uint8_t bits;
67 
uint8_t bits
Current state of bits.
Definition: cpp_hal.h:65
tiny_mutex_t mutex
Mutex object to protect bits.
Definition: cpp_hal.h:63
Events group type used by Tiny Protocol implementation.
Definition: cpp_hal.h:60