DMCP interface 03.15_021
|
IR printer functions. More...
Functions | |
void | print_byte (uint8_t b) |
Send byte to printer. | |
void | print_buffer (uint8_t *buf, int cnt) |
Send bytes to printer. | |
int | print_is_ready () |
Check whether IR hw is ready for send. | |
uint | printer_get_delay () |
Returns current printer line delay. | |
void | printer_set_delay (uint val) |
Sets printer line delay. | |
void | printer_advance_buf (int what) |
Add line type to printer buffer emulation. | |
int | printer_busy_for (int what) |
Wait until printer buffer is free for given line type. | |
IR printer functions.
At this time supports HP-82240 compatible printers only.
The "printer buffer" here denotes the buffer inside HP-82240 printer.
DMCP supports delay timers, but application has to handle delays according to the printer usage.
Note that IR printer is unidirectional device and all buffer timing is based on estimates. Use printer_set_delay to fine-tune line delay.
Function printer_busy_for (ln_type), where ln_type
is
PRINT_GRA_LN - waits until whole printer buffer is empty
PRINT_TXT_LN - waits until plain text line (25 characters) fits into printer buffer
Function printer_advance_buf (ln_type) updates printer buffer timers
Code example for blocking approach (pr_buf
contains single line with pr_len
bytes of data to print)
void print_buffer | ( | uint8_t * | buf, |
int | cnt ) |
Send bytes to printer.
Bytes are sent directly to IR port.
buf | Bytes to send |
cnt | Number of bytes to send |
void print_byte | ( | uint8_t | b | ) |
Send byte to printer.
Byte is sent directly to IR port.
b | Byte to send |
int print_is_ready | ( | ) |
Check whether IR hw is ready for send.
void printer_advance_buf | ( | int | what | ) |
Add line type to printer buffer emulation.
See Printer Buffer Management for more details.
what | Printer line type |
int printer_busy_for | ( | int | what | ) |
Wait until printer buffer is free for given line type.
See Printer Buffer Management for more details.
what | Printer line type |
uint printer_get_delay | ( | ) |
Returns current printer line delay.
void printer_set_delay | ( | uint | val | ) |
Sets printer line delay.
val | [ms] Printer line delay |