Embedded Wireless Framework
ewf_interface_rx_uart.h
Go to the documentation of this file.
1 /************************************************************************/
9 #ifndef __ewf_interface_rx_uart__h__included__
10 #define __ewf_interface_rx_uart__h__included__
11 
12 #include "ewf_interface.h"
13 
14 #include "r_smc_entry.h"
15 #include "platform.h" // Located in the FIT BSP module
16 #include "r_sci_rx_if.h" // The SCI module API interface file.
17 #include "r_byteq_if.h" // The BYTEQ module API interface file.
18 #include "r_sci_rx_config.h" // User configurable options for the SCI module
19 #include "r_sci_rx_pinset.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /************************************************************************/
38 #ifndef EWF_INTERFACE_RX_UART_CONFIG_RESPONSE_QUEUE_SIZE
39 #define EWF_INTERFACE_RX_UART_CONFIG_RESPONSE_QUEUE_SIZE (8)
40 #endif
41 
42 #ifndef EWF_INTERFACE_RX_UART_CONFIG_URC_QUEUE_SIZE
43 #define EWF_INTERFACE_RX_UART_CONFIG_URC_QUEUE_SIZE (8)
44 #endif
45 
51 typedef struct _ewf_interface_rx_uart
52 {
53  uint8_t rx_buffer[sizeof(uint8_t)];
54 
56 
61 
66 
70 ewf_result ewf_interface_rx_uart_hardware_send(ewf_interface* interface_ptr, const uint8_t* buffer_ptr, uint32_t buffer_length);
71 
75 ewf_result ewf_interface_rx_uart_hardware_receive(ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t* buffer_length_ptr, bool wait);
76 
77 #ifdef EWF_PARAMETER_CHECKING
78 #define EWF_INTERFACE_RX_UART_INITIALIZE_HEADER(interface_ptr) \
79 do { \
80 (interface_ptr)->struct_magic = EWF_INTERFACE_STRUCT_MAGIC; \
81 (interface_ptr)->struct_size = EWF_INTERFACE_STRUCT_SIZE; \
82 (interface_ptr)->struct_version = EWF_INTERFACE_VERSION; \
83 (interface_ptr)->struct_type = EWF_INTERFACE_TYPE_RX_UART; \
84 } while(0)
85 #else
86 #define EWF_INTERFACE_RX_UART_INITIALIZE_HEADER(interface_ptr)
87 #endif /* EWF_PARXMETER_CHECKING */
88 
94 #define EWF_INTERFACE_RX_UART_STATIC_DECLARE(interface_ptr, interface_name_symb) \
95 do { \
96 static ewf_interface_rx_uart ewf_interface_rx_uart__implementation__##interface_name_symb = {0}; \
97 static ewf_interface ewf_interface_rx_uart__interface__##interface_name_symb = {0}; \
98 EWF_PLATFORM_QUEUE_STATIC_DECLARE( \
99  ewf_interface_rx_uart__interface__##interface_name_symb.response_queue_ptr, \
100  ewf_interface_rx_uart__response_queue__##interface_name_symb, \
101  ewf_interface_message, \
102  EWF_INTERFACE_RX_UART_CONFIG_RESPONSE_QUEUE_SIZE); \
103 EWF_PLATFORM_QUEUE_STATIC_DECLARE( \
104  ewf_interface_rx_uart__interface__##interface_name_symb.urc_queue_ptr, \
105  ewf_interface_rx_uart__urc_queue__##interface_name_symb, \
106  ewf_interface_message, \
107  EWF_INTERFACE_RX_UART_CONFIG_URC_QUEUE_SIZE); \
108 ewf_interface_rx_uart__interface__##interface_name_symb.hardware_start = ewf_interface_rx_uart_hardware_start; \
109 ewf_interface_rx_uart__interface__##interface_name_symb.hardware_stop = ewf_interface_rx_uart_hardware_stop; \
110 ewf_interface_rx_uart__interface__##interface_name_symb.hardware_send = ewf_interface_rx_uart_hardware_send; \
111 ewf_interface_rx_uart__interface__##interface_name_symb.hardware_receive = ewf_interface_rx_uart_hardware_receive; \
112 ewf_interface_rx_uart__interface__##interface_name_symb.implementation_ptr = &(ewf_interface_rx_uart__implementation__##interface_name_symb); \
113 interface_ptr = &(ewf_interface_rx_uart__interface__##interface_name_symb); \
114 EWF_INTERFACE_RX_UART_INITIALIZE_HEADER(interface_ptr); \
115 } while(0)
116 
117 /************************************************************************/
121 #ifdef __cplusplus
122 }
123 #endif
124 
125 #endif /* __ewf_interface_rx_uart__h__included__ */
The Embedded Wireless Framework host interface API.
enum _ewf_result ewf_result
Success and error result codes specific to the EWF API.
ewf_result ewf_interface_rx_uart_hardware_receive(ewf_interface *interface_ptr, uint8_t *buffer_ptr, uint32_t *buffer_length_ptr, bool wait)
Receive a buffer using the RX UART hardware interface.
Definition: ewf_interface_rx_uart.c:169
ewf_result ewf_interface_rx_uart_hardware_stop(ewf_interface *interface_ptr)
Stop the RX UART hardware interface.
Definition: ewf_interface_rx_uart.c:114
ewf_result ewf_interface_rx_uart_hardware_send(ewf_interface *interface_ptr, const uint8_t *buffer_ptr, uint32_t buffer_length)
Send a buffer using the RX UART hardware interface.
Definition: ewf_interface_rx_uart.c:129
ewf_result ewf_interface_rx_uart_hardware_start(ewf_interface *interface_ptr)
Start the RX UART hardware interface.
Definition: ewf_interface_rx_uart.c:56
struct _ewf_interface_rx_uart ewf_interface_rx_uart
The RX UART interface implementation data structure type.
The RX UART interface implementation data structure type.
Definition: ewf_interface_rx_uart.h:52
The interface structure definition.
Definition: ewf_interface.h:66