#include "btstack_config.h"
#include "btstack_chipset_atwilc3000.h"
#include "btstack_debug.h"
#include "conf_board.h"
#include "usart.h"
#include "hal_uart_dma.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include "hci.h"
Macros | |
#define | __BTSTACK_FILE__ "btstack_chipset_atwilc3000.c" |
#define | ATWILC3000_RESET_TIME_MS 250 |
#define | FIRMWARE_CHUNK_SIZE 4096 |
#define | IRAM_START 0x80000000 |
Functions | |
static void | atwilc3000_configure_uart (btstack_timer_source_t *ts) |
static void | atwilc3000_done (void) |
static void | atwilc3000_log_event (void) |
static void | atwilc3000_send_command (const uint8_t *data, uint16_t len) |
static void | atwilc3000_set_baudrate_command (uint32_t baudrate, uint8_t *hci_cmd_buffer) |
static void | atwilc3000_set_bd_addr_command (bd_addr_t addr, uint8_t *hci_cmd_buffer) |
static void | atwilc3000_start (void) |
static void | atwilc3000_update_uart_params (void) |
static void | atwilc3000_vendor_specific_reset (void) |
static void | atwilc3000_w4_baudrate_update (void) |
static void | atwilc3000_w4_command_complete_read_local_version_information (void) |
static void | atwilc3000_w4_command_complete_reset (void) |
static void | atwilc3000_wait_for_reset_completed (void) |
static void | atwilc3000_write_firmware (void) |
static void | atwilc3000_write_memory (void) |
void | btstack_chipset_atwilc3000_download_firmware (const btstack_uart_block_t *uart_driver, uint32_t baudrate, int flowcontrol, const uint8_t *da_fw_data, uint32_t da_fw_size, void(*done)(int result)) |
Download firmware via uart_driver. More... | |
const btstack_chipset_t * | btstack_chipset_atwilc3000_instance (void) |
get chipset instance More... | |
Variables | |
static int | atwilc3000_flowcontrol |
static const btstack_chipset_t | btstack_chipset_atwilc3000 |
static uint8_t | command_buffer [12] |
static void(* | download_complete )(int result) |
static int | download_count |
static uint8_t | event_buffer [15] |
static uint32_t | fw_baudrate |
static const uint8_t * | fw_data |
static int | fw_flowcontrol |
static uint32_t | fw_offset |
static uint32_t | fw_size |
static const uint8_t | hci_read_local_version_information_command [] = { 0x01, 0x01, 0x10, 0x00 } |
static const uint8_t | hci_reset_command [] = { 0x01, 0x03, 0x0c, 0x00 } |
static const uint8_t | hci_vendor_specific_reset_command [] = { 0x01, 0x55, 0xfc, 0x00 } |
static btstack_timer_source_t | reset_timer |
static const btstack_uart_block_t * | the_uart_driver |
#define __BTSTACK_FILE__ "btstack_chipset_atwilc3000.c" |
#define ATWILC3000_RESET_TIME_MS 250 |
Referenced by atwilc3000_wait_for_reset_completed().
#define FIRMWARE_CHUNK_SIZE 4096 |
Referenced by atwilc3000_write_firmware(), and atwilc3000_write_memory().
#define IRAM_START 0x80000000 |
Referenced by atwilc3000_write_memory().
|
static |
References atwilc3000_done(), atwilc3000_flowcontrol, atwilc3000_send_command(), atwilc3000_set_baudrate_command(), command_buffer, event_buffer, fw_baudrate, fw_flowcontrol, HCI_DEFAULT_BAUDRATE, log_info, btstack_uart_block_t::receive_block, btstack_uart_block_t::set_baudrate, btstack_uart_block_t::set_block_received, and btstack_uart_block_t::set_flowcontrol.
Referenced by atwilc3000_wait_for_reset_completed().
|
static |
|
static |
|
static |
|
static |
References atwilc3000_flowcontrol, and little_endian_store_32().
Referenced by atwilc3000_configure_uart(), and atwilc3000_update_uart_params().
|
static |
References reverse_bd_addr().
|
static |
|
static |
References atwilc3000_send_command(), atwilc3000_set_baudrate_command(), atwilc3000_w4_baudrate_update(), command_buffer, event_buffer, fw_baudrate, btstack_uart_block_t::receive_block, and btstack_uart_block_t::set_block_received.
Referenced by atwilc3000_w4_command_complete_read_local_version_information().
|
static |
|
static |
References atwilc3000_log_event(), atwilc3000_write_memory(), fw_baudrate, and btstack_uart_block_t::set_baudrate.
Referenced by atwilc3000_update_uart_params().
|
static |
|
static |
References atwilc3000_log_event(), atwilc3000_send_command(), atwilc3000_w4_command_complete_read_local_version_information(), event_buffer, hci_read_local_version_information_command, btstack_uart_block_t::receive_block, and btstack_uart_block_t::set_block_received.
Referenced by atwilc3000_start().
|
static |
|
static |
References atwilc3000_write_memory(), btstack_min(), bytes_to_write, event_buffer, FIRMWARE_CHUNK_SIZE, fw_data, fw_offset, fw_size, NULL, btstack_uart_block_t::receive_block, btstack_uart_block_t::send_block, btstack_uart_block_t::set_block_received, and btstack_uart_block_t::set_block_sent.
Referenced by atwilc3000_write_memory().
|
static |
References atwilc3000_log_event(), atwilc3000_vendor_specific_reset(), atwilc3000_write_firmware(), btstack_min(), bytes_to_write, command_buffer, FIRMWARE_CHUNK_SIZE, fw_offset, fw_size, HCI_COMMAND_DATA_PACKET, hci_dump_packet(), IRAM_START, little_endian_store_32(), log_info, btstack_uart_block_t::send_block, and btstack_uart_block_t::set_block_sent.
Referenced by atwilc3000_w4_baudrate_update(), atwilc3000_w4_command_complete_read_local_version_information(), and atwilc3000_write_firmware().
void btstack_chipset_atwilc3000_download_firmware | ( | const btstack_uart_block_t * | uart_driver, |
uint32_t | baudrate, | ||
int | flowcontrol, | ||
const uint8_t * | fw, | ||
uint32_t | fw_size, | ||
void(*)(int result) | done | ||
) |
Download firmware via uart_driver.
uart_driver | – already initialized |
baudrate | for firmware update |
flowcontrol | after firmwware update |
done | callback. 0 = Success |
References atwilc3000_start(), download_complete, download_count, fw_baudrate, fw_data, fw_flowcontrol, fw_offset, fw_size, log_error, btstack_uart_block_t::open, and uart_driver.
Referenced by bt_task().
const btstack_chipset_t* btstack_chipset_atwilc3000_instance | ( | void | ) |
|
static |
Referenced by atwilc3000_configure_uart(), atwilc3000_done(), atwilc3000_set_baudrate_command(), and atwilc3000_start().
|
static |
Referenced by btstack_chipset_atwilc3000_instance().
|
static |
Referenced by atwilc3000_configure_uart(), atwilc3000_update_uart_params(), and atwilc3000_write_memory().
|
static |
|
static |
Referenced by btstack_chipset_atwilc3000_download_firmware().
|
static |
|
static |
|
static |
Referenced by atwilc3000_write_firmware(), and btstack_chipset_atwilc3000_download_firmware().
|
static |
Referenced by atwilc3000_configure_uart(), and btstack_chipset_atwilc3000_download_firmware().
|
static |
|
static |
|
static |
Referenced by atwilc3000_w4_command_complete_reset().
|
static |
Referenced by atwilc3000_start().
|
static |
Referenced by atwilc3000_vendor_specific_reset().
|
static |
|
static |