We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: Istvan K
Last Updated: 2014-04-04
Package Version: 2.0.0.0
Category: Other Codes
Downloaded: 753 times
Followed by: 1 user
License: MIT license
Second part of my new library collection: the common output functions, using func-pointers or a user written char-out routine. In addition, an other library with the mikroC UART1 and LCD char-outs. For all 8-bit PICs.
Do you want to subscribe in order to receive notifications regarding "Common output functions" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Common output functions" changes.
Do you want to report abuse regarding "Common output functions".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1396609182_common_output_fu_mikroc_pic.rar [66.32KB] | mikroC PRO for PIC |
|
This is the second part of my new library collection (the first, already published part includes the "Bargraph" and the "PS2 Keyboard Simulator" libraries).
___________
Common output functions (PIC, mikroC).
There are 12 routines ("..." is the distinctive prefix, see below):
String outputs:
...RstrOut (char* rptr) //write out a string stored in Ram
...RstrNout (char* rptr, char N) // the same but max N char(s)
...CstrOut (const char* cptr) //write out a string stored in Code memory
...CstrNout (const char* cptr, char N) // the same but max N char(s)
Direct conversions (without any temporary buffer):
...BcdOut (char) // "dd", char: max 0x99 (153), with leading zero(es)
...Dec2out (char) // "dd", char: max 99, -"-
...Hex2out (char) // "hh", char: max 255, -"-
...Hex4out (unsigned) // "hhhh", max 65535, -"-
Justified direct conversion (controlled by an additional "just" parameter):
just = -1: (just.B7 = 1) no alignment (with leading zeroes)
just = 0: leading zeroes will be supressed (left justified)
just = 1: leading zeroes will be a space (right justified)
...Dec2out_J (char onebyte, char just) // "dd" (or "d" or " d"), max 99 !!
...Dec3out_J (unsigned wrd, char just) // "ddd", max 999
...Dec4out_J (unsigned wrd, char just) // "dddd", max 9999
...Dec5out_J (unsigned wrd, char just) // "ddddd", max 65535
See the "COMMONFUNCS_DOC.H"
These heavily optimized (using family-specific inline ASM) functions are included in my two new libraries:
"p*_UART1-LCDouts.mcl"
prefixes: "UART1_" and "LCD_" (see the "UART1-LCD-DOC.H")
"p*_Out_Univ.mcl"
prefixes: "Ptr_" and "Usr_" (see the "OUT_UNIV_DOC.H")
For all 8-bit PICs, using different library prefixes: p* = p16, p16e or p18