1faa6c1f6SMatthias Ringwald /* 2faa6c1f6SMatthias Ringwald * Copyright (C) 2009-2012 by Matthias Ringwald 3faa6c1f6SMatthias Ringwald * 4faa6c1f6SMatthias Ringwald * Redistribution and use in source and binary forms, with or without 5faa6c1f6SMatthias Ringwald * modification, are permitted provided that the following conditions 6faa6c1f6SMatthias Ringwald * are met: 7faa6c1f6SMatthias Ringwald * 8faa6c1f6SMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 9faa6c1f6SMatthias Ringwald * notice, this list of conditions and the following disclaimer. 10faa6c1f6SMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 11faa6c1f6SMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 12faa6c1f6SMatthias Ringwald * documentation and/or other materials provided with the distribution. 13faa6c1f6SMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 14faa6c1f6SMatthias Ringwald * contributors may be used to endorse or promote products derived 15faa6c1f6SMatthias Ringwald * from this software without specific prior written permission. 16faa6c1f6SMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 17faa6c1f6SMatthias Ringwald * personal benefit and not for any commercial purpose or for 18faa6c1f6SMatthias Ringwald * monetary gain. 19faa6c1f6SMatthias Ringwald * 20faa6c1f6SMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY MATTHIAS RINGWALD AND CONTRIBUTORS 21faa6c1f6SMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22faa6c1f6SMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23faa6c1f6SMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 24faa6c1f6SMatthias Ringwald * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25faa6c1f6SMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26faa6c1f6SMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27faa6c1f6SMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28faa6c1f6SMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29faa6c1f6SMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30faa6c1f6SMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31faa6c1f6SMatthias Ringwald * SUCH DAMAGE. 32faa6c1f6SMatthias Ringwald * 3351acb414SMatthias Ringwald * Please inquire about commercial licensing options at [email protected] 34faa6c1f6SMatthias Ringwald * 35faa6c1f6SMatthias Ringwald */ 36faa6c1f6SMatthias Ringwald 37faa6c1f6SMatthias Ringwald /* 38fb55bd0aSMatthias Ringwald * btstack_chipset_cc256x.c 39faa6c1f6SMatthias Ringwald * 40faa6c1f6SMatthias Ringwald * Adapter to use cc256x-based chipsets with BTstack 41faa6c1f6SMatthias Ringwald */ 42faa6c1f6SMatthias Ringwald 4380e33422SMatthias Ringwald #ifndef BTSTACK_CHIPSET_CC256X_H 4480e33422SMatthias Ringwald #define BTSTACK_CHIPSET_CC256X_H 45faa6c1f6SMatthias Ringwald 46faa6c1f6SMatthias Ringwald #if defined __cplusplus 47faa6c1f6SMatthias Ringwald extern "C" { 48faa6c1f6SMatthias Ringwald #endif 49faa6c1f6SMatthias Ringwald 50faa6c1f6SMatthias Ringwald #include <stdint.h> 51faa6c1f6SMatthias Ringwald #include "btstack_chipset.h" 52faa6c1f6SMatthias Ringwald 53ed5d91baSMatthias Ringwald /** 54ed5d91baSMatthias Ringwald * Configure output power before HCI POWER_ON 55ed5d91baSMatthias Ringwald */ 56faa6c1f6SMatthias Ringwald void btstack_chipset_cc256x_set_power(int16_t power_in_dB); 57ed5d91baSMatthias Ringwald 58ed5d91baSMatthias Ringwald /** 59*63efc2edSMatthias Ringwald * Configure output power for specific modulation before HCI POWER_ON using explicit power vector 60*63efc2edSMatthias Ringwald * @see https://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands#HCI_VS_DRPb_Set_Power_Vector_.280xFD82.29 61*63efc2edSMatthias Ringwald * @note data is not copied, pointer has to stay valid 62*63efc2edSMatthias Ringwald * @note overrides setting from btstack_chipset_cc256x_set_power 63*63efc2edSMatthias Ringwald * @param modulation_type 0=GFSK, 1=EDR2, 2= EDR3 64*63efc2edSMatthias Ringwald * @param power_vector array of 16 uint8_t values as explained on TI wiki 65*63efc2edSMatthias Ringwald */ 66*63efc2edSMatthias Ringwald void btstack_chipset_cc256x_set_power_vector(uint8_t modulation_type, const uint8_t * power_vector); 67*63efc2edSMatthias Ringwald 68*63efc2edSMatthias Ringwald /** 69ed5d91baSMatthias Ringwald * Get chipset instance for CC256x series 70ed5d91baSMatthias Ringwald */ 71faa6c1f6SMatthias Ringwald const btstack_chipset_t * btstack_chipset_cc256x_instance(void); 72faa6c1f6SMatthias Ringwald 73ed5d91baSMatthias Ringwald /** 74ed5d91baSMatthias Ringwald * Get LMP Subversion of compile-time init script 75ed5d91baSMatthias Ringwald */ 76ed5d91baSMatthias Ringwald uint16_t btstack_chipset_cc256x_lmp_subversion(void); 77ed5d91baSMatthias Ringwald 78e2ee49eaSMatthias Ringwald /** 79e2ee49eaSMatthias Ringwald * Set init script to use for next power up 80e2ee49eaSMatthias Ringwald * 81e2ee49eaSMatthias Ringwald * Note: Only needed when switching between different add-ons (BLE, AVRP, ANT+) 82e2ee49eaSMatthias Ringwald * Note: Not supported by MSP430 "init script at 0x10000" workaround 83e2ee49eaSMatthias Ringwald * 84e2ee49eaSMatthias Ringwald * @param init_script_size or 0 for default script 85e2ee49eaSMatthias Ringwald */ 86e2ee49eaSMatthias Ringwald void btstack_chipset_cc256x_set_init_script(uint8_t * data, uint32_t size); 87e2ee49eaSMatthias Ringwald 88faa6c1f6SMatthias Ringwald #if defined __cplusplus 89faa6c1f6SMatthias Ringwald } 90faa6c1f6SMatthias Ringwald #endif 91faa6c1f6SMatthias Ringwald 9280e33422SMatthias Ringwald #endif // BTSTACK_CHIPSET_CC256X_H 93