Question
Implement a function called uart_setup which initialises the TeensyPewPew UART. The hash-tags for this exercise are: #cab202, and #cab202SetupUart. Review the relevant section of the
Implement a function called uart_setup which initialises the TeensyPewPew UART. The hash-tags for this exercise are: #cab202, and #cab202SetupUart.
Review the relevant section of the Topic 10 Technical Notes to prepare for this exercise.
Your task is to implement the function, following the detailed specification laid out in comments in the program skeleton below. The UART must be set up with the following parameters.
Baud rate: 115200 bits per second.
UART mode: Asynchronous double speed.
Character size: 6 bits.
Parity: no parity.
Stop: 2 stop bits
Notes
Use this test driver to implement your function on a Teensy PewPew prior to submission. The test driver does nothing but call the setup code, so you will have to add further functions to actually do something.
#include
#include
#include
#include
#include
#include
#include
#include "lcd_model.h"
// (a) Implement a function called uart_setup which requires no arguments and
// returns no value.
// (a.a) Set the data transmission rate to 115200 bits per second,
// using the formula provided in the Topic 10 Technical Notes.
// (a.b) Set the UART speed to double speed.
// (a.c) Enable receive and transmit, but do not enable any UART-related
// interrupts.
// (a.d) Set the character size to 6 bits, with no parity
// and 2 stop bits.
// (b) End of function uart_setup
int main(void) {
uart_setup();
for ( ;; ) {}
}
Do not use the static qualifier for global variables or functions. This causes them to be made private, and will prevent AMS from marking your submission.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started