Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

intelhex.h File Reference

intelhex.h File Reference

Parser for the intel hex format. More...

Go to the source code of this file.

enum  hexfile_parse_status_t {
  HEX_PARSE_OK = 0, HEX_PARSE_EOF, HEX_PARSE_UNALIGNED, HEX_PARSE_LINE_OVERRUN,
  HEX_PARSE_CKSUM_FAIL, HEX_PARSE_UNINIT, HEX_PARSE_FAILURE
}
 

Type of states that the parser can return.

More...
void reset_hex_parser (void)
 Prepare any state that is maintained for the start of a file.
hexfile_parse_status_t parse_hex_blob (const uint8_t *hex_blob, const uint32_t hex_blob_size, uint32_t *hex_parse_cnt, uint8_t *bin_buf, const uint32_t bin_buf_size, uint32_t *bin_buf_address, uint32_t *bin_buf_cnt)
 Convert a blob of hex data into its binary equivelant.

Detailed Description

Parser for the intel hex format.

DAPLink Interface Firmware Copyright (c) 2009-2016, ARM Limited, All Rights Reserved SPDX-License-Identifier: Apache-2.0

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file intelhex.h.


Enumeration Type Documentation

Type of states that the parser can return.

Enumerator:
HEX_PARSE_OK 

The input buffer was complete parsed and converted into the output buffer

HEX_PARSE_EOF 

EOF line found in the hex file

HEX_PARSE_UNALIGNED 

The address of decoded data isnt consecutive. Need to program what was returned and continue to parse the input buffer

HEX_PARSE_LINE_OVERRUN 

Error state when the record length is longer than the record structure

HEX_PARSE_CKSUM_FAIL 

Error state when the record checksum doesnt properly compute

HEX_PARSE_UNINIT 

Default state. Return of this type is unrecoverable logic error

HEX_PARSE_FAILURE 

Amount of hex data to decode didnt match the parsing logics count of decoded bytes

Definition at line 38 of file intelhex.h.


Function Documentation

hexfile_parse_status_t parse_hex_blob ( const uint8_t *  hex_blob,
const uint32_t  hex_blob_size,
uint32_t *  hex_parse_cnt,
uint8_t *  bin_buf,
const uint32_t  bin_buf_size,
uint32_t *  bin_buf_address,
uint32_t *  bin_buf_cnt 
)

Convert a blob of hex data into its binary equivelant.

Parameters:
hex_blobA block of ascii encoded hexfile data
hex_blob_sizeThe amount of valid data in the hex_blob
hex_parse_cntThe amount of hex_blob data from the call that was parsed
bin_bufBuffer the decoded hex file contents goes into
bin_buf_sizemax size of the buffer
bin_buf_addressThe start address for data in the bin_buf as decoded from the hex file
bin_buf_cntThe amount of data in the bin_buf
Returns:
A member of hex_parse_status_t that describes the state of decoding

Definition at line 97 of file intelhex.c.

void reset_hex_parser ( void   )

Prepare any state that is maintained for the start of a file.

Parameters:
none
Returns:
none

Definition at line 86 of file intelhex.c.