Download HAL User Manual - Construction Van de Walle
Transcript
HAL Manual V2.5, 2011-05-15 40 / 57 If present, the prefix hal_ is removed from the beginning of the component name when creating pins, parameters and functions. In the HAL identifier for a pin or parameter, # denotes an array item, and must be used in conjunction with a [SIZE] declaration. The hash marks are replaced with a 0-padded number with the same length as the number of # characters. When used to create a C identifier, the following changes are applied to the HALNAME: 1. Any "#" characters, and any ".", "_" or "-" characters immediately before them, are removed. 2. Any remaining "." and "-" characters are replaced with "_". 3. Repeated "_" characters are changed to a single "_" character. A trailing _ is retained, so that HAL identifiers which would otherwise collide with reserved names or keywords (e.g., min) can be used. HALNAME x_y_z x-y.z x_y_z_ x.##.y x.## C Identifier x_y_z x_y_z x_y_z_ x_y(MM) x(MM) HAL Identifier x-y-z x-y.z x-y-z x.MM.z x.MM if CONDITION An expression involving the variable personality which is nonzero when the pin or parameter should be created SIZE A number that gives the size of an array. The array items are numbered from 0 to SIZE-1. MAXSIZE : CONDSIZE A number that gives the maximum size of the array followed by an expression involving the variable personality and which always evaluates to less than MAXSIZE. When the array is created its size will be CONDSIZE. DOC A string that documents the item. String can be a C-style "double quoted" string, like: "Selects the desired edge: TRUE means falling, FALSE means rising" or a Python-style "triple quoted" string, which may include embedded newlines and quote characters, such as: param rw bit zot=TRUE """The effect of this parameter, also known as "the orb of zot", will require at least two paragraphs to explain. Hopefully these paragraphs have allowed you to understand "zot" better."""; The documentation string is in "groff -man" format. For more information on this markup format, see groff_man(7). Remember that comp interprets backslash escapes in strings, so for instance to set the italic font for the word example, write: "\\fIexample\\fB". TYPE One of the HAL types: bit, signed, unsigned, or float. The old names s32 and u32 may also be used, but signed and unsigned are preferred. PINDIRECTION One of the following: in, out, or io. A component sets a value for an out pin, it reads a value from an in pin, and it may read or set the value of an io pin. PARAMDIRECTION One of the following: r or rw. A component sets a value for a r parameter, and it may read or set the value of a rw parameter.