04.06.2013 Views

Dynamic C function reference

Dynamic C function reference

Dynamic C function reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• int Dxmodem_scbdown( char *buffer, int count )<br />

Sends (downloads) count 128-byte blocks in buffer using the<br />

XMODEM protocol.<br />

RETURN VALUE:<br />

0 timed-out (no transfer).<br />

1 successful transfer.<br />

2 transfer canceled by receiver.<br />

• int Dxmodem_scbup( unsigned long address,<br />

int *pages, int dest, int(*parser)() )<br />

Receives (uploads) a file using the XMODEM protocol.<br />

PARAMETERS:<br />

address is the physical address in RAM where the received data are<br />

to be stored. If the receive buffer is allocated by xdata, then the name<br />

of the array may be used for the address argument. If, however, the<br />

data area is allocated using “normal” C, you must first convert the<br />

logical address of the buffer to a physical address using the library<br />

<strong>function</strong> phy_adr.<br />

pages is the number of 4K blocks of data that have been transferred.<br />

dest If 0, the upload is intended for the master in an RS-485 masterslave<br />

network. If dest is nonzero, the upload is intended for the<br />

designated slave (1–255).<br />

parser is the <strong>function</strong> that handles parsing of the uploaded data.<br />

RETURN VALUE:<br />

0 timed-out (no transfer).<br />

1 successful transfer.<br />

2 transfer canceled by sender side.<br />

SERIAL.LIB<br />

These are serial driver <strong>function</strong>s.<br />

• void ser_init_z1( char mode, char baud )<br />

Initializes the driver for Z180 serial port 1. To use this driver, you must<br />

use z1_ser_int as the interrupt handler for Z180 port 1. This<br />

<strong>function</strong> uses circular receive and transmit buffers, which are allocated by<br />

the programmer. This <strong>function</strong> tells the software what the setup is.<br />

PARAMETERS:<br />

mode selects the operation mode as follows.<br />

bit 0 0 = 1 stop bit<br />

1 = 2 stop bits<br />

bit 1 0 = no parity<br />

1 = with parity<br />

72 s Other Communication Drivers<br />

<strong>Dynamic</strong> C 32 v. 6.x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!