Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (5 points) We are interested in knowing if the joystick's up button in our discovery kit was pressed. This button is connected to pin

image text in transcribed

1. (5 points) We are interested in knowing if the joystick's up button in our discovery kit was pressed. This button is connected to pin 3 of GPIO port A Every time we need to read some input, we will need to use a bitwise operation to check the corresponding bit, inside an if-statement. Complete the code below in order to verify if bit 3 in GPIOA->IDR is equal to 1. In other words, if the statement below is true, the up button was pressed Hint: You only need to write an hexadecimal mask inside the parentheses. Remember, bits and pins start counting froin 0. -) != 0x00 ) ; 2. (5 points) Complete the code below to configure pin 10 of GPIO port B as push-pull Hint: You only need to write an hexadecimal mask inside the parentheses GP108-DTYPER &= -( - 3. (5 points) Write a single line of C code that would enable the clocks of GPIOs port A. B and E. Hint: You should set the correct bits from the correct register

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions