xref: /btstack/chipset/cinnamon/ll.h (revision 2fca4dad957cd7b88f4657ed51e89c12615dda72)
12c4f9bbbSMatthias Ringwald /*
22c4f9bbbSMatthias Ringwald  * Copyright (C) 2020 BlueKitchen GmbH
32c4f9bbbSMatthias Ringwald  *
42c4f9bbbSMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
52c4f9bbbSMatthias Ringwald  * modification, are permitted provided that the following conditions
62c4f9bbbSMatthias Ringwald  * are met:
72c4f9bbbSMatthias Ringwald  *
82c4f9bbbSMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
92c4f9bbbSMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
102c4f9bbbSMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
112c4f9bbbSMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
122c4f9bbbSMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
132c4f9bbbSMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
142c4f9bbbSMatthias Ringwald  *    contributors may be used to endorse or promote products derived
152c4f9bbbSMatthias Ringwald  *    from this software without specific prior written permission.
162c4f9bbbSMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
172c4f9bbbSMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
182c4f9bbbSMatthias Ringwald  *    monetary gain.
192c4f9bbbSMatthias Ringwald  *
202c4f9bbbSMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
212c4f9bbbSMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
222c4f9bbbSMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23*2fca4dadSMilanka Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
24*2fca4dadSMilanka Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
252c4f9bbbSMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
262c4f9bbbSMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
272c4f9bbbSMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
282c4f9bbbSMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
292c4f9bbbSMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
302c4f9bbbSMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
312c4f9bbbSMatthias Ringwald  * SUCH DAMAGE.
322c4f9bbbSMatthias Ringwald  *
332c4f9bbbSMatthias Ringwald  * Please inquire about commercial licensing options at
342c4f9bbbSMatthias Ringwald  * [email protected]
352c4f9bbbSMatthias Ringwald  *
362c4f9bbbSMatthias Ringwald  */
372c4f9bbbSMatthias Ringwald 
382c4f9bbbSMatthias Ringwald /*
392c4f9bbbSMatthias Ringwald  *  ll.h
402c4f9bbbSMatthias Ringwald  */
412c4f9bbbSMatthias Ringwald 
422c4f9bbbSMatthias Ringwald #ifndef LL_H
432c4f9bbbSMatthias Ringwald #define LL_H
442c4f9bbbSMatthias Ringwald 
452c4f9bbbSMatthias Ringwald #include "btstack_bool.h"
462c4f9bbbSMatthias Ringwald #include <stdint.h>
472c4f9bbbSMatthias Ringwald 
482c4f9bbbSMatthias Ringwald #if defined __cplusplus
492c4f9bbbSMatthias Ringwald extern "C" {
502c4f9bbbSMatthias Ringwald #endif
512c4f9bbbSMatthias Ringwald 
522c4f9bbbSMatthias Ringwald // num tx buffers for use by host stack
532c4f9bbbSMatthias Ringwald #define HCI_NUM_TX_BUFFERS_STACK                    16
542c4f9bbbSMatthias Ringwald 
552c4f9bbbSMatthias Ringwald /* API_START */
562c4f9bbbSMatthias Ringwald 
572c4f9bbbSMatthias Ringwald void ll_init(void);
582c4f9bbbSMatthias Ringwald 
592c4f9bbbSMatthias Ringwald void ll_execute_once(void);
602c4f9bbbSMatthias Ringwald 
612c4f9bbbSMatthias Ringwald void ll_radio_on(void);
622c4f9bbbSMatthias Ringwald 
632c4f9bbbSMatthias Ringwald void ll_set_scan_parameters(uint8_t le_scan_type, uint16_t le_scan_interval, uint16_t le_scan_window,
642c4f9bbbSMatthias Ringwald         uint8_t own_address_type, uint8_t scanning_filter_policy);
652c4f9bbbSMatthias Ringwald 
662c4f9bbbSMatthias Ringwald uint8_t ll_set_scan_enable(uint8_t le_scan_enable, uint8_t filter_duplicates);
672c4f9bbbSMatthias Ringwald 
682c4f9bbbSMatthias Ringwald uint8_t ll_set_advertise_enable(uint8_t le_adv_enable);
692c4f9bbbSMatthias Ringwald 
702c4f9bbbSMatthias Ringwald uint8_t ll_set_advertising_parameters(uint16_t advertising_interval_min, uint16_t advertising_interval_max,
712c4f9bbbSMatthias Ringwald         uint8_t advertising_type, uint8_t own_address_type, uint8_t peer_address_types, uint8_t * peer_address,
722c4f9bbbSMatthias Ringwald         uint8_t advertising_channel_map, uint8_t advertising_filter_policy);
732c4f9bbbSMatthias Ringwald 
742c4f9bbbSMatthias Ringwald uint8_t ll_set_advertising_data(uint8_t adv_len, const uint8_t * adv_data);
752c4f9bbbSMatthias Ringwald 
762c4f9bbbSMatthias Ringwald uint8_t ll_set_scan_response_data(uint8_t adv_len, const uint8_t * adv_data);
772c4f9bbbSMatthias Ringwald 
782c4f9bbbSMatthias Ringwald bool ll_reserve_acl_packet(void);
792c4f9bbbSMatthias Ringwald 
802c4f9bbbSMatthias Ringwald 
812c4f9bbbSMatthias Ringwald void ll_queue_acl_packet(const uint8_t * packet, uint16_t size);
822c4f9bbbSMatthias Ringwald 
832c4f9bbbSMatthias Ringwald void ll_register_packet_handler(void (*packet_handler)(uint8_t packet_type, uint8_t * packet, uint16_t size));
842c4f9bbbSMatthias Ringwald 
852c4f9bbbSMatthias Ringwald /* API_END */
862c4f9bbbSMatthias Ringwald 
872c4f9bbbSMatthias Ringwald #if defined __cplusplus
882c4f9bbbSMatthias Ringwald }
892c4f9bbbSMatthias Ringwald #endif
902c4f9bbbSMatthias Ringwald 
912c4f9bbbSMatthias Ringwald #endif // LL_H
92