User manual

Table Of Contents
592
mikoC PRO for PIC32
MikroElektronika
UARTx_Init_Advanced
Prototype
void UARTx_Init_Advanced(unsigned long baud_rate, unsigned long freq_Khz,
unsigned short high_low, unsigned short parity, unsigned short stop_bits);
Description Congures and initializes the UART module with user dened settings.
Parameters - baud_rate: requested baud rate
- freq_Khz: Peripheral Bus Clock frequency in kHz.
- high_low_speed: High/low speed selection parameter. Valid values:
- parity: Parity and data selection parameter. Valid values:
- stop_bits: stop bit selection parameter. Valid values:
Data/Parity Mode
Description Predened library const
8-bit data, no parity _UART_8BIT_NOPARITY
8-bit data, even parity _UART_8BIT_EVENPARITY
8-bit data, odd parity _UART_8BIT_ODDPARITY
9-bit data, no parity _UART_9BIT_NOPARITY
Stop bits
Description Predened library const
One stop bit _UART_ONE_STOPBIT
Two stop bit _UART_TWO_STOPBITS
High/Low Speed
Description Predened library const
Low Speed UART _UART_LOW_SPEED
Hi Speed UART _UART_HI_SPEED
Returns Nothing.
Requires Routine requires the UART module.
Example
Notes Refer to the device data sheet for baud rates allowed for specic Fosc.
UART library routines require you to specify the module you want to use. To select the desired UART
module, simply change the letter x in the routine prototype for a number from 1 to 6.
Switching between the UART modules in the UART library is done by the UART_Set_Active function
(UART modules have to be previously initialized).
Number of UART modules per MCU differs from chip to chip. Please, read the appropriate datasheet
before utilizing this library.