Instructions
321 C-Control Pro IDE
© 2013 Conrad Electronic
Please use Serial_ReadExt() if you work in serial IRQ mode. Serial_Read() only supports polled
mode.
Parameter
serport interface number (0 = 1st serial port, 1 = 2nd serial port, ...)
ramaddr address of the buffer
recvlen size of receive buffer
sendlen size of send buffer
par interface parameter (see par table)
divider baud rate initialization (see table)
table par definitions:
Definition
Function
SR_5BIT
5 Bit char length
SR_6BIT
6 Bit char length
SR_7BIT
7 Bit char length
SR_8BIT
8 Bit char length
SR_1STOP
1 stop bit
SR_2STOP
2 stop bit
SR_NO_PAR
no parity
SR_EVEN_PAR
even parity
SR_ODD_PAR
odd parity
5.20.6 Serial_Init_IRQ (AVR32)
Serial Functions Example
Syntax
void Serial_Init_IRQ(byte serport, byte ramaddr[], word recvlen,
word sendlen, byte par, dword baud);
Sub Serial_Init_IRQ(serport As Byte,ByRef ramaddr As Byte,recvlen As Word,
sendlen As Word, par As Byte, baud As ULong)
Description
The serial interface gets initialized for usage in interrupt mode. The user has to provide a global variable
as a serial buffer. This buffer services as a storage for the data that is sent to the serial interface and is re-
ceived from it. The size of the buffer must be length of the send buffer plus the length of the receive buf-
fer plus SR_BUF (see Example).
The maximum value for the size of the send and the receive buffer is 65535 bytes each, but this is of
course limited to the RAM size. The parameter par is defined through successive or-ing of predefined bit
values. The values of character length, stop bits and parity are or'd together. E.g. "SR_7BIT | SR_2STOP |