tinyproto
tiny_fd_frames_int.h
1 /*
2  Copyright 2021-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 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 
38 #include "hal/tiny_types.h"
39 #include <stdint.h>
40 #include <stdbool.h>
41 
42  typedef enum
43  {
44  TINY_FD_QUEUE_FREE = 0x01,
45  TINY_FD_QUEUE_U_FRAME = 0x02,
46  TINY_FD_QUEUE_S_FRAME = 0x04,
47  TINY_FD_QUEUE_I_FRAME = 0x08
48  } tiny_fd_queue_type_t;
49 
50  typedef struct
51  {
52  uint8_t address; // address field of HDLC protocol
53  uint8_t control; // control field of HDLC protocol
55 
56  typedef struct
57  {
58  uint8_t type;
59  int len;
60  /* Aligning header to 1 byte, since header and user_payload together are the byte-stream */
62  uint8_t payload[2];
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif
Definition: tiny_fd_frames_int.h:50
#define TINY_ALIGNED(x)
This macro is used internally for aligning the structures.
Definition: tiny_types.h:88
Definition: tiny_fd_frames_int.h:56
This is Tiny HAL implementation for microcontrollers.
uint8_t type
tiny_fd_queue_type_t value
Definition: tiny_fd_frames_int.h:58
int len
payload of the frame
Definition: tiny_fd_frames_int.h:59