BM program mode definitions.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
Functions | |
void | BM_PROGRAM_Connect (BM_PROGRAM_CMDPKT *programCmdPkt) |
Connect command to connect to BM70 in PROGRAM mode. More... | |
void | BM_PROGRAM_CRC_Get (BM_PROGRAM_CMDPKT *programCmdPkt, BM_PROGRAM_CMD *pgm_cmd) |
Builds a program mode command packet to get CRC of the program memory. More... | |
void | BM_PROGRAM_DeInit (BM_PROGRAM_CMDPKT *programCmdPkt) |
De-initializes PROGRAM mode configuration library. More... | |
void | BM_PROGRAM_Disconnect (BM_PROGRAM_CMDPKT *programCmdPkt) |
Disconnect command to disconnect from BM70 in PROGRAM mode. More... | |
void | BM_PROGRAM_Erase (BM_PROGRAM_CMDPKT *programCmdPkt, BM_PROGRAM_CMD *pgm_cmd) |
Builds a program mode command packet to erase the program memory. More... | |
BM_PROGRAM_CMDPKT * | BM_PROGRAM_Init () |
Initializes program mode. More... | |
void | BM_PROGRAM_Read (BM_PROGRAM_CMDPKT *programCmdPkt, BM_PROGRAM_CMD *pgm_cmd) |
Builds a program mode command packet to read the program memory. More... | |
bool | BM_PROGRAM_ResponseCheck (uint8_t *data, uint8_t len) |
Parses the event packet and provides the handle to the event. More... | |
void | BM_PROGRAM_Write (BM_PROGRAM_CMDPKT *programCmdPkt, BM_PROGRAM_CMD *pgm_cmd) |
Builds a program mode command packet to write the program memory. More... | |
void | BM_PROGRAM_Write_Continue (BM_PROGRAM_CMDPKT *programCmdPkt, BM_PROGRAM_CMD *pgm_cmd) |
Builds a program mode command packet to continue writing the program memory. More... | |
Variables | |
event_t | appEvent |
static BM_PROGRAM_CMDPKT | pgmCmdPkt |
static BM_PROGRAM_CMD_STATE | pgmCmdState = BM_PGM_HCI_EVENT |
static uint8_t | pgmDataCmdPkt [BM_PGM_PKT_LEN_MAX] |
static uint16_t | pgmDataIndex = 0 |
static uint8_t | pgmRspData [BM_PGM_PKT_LEN_MAX] |
void BM_PROGRAM_Connect | ( | BM_PROGRAM_CMDPKT * | programCmdPkt | ) |
Connect command to connect to BM70 in PROGRAM mode.
Builds a program mode command packet t0 connect to program memory to start the program mode.
programCmdPkt | Handle to the PROGRAM mode command packet created by connect function. |
programCmdPkt | Handle to the program mode command packet. |
References PACKED::addr, COMMAND_PKT_TYPE, PACKED::hci_command_pkt, PACKED::length, PACKED::mode, PACKED::offset, PACKED::opcode, PACKED::role, and PACKED::type.
Referenced by dfu_init().
void BM_PROGRAM_CRC_Get | ( | BM_PROGRAM_CMDPKT * | programCmdPkt, |
BM_PROGRAM_CMD * | pgm_cmd | ||
) |
Builds a program mode command packet to get CRC of the program memory.
programCmdPkt | Handle to the program mode command packet. |
pgm_cmd | Handle to the program mode data packet. |
References PACKED::acl_data_pkt, PACKED::address, PACKED::conn_handle, PACKED::crc_algo, DATA_ACL_PKT_TYPE, PACKED::length, PACKED::pgm_cmd_id, PACKED::pgm_data_len, PACKED::pgm_mem_subtype, PACKED::pgm_mem_type, PACKED::size, and PACKED::type.
void BM_PROGRAM_DeInit | ( | BM_PROGRAM_CMDPKT * | programCmdPkt | ) |
De-initializes PROGRAM mode configuration library.
De-initializes program mode.
programCmdPkt | Handle to the PROGRAM mode command packet created by init function. |
programCmdPkt | Handle to the program mode command packet. |
void BM_PROGRAM_Disconnect | ( | BM_PROGRAM_CMDPKT * | programCmdPkt | ) |
Disconnect command to disconnect from BM70 in PROGRAM mode.
Builds a program mode command packet to disconnect from program memory to stop the program mode.
programCmdPkt | Handle to the PROGRAM mode command packet created by connect function. |
programCmdPkt | Handle to the program mode command packet. |
References COMMAND_PKT_TYPE, PACKED::conn_handle, PACKED::hci_command_pkt, PACKED::length, PACKED::opcode, PACKED::reason, and PACKED::type.
Referenced by dfu_deinit().
void BM_PROGRAM_Erase | ( | BM_PROGRAM_CMDPKT * | programCmdPkt, |
BM_PROGRAM_CMD * | pgm_cmd | ||
) |
Builds a program mode command packet to erase the program memory.
programCmdPkt | Handle to the program mode command packet. |
pgm_cmd | Handle to the program mode data packet. |
References PACKED::acl_data_pkt, PACKED::address, PACKED::conn_handle, DATA_ACL_PKT_TYPE, PACKED::length, PACKED::pgm_cmd_id, PACKED::pgm_data_len, PACKED::pgm_mem_subtype, PACKED::pgm_mem_type, PACKED::size, and PACKED::type.
Referenced by dfu_program_memory_erase().
BM_PROGRAM_CMDPKT* BM_PROGRAM_Init | ( | void | ) |
Initializes program mode.
None. |
References BM_PROGRAM_HCI_ERROR, event_msg_t::data, event_msg_t::data_len, event_t::event_id, event_t::event_msg, NULL, pgmCmdPkt, and pgmDataCmdPkt.
Referenced by dfu_init().
void BM_PROGRAM_Read | ( | BM_PROGRAM_CMDPKT * | programCmdPkt, |
BM_PROGRAM_CMD * | pgm_cmd | ||
) |
Builds a program mode command packet to read the program memory.
programCmdPkt | Handle to the program mode command packet. |
pgm_cmd | Handle to the program mode data packet. |
References PACKED::acl_data_pkt, PACKED::address, PACKED::conn_handle, DATA_ACL_PKT_TYPE, PACKED::length, PACKED::pgm_cmd_id, PACKED::pgm_data_len, PACKED::pgm_mem_subtype, PACKED::pgm_mem_type, PACKED::size, and PACKED::type.
Referenced by dfu_program_memory_read().
bool BM_PROGRAM_ResponseCheck | ( | uint8_t * | data, |
uint8_t | len | ||
) |
Parses the event packet and provides the handle to the event.
data | Handle to the data containing the response. |
len | Length of the data containing the response. |
References BM_PGM_HCI_ACL_DATA, BM_PGM_HCI_ACL_DATA_INDEX, BM_PGM_HCI_ACL_HANDLEH, BM_PGM_HCI_ACL_HANDLEH_INDEX, BM_PGM_HCI_ACL_HANDLEL, BM_PGM_HCI_ACL_HANDLEL_INDEX, BM_PGM_HCI_ACL_LENH, BM_PGM_HCI_ACL_LENH_INDEX, BM_PGM_HCI_ACL_LENL, BM_PGM_HCI_ACL_LENL_INDEX, BM_PGM_HCI_ACL_VAL, BM_PGM_HCI_EVENT, BM_PGM_HCI_EVENT_DATA, BM_PGM_HCI_EVENT_DATA_INDEX, BM_PGM_HCI_EVENT_INDEX, BM_PGM_HCI_EVENT_LEN, BM_PGM_HCI_EVENT_LEN_INDEX, BM_PGM_HCI_EVENT_TYPE, BM_PGM_HCI_EVENT_TYPE_INDEX, BM_PGM_HCI_EVENT_VAL, BM_PROGRAM_HCI_ERROR, event_msg_t::data, data, event_msg_t::data_len, event_t::event_id, event_t::event_msg, NULL, pgmCmdState, pgmDataIndex, and pgmRspData.
Referenced by dfu_response_check().
void BM_PROGRAM_Write | ( | BM_PROGRAM_CMDPKT * | programCmdPkt, |
BM_PROGRAM_CMD * | pgm_cmd | ||
) |
Builds a program mode command packet to write the program memory.
programCmdPkt | Handle to the program mode command packet. |
pgm_cmd | Handle to the program mode data packet. |
References PACKED::acl_data_pkt, PACKED::address, PACKED::conn_handle, DATA_ACL_PKT_TYPE, PACKED::length, PACKED::pgm_cmd_id, PACKED::pgm_data_len, PACKED::pgm_mem_subtype, PACKED::pgm_mem_type, PACKED::size, and PACKED::type.
Referenced by dfu_program_memory_write(), and dfu_program_memory_write_continue().
void BM_PROGRAM_Write_Continue | ( | BM_PROGRAM_CMDPKT * | programCmdPkt, |
BM_PROGRAM_CMD * | pgm_cmd | ||
) |
Builds a program mode command packet to continue writing the program memory.
programCmdPkt | Handle to the program mode command packet. |
pgm_cmd | Handle to the program mode data packet. |
References PACKED::acl_data_pkt, PACKED::conn_handle, DATA_ACL_PKT_TYPE, PACKED::length, PACKED::pgm_cmd_id, PACKED::pgm_data_len, and PACKED::type.
Referenced by dfu_program_memory_write_continue().
event_t appEvent |
Referenced by get_received_cmd_frame().
|
static |
Referenced by BM_PROGRAM_Init().
|
static |
Referenced by BM_PROGRAM_ResponseCheck().
|
static |
Referenced by BM_PROGRAM_Init().
|
static |
Referenced by BM_PROGRAM_ResponseCheck().
|
static |
Referenced by BM_PROGRAM_ResponseCheck().