AVRly - AVR Development Resources
|
Driver file providing core USART communication between the target MCU and your PC. More...
Go to the source code of this file.
Functions | |
void | init_usart (void) |
Takes the defined BAUD and F_CPU, calculates the bit-clock multiplier, configures the hardware USART ready for use. More... | |
void | print_string (const char myString[]) |
Utility function to transmit an entire string from RAM. More... | |
void | read_string (char myString[], uint8_t maxLength) |
Define a string variable, pass it to this function. More... | |
void | print_byte (uint8_t byte) |
Prints a byte out as its 3-digit ascii equivalent. More... | |
void | print_word (uint16_t word) |
Prints a word (16-bits) out as its 5-digit ascii equivalent. More... | |
void | print_binary_byte (uint8_t byte) |
Prints a byte out in 1s and 0s. More... | |
char | nibble_to_hex_character (uint8_t nibble) |
Convert nibble to hex character. More... | |
void | print_hex_byte (uint8_t byte) |
Prints a byte out in hexadecimal. More... | |
uint8_t | get_number (void) |
Takes in up to three ascii digits, converts them to a byte when press enter. More... | |
Driver file providing core USART communication between the target MCU and your PC.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file usart.c.
void init_usart | ( | void | ) |
Takes the defined BAUD and F_CPU, calculates the bit-clock multiplier, configures the hardware USART ready for use.
Takes the defined BAUD and F_CPU, calculates the bit-clock multiplier, configures the hardware USART.
Definition at line 48 of file usart.c.
void print_string | ( | const char | myString[] | ) |
void read_string | ( | char | myString[], |
uint8_t | maxLength | ||
) |
Define a string variable, pass it to this function.
The string will contain whatever you typed over serial.
Definition at line 81 of file usart.c.
void print_byte | ( | uint8_t | byte | ) |
Prints a byte out as its 3-digit ascii equivalent.
Definition at line 106 of file usart.c.
void print_word | ( | uint16_t | word | ) |
Prints a word (16-bits) out as its 5-digit ascii equivalent.
Definition at line 115 of file usart.c.
void print_binary_byte | ( | uint8_t | byte | ) |
char nibble_to_hex_character | ( | uint8_t | nibble | ) |
void print_hex_byte | ( | uint8_t | byte | ) |
Prints a byte out in hexadecimal.
Definition at line 155 of file usart.c.
uint8_t get_number | ( | void | ) |
Takes in up to three ascii digits, converts them to a byte when press enter.
Definition at line 165 of file usart.c.