-
Notifications
You must be signed in to change notification settings - Fork 251
Expand file tree
/
Copy patherpc_mbf_setup.h
More file actions
87 lines (68 loc) · 2.06 KB
/
erpc_mbf_setup.h
File metadata and controls
87 lines (68 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* Copyright (c) 2016, Freescale Semiconductor, Inc.
* Copyright 2016 NXP
* All rights reserved.
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _ERPC_MBF_SETUP_H_
#define _ERPC_MBF_SETUP_H_
#include "erpc_transport_setup.h"
/*!
* @addtogroup message_buffer_factory_setup
* @{
* @file
*/
////////////////////////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////////////////////////
//! @brief Opaque MessageBufferFactory object type.
typedef struct ErpcMessageBufferFactory *erpc_mbf_t;
////////////////////////////////////////////////////////////////////////////////
// API
////////////////////////////////////////////////////////////////////////////////
#if __cplusplus > 201703L
#include "erpc_setup_mbf_static_fixed.h"
/*!
* @brief Create MessageBuffer factory which is using static fixed allocated buffers.
*/
template <size_t BUFFER_COUNT, size_t WORD_COUNT, class WORD_SIZE=uint8_t>
erpc_mbf_t erpc_mbf_static_fixed_init(void){
static ManuallyConstructed<StaticFixedMessageBufferFactory<BUFFER_COUNT, WORD_COUNT, WORD_SIZE>> s_msgFactory;
s_msgFactory.construct();
return reinterpret_cast<erpc_mbf_t>(s_msgFactory.get());
return nullptr;
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
//! @name MessageBufferFactory setup
//@{
/*!
* @brief Create MessageBuffer factory which is using static allocated buffers.
*/
erpc_mbf_t erpc_mbf_static_init(void);
/*!
* @brief Create MessageBuffer factory which is using dynamic allocated buffers.
*/
erpc_mbf_t erpc_mbf_dynamic_init(void);
/*!
* @brief Create MessageBuffer factory which is using RPMSG LITE zero copy buffers.
*
* Has to be used with RPMSG lite zero copy transport.
*/
erpc_mbf_t erpc_mbf_rpmsg_init(erpc_transport_t transport);
/*!
* @brief Create MessageBuffer factory which is using RPMSG LITE TTY buffers.
*
* Has to be used with RPMSG lite TTY transport.
*/
erpc_mbf_t erpc_mbf_rpmsg_tty_init(erpc_transport_t transport);
//@}
#ifdef __cplusplus
}
#endif
/*! @} */
#endif // _ERPC_MBF_SETUP_H_