Difference between revisions of "UART"
(→UART_TxHexNumber) |
(→UART_TxBinaryNumber) |
||
Line 131: | Line 131: | ||
{{#Widget:LibTable}} | {{#Widget:LibTable}} | ||
|- | |- | ||
− | |Defination || | + | |Defination || '''void UART_TxBinaryNumber(uint32_t num, uint8_t NumOfBits )''' |
|- | |- | ||
− | | Input Arguments || | + | | Input Arguments || '''uint32_t''': Hexadecimal Number to be transmitted on UART. |
+ | '''uint8_t''' : Number of bits to be transmitted | ||
|- | |- | ||
− | | Return Value|| | + | | Return Value|| none |
|- | |- | ||
− | | Description || | + | | Description ||This function is used to transmit the binary equivalent of the given number. 2nd parameter specifies the number of LSB to be transmitted . |
+ | The output for the input combinations is as below . | ||
+ | *(10,4) then 4-LSB will be transmitted ie. 1010 | ||
+ | *(10,8) then 8-LSB will be transmitted ie. 00001010 | ||
+ | *(10,2) then 2-LSB will be transmitted ie. 10 | ||
|- | |- | ||
| Usage || | | Usage || | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
==UART_TxFloatNumber== | ==UART_TxFloatNumber== |
Revision as of 22:54, 20 December 2014
Contents
UART
UART_Init
Defination | void UART_Init(uint32_t Baudrate) |
Input Arguments |
uint32_t : Baudrate to be configured. |
Return Value | none |
Description | This function is used to initialize the UART at specified baud rate.If the requested baud rate is not within the supported range then the default baud rate of 9600 is set. |
Usage |
UART_TxChar
Defination | void UART_TxChar(char ch) |
Input Arguments | Ascii value of the character to be transmitted. |
Return Value | none |
Description | This function is used to transmit a char through UART module. |
Usage |
UART_RxChar
Defination | char UART_RxChar() |
Input Arguments | none. |
Return Value | char: Ascii value of the character received |
Description | This function is used to receive a char from UART module. It waits till a char is received and returns it after reception. |
Usage |
UART_TxString
Defination | void UART_TxString(char *string_ptr) |
Input Arguments | String(Address of the string) to be transmitted. |
Return Value | none |
Description | This function is used to transmit the ASCII string through UART..
|
Usage |
UART_RxString
Defination | void UART_RxString(char *string_ptr) |
Input Arguments | char *string_ptr
Address of the string where the received data needs to be stored |
Return Value | none |
Description |
|
Usage |
UART_TxDecimalNumber
Defination | void UART_TxDecimalNumber(uint32_t num, uint8_t NumOfDigits ) |
Input Arguments | uint32_t: Number to be transmitted on UART.
uint8_t : Number of digits to be transmitted |
Return Value | none |
Description | This function is used to transmit a max of 10digit decimal number.2nd parameter specifies the number of digits from the right side to be transmitted .
The output for the input combinations is as below.
|
Usage |
UART_TxHexNumber
Defination | void UART_TxHexNumber(uint32_t num, uint8_t NumOfDigits ) |
Input Arguments | uint32_t: Hexadecimal Number to be transmitted on UART.
uint8_t : Number of digits to be transmitted |
Return Value | none |
Description | This function is used to transmit a max of 10digit hex number.2nd parameter specifies the number of digits from the right side to be transmitted .
The output for the input combinations is as below .
|
Usage |
UART_TxBinaryNumber
Defination | void UART_TxBinaryNumber(uint32_t num, uint8_t NumOfBits ) |
Input Arguments | uint32_t: Hexadecimal Number to be transmitted on UART.
uint8_t : Number of bits to be transmitted |
Return Value | none |
Description | This function is used to transmit the binary equivalent of the given number. 2nd parameter specifies the number of LSB to be transmitted .
The output for the input combinations is as below .
|
Usage |
UART_TxFloatNumber
Defination | |
Input Arguments | |
Return Value | |
Description | |
Usage |
UART_Printf
Defination | |
Input Arguments | |
Return Value | |
Description | |
Usage |