xref: /btstack/src/btstack_uart_block.h (revision 95b3bfd1d38b5263b2e349cdda53f1042c538a3c)
1b52fe020SMatthias Ringwald /*
221c1535eSMatthias Ringwald  * Copyright (C) 2016-2021 BlueKitchen GmbH
3b52fe020SMatthias Ringwald  *
4b52fe020SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5b52fe020SMatthias Ringwald  * modification, are permitted provided that the following conditions
6b52fe020SMatthias Ringwald  * are met:
7b52fe020SMatthias Ringwald  *
8b52fe020SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9b52fe020SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10b52fe020SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11b52fe020SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12b52fe020SMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13b52fe020SMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14b52fe020SMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15b52fe020SMatthias Ringwald  *    from this software without specific prior written permission.
16b52fe020SMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
17b52fe020SMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
18b52fe020SMatthias Ringwald  *    monetary gain.
19b52fe020SMatthias Ringwald  *
20b52fe020SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21b52fe020SMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22b52fe020SMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23b52fe020SMatthias Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
24b52fe020SMatthias Ringwald  * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25b52fe020SMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26b52fe020SMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27b52fe020SMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28b52fe020SMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29b52fe020SMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30b52fe020SMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31b52fe020SMatthias Ringwald  * SUCH DAMAGE.
32b52fe020SMatthias Ringwald  *
33b52fe020SMatthias Ringwald  * Please inquire about commercial licensing options at
34b52fe020SMatthias Ringwald  * [email protected]
35b52fe020SMatthias Ringwald  *
36b52fe020SMatthias Ringwald  */
37b52fe020SMatthias Ringwald 
38b52fe020SMatthias Ringwald /*
39b52fe020SMatthias Ringwald  *  btstack_uart_block.h
40b52fe020SMatthias Ringwald  *
4121c1535eSMatthias Ringwald  *  Compatibility layer for ports that use btstack_uart_block_t
42b52fe020SMatthias Ringwald  */
43b52fe020SMatthias Ringwald 
4480e33422SMatthias Ringwald #ifndef BTSTACK_UART_BLOCK_H
4580e33422SMatthias Ringwald #define BTSTACK_UART_BLOCK_H
46b52fe020SMatthias Ringwald 
47b52fe020SMatthias Ringwald #include <stdint.h>
4821c1535eSMatthias Ringwald #include "btstack_uart.h"
49084ad01cSMatthias Ringwald 
5021c1535eSMatthias Ringwald typedef btstack_uart_t btstack_uart_block_t;
51b52fe020SMatthias Ringwald 
52*95b3bfd1SMatthias Ringwald // existing block-only implementations
5321c1535eSMatthias Ringwald const btstack_uart_t * btstack_uart_block_windows_instance(void);
5421c1535eSMatthias Ringwald const btstack_uart_t * btstack_uart_block_embedded_instance(void);
5521c1535eSMatthias Ringwald const btstack_uart_t * btstack_uart_block_freertos_instance(void);
56b52fe020SMatthias Ringwald 
57*95b3bfd1SMatthias Ringwald // mapper for extended implementation
58*95b3bfd1SMatthias Ringwald static inline const btstack_uart_block_t * btstack_uart_block_posix_instance(void){
59*95b3bfd1SMatthias Ringwald     return (const btstack_uart_block_t *) btstack_uart_posix_instance();
60*95b3bfd1SMatthias Ringwald }
61*95b3bfd1SMatthias Ringwald 
62b52fe020SMatthias Ringwald #endif
63