Purpose: | Transmit a series of BYTEs out the COM1 console serial port. | ||||
Assumes: | Since these system calls can "block", interrupts will be enabled if they are disabled when called. | ||||
Passed: | R25:R24 | CHAR * | szPtrBuffer | address of the EEPROM or SRAM or 328P FLASH buffer to output OR | |
R26:R25:R24 | CHAR * | szPtrBuffer | address of the 1284P or 2560 FLASH buffer to output | R22 | BYTE | bPrintCount | number of BYTEs to be enbuffered, from 1 to 255 (zero is a special case; see the note below) |
Returns: | R25:R24 | CHAR * | szPtrBuffer | the same address passed, unchanged | |
R22 | BYTE | bPrintCount | the number of BYTEs that were enbuffered to be output | ||
Alters: | R20 and the FLAGs, in addition to R22, R24, and R25 returned |
Example: |
|
|||
Test it: |
| |||
Notes: | These routines are simply placing characters into the COM1 (or terminal) transmit buffer, a FIFO queue. They will only block if there is not room in the queue to enbuffer all of the characters. Any delay is due to waiting until enough characters are transmitted (i.e., removed from the queue) to make room for all of the new ones. These routines return as soon as all characters are enbuffered, leaving the actual output to be handled by the interrupt-driven print spooler. | |||
If zero BYTEs are specified in R22, these routines become like the corresponding Print####ASCIIz routine, which calculate the string length (which could be zero.) | ||||
BYTEs with values of 0 through 6 or 0xFF are skipped. | ||||
The term "block" means that the subroutine does not return until its function is complete. | ||||
These routines internally call the COM1_Write System Function after determining the string length with the appropriate strlen function and specifying the string source. | ||||
The function name PrintPGMString is the same as PrintFLASHString. | ||||
The function name PrintRAMString is the same as PrintSRAMString. | ||||
Dropin: (setup code) |
; Setup for the Print####String() call: ; Passed: R25:R24 CHAR * szPtrBuffer 2-BYTE pointer to the string to print ; R22 BYTE bPrintCount number of BYTEs to be enbuffered ; Returns: R25:R24 CHAR * szPtrBuffer pointer to the string, unmodified ; R22 BYTE bPrintCount number of BYTEs placed in the print queue ; Alters: R20 and the FLAGs ; Setup for the 1284P or 2560 PrintFLASHString() call: ; Passed: R26:R25:R24 CHAR * szPtrBuffer 3-BYTE pointer to the string to print ; R22 BYTE bPrintCount number of BYTEs to be enbuffered ; Returns: R25:R24 CHAR * szPtrBuffer pointer to the string, unmodified ; R22 BYTE bPrintCount number of BYTEs placed in the print queue ; Alters: R20 and the FLAGs |
|||
Also see: | The strlen, strlenEEPROM, and strlenPGM family, as well as the Print####ASCIIz family and the COM1 receive status, transmit status, read, write, and wait family of System Functions. |