BM module Interface declaration.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
Data Structures | |
struct | sw_timer_t |
Macros | |
#define | INTERFACE_CMD_COMPLETE_TIMEOUT 5000 |
#define | INTERFACE_SW_TIMERS 5 |
#define | INVALID_EVENT_ID 0xFF |
Typedefs | |
typedef void(* | timer_cb_t )(void) |
Enumerations | |
enum | { INTERFACE_EVENT_WAITING, INTERFACE_EVENT_READY } |
Functions | |
void | ble_api_register_uart_interface (uart_write_sync_cb_t uart_tx_cb, uart_read_async_cb_t uart_rx_cb) |
bool | ble_response_check (uint8_t byte) |
event_t * | get_received_cmd_frame (void) |
void | init_fifo (void) |
ble_status_t | interface_cmd_send_no_wait (uint8_t *cmd, uint32_t cmd_len) |
ble_status_t | interface_cmd_send_wait (uint8_t *cmd, uint32_t cmd_len, uint8_t event_id) |
ble_status_t | interface_cmd_send_wait_time (uint8_t *cmd, uint32_t cmd_len, uint8_t event_id, uint16_t timeout) |
event_status_t | interface_event_get (void) |
bool | interface_event_process (void) |
ble_status_t | interface_event_wait (uint8_t event_id) |
ble_status_t | interface_event_wait_time (uint8_t event_id, uint16_t timeout) |
ble_status_t | interface_init (platform_init_t *platform_init) |
bool | is_waiting_for_response (void) |
bool | is_waiting_for_this_response (uint8_t event_id) |
void | store_uart_data (uint16_t rx_data) |
#define INTERFACE_CMD_COMPLETE_TIMEOUT 5000 |
Referenced by interface_cmd_send_wait(), and interface_event_wait().
#define INTERFACE_SW_TIMERS 5 |
Referenced by interface_create_timer(), interface_stop_timer(), and interface_timer_callback().
#define INVALID_EVENT_ID 0xFF |
Referenced by is_waiting_for_response(), and is_waiting_for_this_response().
typedef void(* timer_cb_t)(void) |
void ble_api_register_uart_interface | ( | uart_write_sync_cb_t | uart_tx_cb, |
uart_read_async_cb_t | uart_rx_cb | ||
) |
bool ble_response_check | ( | uint8_t | byte | ) |
References BM_APPLICATION_ResponseCheck().
Referenced by interface_process_fifo_data().
event_t* get_received_cmd_frame | ( | void | ) |
References appEvent.
Referenced by ble_characteristic_value_read_by_uuid_parser(), ble_characteristic_value_read_parser(), ble_command_complete_parser(), ble_gatt_service_create_parser(), ble_gatt_service_read_parser(), ble_rssi_read_parser(), ble_status_report_parser(), dfu_response_read_parser(), dfu_response_report_parser(), dfu_status_handle_parser(), and dfu_status_report_parser().
void init_fifo | ( | void | ) |
References fifo_init(), and rx_fifo_buffer.
Referenced by interface_init().
ble_status_t interface_cmd_send_no_wait | ( | uint8_t * | cmd, |
uint32_t | cmd_len | ||
) |
References BLE_SUCCESS, and ble_platform_api_list_t::uart_tx_cb.
Referenced by ble_create_connection(), ble_disconnect_device(), and ble_primary_service_discover_all().
ble_status_t interface_cmd_send_wait | ( | uint8_t * | cmd, |
uint32_t | cmd_len, | ||
uint8_t | event_id | ||
) |
References BLE_SUCCESS, BLE_UART_TIMEOUT, INTERFACE_CMD_COMPLETE_TIMEOUT, interface_event_process(), interface_start_timer(), interface_stop_timer(), interface_uart_timer_handle, interface_uart_timer_timeout, resp_event_id, and ble_platform_api_list_t::uart_tx_cb.
Referenced by ble_adv_data_set(), ble_adv_param_set(), ble_adv_start(), ble_adv_stop(), ble_cancel_connection(), ble_characteristic_attribute_read_request(), ble_characteristic_attribute_read_response(), ble_characteristic_read(), ble_characteristic_read_by_uuid(), ble_characteristic_reliable_write_request_cancel(), ble_characteristic_reliable_write_request_execute(), ble_characteristic_reliable_write_request_prepare(), ble_characteristic_reliable_write_response_execute(), ble_characteristic_reliable_write_response_prepare(), ble_characteristic_value_read(), ble_characteristic_value_send(), ble_characteristic_value_update(), ble_characteristic_write_with_response(), ble_characteristic_write_without_respose(), ble_error_response_send(), ble_gatt_service_create(), ble_gatt_service_read(), ble_init(), ble_pair_device_delete(), ble_pair_device_erase_all(), ble_pair_mode_get(), ble_pair_mode_set(), ble_pair_passkey_clear(), ble_pair_passkey_confirm(), ble_pair_passkey_enter(), ble_pair_passkey_erase_digits(), ble_pair_passkey_reply(), ble_pair_request(), ble_primary_service_characteristics_discover(), ble_primary_service_characteristics_read(), ble_primary_service_read_all(), ble_read_response_send(), ble_rssi_read(), ble_scan_param_set(), ble_scan_resp_data_set(), ble_scan_start(), ble_set_connection_params(), ble_set_device_name(), ble_shutdown(), ble_transparent_uart_data_send(), ble_transparent_uart_enable(), ble_update_connection_parameters(), ble_write_response_send(), dfu_deinit(), dfu_init(), dfu_program_memory_erase(), dfu_program_memory_read(), dfu_program_memory_write(), and dfu_program_memory_write_continue().
ble_status_t interface_cmd_send_wait_time | ( | uint8_t * | cmd, |
uint32_t | cmd_len, | ||
uint8_t | event_id, | ||
uint16_t | timeout | ||
) |
event_status_t interface_event_get | ( | void | ) |
Referenced by ble_event_get().
bool interface_event_process | ( | void | ) |
References event_msg_t::data_len, event_fifo_write(), event_t::event_id, event_t::event_msg, INTERFACE_EVENT_READY, interface_process_fifo_data(), interface_uart_timer_timeout, is_waiting_for_response(), and is_waiting_for_this_response().
Referenced by interface_cmd_send_wait(), interface_cmd_send_wait_time(), interface_event_wait(), and interface_event_wait_time().
ble_status_t interface_event_wait | ( | uint8_t | event_id | ) |
References BLE_SUCCESS, BLE_UART_TIMEOUT, INTERFACE_CMD_COMPLETE_TIMEOUT, interface_event_process(), interface_start_timer(), interface_stop_timer(), interface_uart_timer_handle, interface_uart_timer_timeout, and resp_event_id.
Referenced by dfu_init(), dfu_program_memory_erase(), dfu_program_memory_read(), dfu_program_memory_write(), and dfu_program_memory_write_continue().
ble_status_t interface_event_wait_time | ( | uint8_t | event_id, |
uint16_t | timeout | ||
) |
References BLE_SUCCESS, BLE_UART_TIMEOUT, interface_event_process(), interface_start_timer(), interface_stop_timer(), interface_uart_timer_handle, interface_uart_timer_timeout, and resp_event_id.
Referenced by ble_init().
ble_status_t interface_init | ( | platform_init_t * | platform_init | ) |
References BLE_FAILURE, BLE_INVALID_COMMAND_PARAMETERS, BLE_SUCCESS, ble_platform_api_list_t::create_timer, ble_platform_api_list_t::delete_timer, event_fifo_init(), platform_init_t::event_mem, event_mem_t::event_mem_pool, event_mem_t::event_mem_pool_size, event_mem_t::event_payload_mem, event_mem_t::event_payload_mem_size, ble_platform_api_list_t::gpio_set, init_fifo(), interface_create_timer(), interface_event_timer_cb(), interface_event_timer_handle, interface_timer_callback(), interface_uart_timer_cb(), interface_uart_timer_handle, mem_init(), ble_platform_api_list_t::mode_set, NULL, platform_init_t::platform_api_list, platform_timer_handle, ble_platform_api_list_t::sleep_timer_ms, ble_platform_api_list_t::start_timer, ble_platform_api_list_t::stop_timer, store_uart_data(), ble_platform_api_list_t::uart_rx_cb, and ble_platform_api_list_t::uart_tx_cb.
Referenced by ble_init(), and dfu_init().
bool is_waiting_for_response | ( | void | ) |
References INVALID_EVENT_ID, and resp_event_id.
Referenced by interface_event_process().
bool is_waiting_for_this_response | ( | uint8_t | event_id | ) |
References INVALID_EVENT_ID, and resp_event_id.
Referenced by interface_event_process().
void store_uart_data | ( | uint16_t | rx_data | ) |
References data, fifo_full(), fifo_put(), is_fifo_full, store_uart_data(), and ble_platform_api_list_t::uart_rx_cb.
Referenced by interface_init(), interface_process_fifo_data(), and store_uart_data().