Embedded Wireless Framework
ewf_interface_microchip_sam_uart.h
Go to the documentation of this file.
1 /************************************************************************/
11 #ifndef __ewf_interface_microchip_sam_uart__h__included__
12 #define __ewf_interface_microchip_sam_uart__h__included__
13 
14 #include "ewf_interface.h"
15 
16 #include <stdio.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 
23 /************************************************************************/
35 #ifndef EWF_INTERFACE_MICROCHIP_SAM_UART_CONFIG_RESPONSE_QUEUE_SIZE
36 #define EWF_INTERFACE_MICROCHIP_SAM_UART_CONFIG_RESPONSE_QUEUE_SIZE (8)
37 #endif
38 
39 #ifndef EWF_INTERFACE_MICROCHIP_SAM_UART_CONFIG_URC_QUEUE_SIZE
40 #define EWF_INTERFACE_MICROCHIP_SAM_UART_CONFIG_URC_QUEUE_SIZE (8)
41 #endif
42 
47 {
48  uint8_t rx_buffer[sizeof(uint8_t)];
50 
51 
56 
61 
65 ewf_result ewf_interface_microchip_sam_hardware_send(ewf_interface* interface_ptr, const uint8_t* buffer_ptr, uint32_t buffer_length);
66 
70 ewf_result ewf_interface_microchip_sam_hardware_receive(ewf_interface* interface_ptr, uint8_t* buffer_ptr, uint32_t* buffer_length_ptr, bool wait);
71 
72 
73 #ifdef EWF_PARAMETER_CHECKING
74 #define EWF_INTERFACE_MICROCHIP_SAM_UART_INITIALIZE_HEADER(global_interface_ptr) \
75 do { \
76 (global_interface_ptr)->struct_magic = EWF_INTERFACE_STRUCT_MAGIC; \
77 (global_interface_ptr)->struct_size = EWF_INTERFACE_STRUCT_SIZE; \
78 (global_interface_ptr)->struct_version = EWF_INTERFACE_VERSION; \
79 (global_interface_ptr)->struct_type = EWF_INTERFACE_TYPE_MICROCHIP_SAM_UART; \
80 } while(0)
81 #else
82 #define EWF_INTERFACE_MICROCHIP_SAM_UART_INITIALIZE_HEADER(interface_ptr)
83 #endif /* EWF_PARXMETER_CHECKING */
84 
90 #define EWF_INTERFACE_MICROCHIP_SAM_UART_STATIC_DECLARE(interface_ptr, interface_name_symb) \
91 do { \
92 static ewf_interface_microchip_sam_uart ewf_interface_microchip_sam_uart__implementation__##interface_name_symb = {0}; \
93 static ewf_interface ewf_interface_microchip_sam_uart__interface__##interface_name_symb = {0}; \
94 EWF_PLATFORM_QUEUE_STATIC_DECLARE( \
95  ewf_interface_microchip_sam_uart__interface__##interface_name_symb.response_queue_ptr, \
96  ewf_interface_microchip_sam_uart__response_queue__##interface_name_symb, \
97  ewf_interface_message, \
98  EWF_INTERFACE_MICROCHIP_SAM_UART_CONFIG_RESPONSE_QUEUE_SIZE); \
99 EWF_PLATFORM_QUEUE_STATIC_DECLARE( \
100  ewf_interface_microchip_sam_uart__interface__##interface_name_symb.urc_queue_ptr, \
101  ewf_interface_microchip_sam_uart__urc_queue__##interface_name_symb, \
102  ewf_interface_message, \
103  EWF_INTERFACE_MICROCHIP_SAM_UART_CONFIG_URC_QUEUE_SIZE); \
104 ewf_interface_microchip_sam_uart__interface__##interface_name_symb.hardware_start = ewf_interface_microchip_sam_uart_hardware_start; \
105 ewf_interface_microchip_sam_uart__interface__##interface_name_symb.hardware_stop = ewf_interface_microchip_sam_uart_hardware_stop; \
106 ewf_interface_microchip_sam_uart__interface__##interface_name_symb.hardware_send = ewf_interface_microchip_sam_uart_hardware_send; \
107 ewf_interface_microchip_sam_uart__interface__##interface_name_symb.hardware_receive = ewf_interface_microchip_sam_uart_hardware_receive; \
108 ewf_interface_microchip_sam_uart__interface__##interface_name_symb.implementation_ptr = &(ewf_interface_microchip_sam_uart__implementation__##interface_name_symb); \
109 interface_ptr = &(ewf_interface_microchip_sam_uart__interface__##interface_name_symb); \
110 EWF_INTERFACE_MICROCHIP_SAM_UART_INITIALIZE_HEADER(interface_ptr); \
111 } while(0)
112 
113 /************************************************************************/
117 #ifdef __cplusplus
118 }
119 #endif
120 
121 #endif /* __ewf_interface_microchip_sam_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_microchip_sam_hardware_send(ewf_interface *interface_ptr, const uint8_t *buffer_ptr, uint32_t buffer_length)
Send a buffer using the RX UART hardware interface.
ewf_result ewf_interface_microchip_sam_uart_hardware_start(ewf_interface *interface_ptr)
Start the SAM UART hardware interface.
Definition: ewf_interface_microchip_sam_uart.c:24
ewf_result ewf_interface_microchip_sam_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.
struct _ewf_interface_microchip_sam_uart ewf_interface_microchip_sam_uart
the SAM UART interface implementation data structure type
ewf_result ewf_interface_microchip_sam_uart_hardware_stop(ewf_interface *interface_ptr)
Stop the SAM UART hardware interface.
Definition: ewf_interface_microchip_sam_uart.c:36
the SAM UART interface implementation data structure type
Definition: ewf_interface_microchip_sam_uart.h:47
The interface structure definition.
Definition: ewf_interface.h:66