FLASH_read_char

Description

Read 7 bit packed character from 14 bit instruction word held in code memory

Characters can be packed two to a code memory word if they are limited to 7 bits each. This function extracts a character from a packed array of 7 bit characters held in the code memory.

The address of the start of the array is given by addr and is specified in words. The character within the array is given by indx and is specified in characters.

The address of an array is very simple to obtain and no special computation is required to account for the mixed use of instruction words and characters.

e.g.

	const char data = "hello world"


	for j=0 while j<11 step j+=1 do

		ch = FLASH_read_char(&data, j)
	done

Definition

char FLASH_read_char(uint addr, uint indx)

Library

LIB/flash_lib.bas

Usage

On entry:
addr is the base address of the character array held in the code memory of the PIC indx is the index of the character stored in the array.

see FLASH description for a more detailed description

On exit:
return the 7 bit character at position indx of array addr