my fork
Embed:
(wiki syntax)
Show/hide line numbers
bluenrg_hal_aci.h
00001 /******************** (C) COPYRIGHT 2014 STMicroelectronics ******************** 00002 * File Name : bluenrg_hal_aci.h 00003 * Author : AMS - AAS 00004 * Version : V1.0.0 00005 * Date : 26-Jun-2014 00006 * Description : Header file with HCI commands for BlueNRG FW6.3. 00007 ******************************************************************************** 00008 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 00012 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 00014 *******************************************************************************/ 00015 00016 #ifndef __BLUENRG_HAL_ACI_H__ 00017 #define __BLUENRG_HAL_ACI_H__ 00018 00019 /** 00020 * @defgroup HAL_Functions HAL functions 00021 * @brief API for BlueNRG HAL layer. 00022 * @{ 00023 */ 00024 00025 /** 00026 * @brief This command writes a value to a low level configure data structure. 00027 * @note It is useful to setup directly some low level parameters for the system at runtime. 00028 * @param offset Offset in the data structure. The starting member in the data structure will have an offset 0.\n 00029 * See @ref Config_vals. 00030 * 00031 * @param len Length of data to be written 00032 * @param[out] val Data to be written 00033 * @return Value indicating success or error code. 00034 */ 00035 tBleStatus aci_hal_write_config_data(uint8_t offset, 00036 uint8_t len, 00037 const uint8_t *val); 00038 00039 /** 00040 * @brief This command sets the TX power level of the BlueNRG. 00041 * @note By controlling the EN_HIGH_POWER and the PA_LEVEL, the combination of the 2 determines 00042 * the output power level (dBm). 00043 * When the system starts up or reboots, the default TX power level will be used, which is 00044 * the maximum value of 8dBm. Once this command is given, the output power will be changed 00045 * instantly, regardless if there is Bluetooth communication going on or not. For example, 00046 * for debugging purpose, the BlueNRG can be set to advertise all the time and use this 00047 * command to observe the signal strength changing. The system will keep the last received 00048 * TX power level from the command, i.e. the 2nd command overwrites the previous TX power 00049 * level. The new TX power level remains until another Set TX Power command, or the system 00050 * reboots.\n 00051 * @param en_high_power Can be only 0 or 1. Set high power bit on or off. It is strongly adviced to use the 00052 * right value, depending on the selected hardware configuration for the RF network: 00053 * normal mode or high power mode. 00054 * @param pa_level Can be from 0 to 7. Set the PA level value. 00055 * @return Value indicating success or error code. 00056 */ 00057 tBleStatus aci_hal_set_tx_power_level(uint8_t en_high_power, uint8_t pa_level); 00058 00059 /** 00060 * @brief Put the device in standby mode. 00061 * @note Normally the BlueNRG will automatically enter sleep mode to save power. This command puts the 00062 * device into the Standby mode instead of the sleep mode. The difference is that, in sleep mode, 00063 * the device can still wake up itself with the internal timer. But in standby mode, this timer is 00064 * disabled. So the only possibility to wake up the device is by external signals, e.g. a HCI command 00065 * sent via SPI bus. 00066 * The command is only accepted when there is no other Bluetooth activity. Otherwise an error code 00067 * ERR_COMMAND_DISALLOWED will be returned. 00068 * 00069 * @return Value indicating success or error code. 00070 */ 00071 tBleStatus aci_hal_device_standby(void); 00072 00073 /** 00074 * @brief This command starts a carrier frequency, i.e. a tone, on a specific channel. 00075 * @note The frequency sine wave at the specific channel may be used for test purpose only. 00076 * The channel ID is a parameter from 0 to 39 for the 40 BLE channels, e.g. 0 for 2.402GHz, 1 for 2.404GHz etc. 00077 * This command shouldn't be used when normal Bluetooth activities are ongoing. 00078 * The tone should be stopped by aci_hal_tone_stop() command. 00079 * 00080 * @param rf_channel BLE Channel ID, from 0 to 39 meaning (2.402 + 2*N) GHz. Actually the tone will be emitted at the 00081 * channel central frequency minus 250 kHz. 00082 * @return Value indicating success or error code. 00083 */ 00084 tBleStatus aci_hal_tone_start(uint8_t rf_channel); 00085 00086 /** 00087 * This command is used to stop the previously started aci_hal_tone_start() command. 00088 * @return Value indicating success or error code. 00089 */ 00090 tBleStatus aci_hal_tone_stop(void); 00091 00092 /** 00093 * @} 00094 */ 00095 00096 /** 00097 * @defgroup Config_vals Offsets and lengths for configuration values. 00098 * @brief Offsets and lengths for configuration values. 00099 * See aci_hal_write_config_data(). 00100 * @{ 00101 */ 00102 00103 /** 00104 * @defgroup Config_offset Offsets for configuration values. 00105 * @brief See @ref aci_hal_write_config_data(). 00106 */ 00107 #define CONFIG_DATA_PUBADDR_OFFSET (0x00) /**< Bluetooth public address */ 00108 #define CONFIG_DATA_DIV_OFFSET (0x06) /**< DIV used to derive CSRK */ 00109 #define CONFIG_DATA_ER_OFFSET (0x08) /**< Encryption root key used to derive LTK and CSRK */ 00110 #define CONFIG_DATA_IR_OFFSET (0x18) /**< Identity root key used to derive LTK and CSRK */ 00111 #define CONFIG_DATA_LL_WITHOUT_HOST (0x2C) /**< Switch on/off Link Layer only mode. Set to 1 to disable Host. 00112 It can be written only if aci_hal_write_config_data() is the first command 00113 after reset. */ 00114 00115 /** 00116 * Select the BlueNRG roles and mode configurations.\n 00117 * @li Mode 1: slave or master, 1 connection, RAM1 only 00118 * @li Mode 2: slave or master, 1 connection, RAM1 only 00119 * @li Mode 3: master, 8 connections, RAM1 and RAM2. 00120 */ 00121 #define CONFIG_DATA_ROLE (0x2D) 00122 /** 00123 * @} 00124 */ 00125 00126 /** 00127 * @defgroup Config_len Length for configuration values. 00128 * @brief See @ref aci_hal_write_config_data(). 00129 */ 00130 #define CONFIG_DATA_PUBADDR_LEN (6) 00131 #define CONFIG_DATA_DIV_LEN (2) 00132 #define CONFIG_DATA_ER_LEN (16) 00133 #define CONFIG_DATA_IR_LEN (16) 00134 #define CONFIG_DATA_LL_WITHOUT_HOST_LEN (1) 00135 #define CONFIG_DATA_ROLE_LEN (1) 00136 /** 00137 * @} 00138 */ 00139 00140 /** 00141 * @} 00142 */ 00143 00144 00145 #endif /* __BLUENRG_HAL_ACI_H__ */ 00146
Generated on Tue Jul 12 2022 17:28:29 by
1.7.2