BlueNRG-MS pack for STM32CubeMX: HAL functions

STM32CubeMX BlueNRG-MS

BlueNRG-MS pack for STM32CubeMX  V4.4.0
The BlueNRG-MS pack is an additional software for STM32CubeMX.

API for BlueNRG HAL layer. More...

Functions

tBleStatus aci_hal_get_fw_build_number (uint16_t *build_number)
 This command retrieves the buid number of the firmware. More...
 
tBleStatus aci_hal_write_config_data (uint8_t offset, uint8_t len, const uint8_t *val)
 This command writes a value to a low level configure data structure. More...
 
tBleStatus aci_hal_read_config_data (uint8_t offset, uint16_t data_len, uint8_t *data_len_out_p, uint8_t *data)
 This command requests the value in the low level configure data structure. The number of read bytes changes for different Offset. More...
 
tBleStatus aci_hal_set_tx_power_level (uint8_t en_high_power, uint8_t pa_level)
 This command sets the TX power level of the BlueNRG. More...
 
tBleStatus aci_hal_le_tx_test_packet_number (uint32_t *number_of_packets)
 This command returns the number of packets sent in Direct Test Mode. More...
 
tBleStatus aci_hal_device_standby (void)
 Put the device in standby mode. More...
 
tBleStatus aci_hal_tone_start (uint8_t rf_channel)
 This command starts a carrier frequency, i.e. a tone, on a specific channel. More...
 
tBleStatus aci_hal_tone_stop (void)
 
tBleStatus aci_hal_get_link_status (uint8_t link_status[8], uint16_t conn_handle[8])
 This command returns the status of all the connections. More...
 
tBleStatus aci_hal_get_anchor_period (uint32_t *anchor_period, uint32_t *max_free_slot)
 This command returns the anchor period and the largest available slot. More...
 

Detailed Description

API for BlueNRG HAL layer.

Function Documentation

◆ aci_hal_device_standby()

tBleStatus aci_hal_device_standby ( void  )

Put the device in standby mode.

Note
Normally the BlueNRG will automatically enter sleep mode to save power. This command puts the device into the Standby mode instead of the sleep mode. The difference is that, in sleep mode, the device can still wake up itself with the internal timer. But in standby mode, this timer is disabled. So the only possibility to wake up the device is by external signals, e.g. a HCI command sent via SPI bus. The command is only accepted when there is no other Bluetooth activity. Otherwise an error code ERR_COMMAND_DISALLOWED will be returned.
Returns
Value indicating success or error code.

◆ aci_hal_get_anchor_period()

tBleStatus aci_hal_get_anchor_period ( uint32_t *  anchor_period,
uint32_t *  max_free_slot 
)

This command returns the anchor period and the largest available slot.

Note
This command returns information about the anchor period to help application in selecting slot timings when operating in multi-link scenarios.
Parameters
anchor_periodCurrent anchor period (multiple of 0.625 ms).
max_free_slotMaximum available time (multiple of 0.625 ms) that can be allocated for a new slot.
Returns
Value indicating success or error code.

◆ aci_hal_get_fw_build_number()

tBleStatus aci_hal_get_fw_build_number ( uint16_t *  build_number)

This command retrieves the buid number of the firmware.

Parameters
[out]build_numberBuild number identifying the firmware release.
Returns
Value indicating success or error code.

◆ aci_hal_get_link_status()

tBleStatus aci_hal_get_link_status ( uint8_t  link_status[8],
uint16_t  conn_handle[8] 
)

This command returns the status of all the connections.

Note
This command returns the status of the 8 Bluetooth low energy links managed by the device.
Parameters
[out]link_statusArray of link status (8 links). See Link_Status.
[out]conn_handleArray of connection handles for each link.
Returns
Value indicating success or error code.

◆ aci_hal_le_tx_test_packet_number()

tBleStatus aci_hal_le_tx_test_packet_number ( uint32_t *  number_of_packets)

This command returns the number of packets sent in Direct Test Mode.

Note
When the Direct TX test is started, a 32-bit counter is used to count how many packets have been transmitted. This command can be used to check how many packets have been sent during the Direct TX test.
The counter starts from 0 and counts upwards. The counter can wrap and start from 0 again. The counter is not cleared until the next Direct TX test starts.
Parameters
[out]number_of_packetsNumber of packets sent during the last Direct TX test.
Returns
Value indicating success or error code.

◆ aci_hal_read_config_data()

tBleStatus aci_hal_read_config_data ( uint8_t  offset,
uint16_t  data_len,
uint8_t *  data_len_out_p,
uint8_t *  data 
)

This command requests the value in the low level configure data structure. The number of read bytes changes for different Offset.

Parameters
offsetOffset in the data structure. The starting member in the data structure will have an offset 0.
See Offsets and lengths for configuration values..
data_lenLength of the data buffer
[out]data_len_out_plength of the data returned by the read.
[out]dataRead data
Returns
Value indicating success or error code.

◆ aci_hal_set_tx_power_level()

tBleStatus aci_hal_set_tx_power_level ( uint8_t  en_high_power,
uint8_t  pa_level 
)

This command sets the TX power level of the BlueNRG.

Note
By controlling the EN_HIGH_POWER and the PA_LEVEL, the combination of the 2 determines the output power level (dBm). When the system starts up or reboots, the default TX power level will be used, which is the maximum value of 8dBm. Once this command is given, the output power will be changed instantly, regardless if there is Bluetooth communication going on or not. For example, for debugging purpose, the BlueNRG can be set to advertise all the time and use this command to observe the signal strength changing. The system will keep the last received TX power level from the command, i.e. the 2nd command overwrites the previous TX power level. The new TX power level remains until another Set TX Power command, or the system reboots.
Parameters
en_high_powerCan be only 0 or 1. Set high power bit on or off. It is strongly adviced to use the right value, depending on the selected hardware configuration for the RF network: normal mode or high power mode.
pa_levelCan be from 0 to 7. Set the PA level value.
Returns
Value indicating success or error code.

◆ aci_hal_tone_start()

tBleStatus aci_hal_tone_start ( uint8_t  rf_channel)

This command starts a carrier frequency, i.e. a tone, on a specific channel.

Note
The frequency sine wave at the specific channel may be used for test purpose only. 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. This command shouldn't be used when normal Bluetooth activities are ongoing. The tone should be stopped by aci_hal_tone_stop() command.
Parameters
rf_channelBLE Channel ID, from 0 to 39 meaning (2.402 + 2*N) GHz. Actually the tone will be emitted at the channel central frequency minus 250 kHz.
Returns
Value indicating success or error code.

◆ aci_hal_tone_stop()

tBleStatus aci_hal_tone_stop ( void  )

This command is used to stop the previously started aci_hal_tone_start() command.

Returns
Value indicating success or error code.

◆ aci_hal_write_config_data()

tBleStatus aci_hal_write_config_data ( uint8_t  offset,
uint8_t  len,
const uint8_t *  val 
)

This command writes a value to a low level configure data structure.

Note
It is useful to setup directly some low level parameters for the system at runtime.
Parameters
offsetOffset in the data structure. The starting member in the data structure will have an offset 0.
See Offsets and lengths for configuration values..
lenLength of data to be written
[out]valData to be written
Returns
Value indicating success or error code.
Generated on Mon Apr 15 2019 18:10:40 for BlueNRG-MS pack for STM32CubeMX by   doxygen 1.8.13