Question: Please do a, b, and c. 3) Write the following functions using CCS C to complete the code framework below. You do not have to

 Please do a, b, and c. 3) Write the following functions

Please do a, b, and c.

3) Write the following functions using CCS C to complete the code framework below. You do not have to compile this code but your code must be typed to be graded. (20 pts) (a) A function setupP2_P3() that selects P3.7-4 for digital IO with those bits set as outputs and selects P2.7-4 for digital IO with those bits set as inputs. The inputs P2.7-4 are connected to external switches and require internal pull-down resistors When the switch is open, a logic 0 is input and when the switch is closed, a logic 1 is input. None of the settings for P2 or P3 should be altered. Default drive strength is fine. (b) A function in2_out3() that reads in from P2.7-4 to determine which switches are open and which are closed. The function then outputs a logic 1 on P3.7-4 if the switch on the correspond port 2 input is closed and a logic 0 if it is open (i.e. P2 pin 4 input corresponds to P3.4 output, P2.5 P3.5, etc.) (c) Write a simple main() that sets up any variables and shows how your functions would be used. What value would result in P3OUT in your in2_out3() function if P21N-0xB4? If P21N-0x8F? Does it matter what the values of P3IN or P2OUT are? Explain

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!