write in C for a STM32F446RE microcontroller Write a source library that contains the with the following public functions: void keypadInit(void); /Initiallized the GPIO to read the keypad. uint16_t readKeypad(void); //Returns the state of all of the keypad buttons in the return value at the moment the function is called. void decodeKeypad(uint16_t, char *); //Takes the state of the keypad and returns (by reference) an array of the key's pressed. The library should work with the following main: int main (void) { uint16_t key; char carray[17]; keypadInit(); while(1) { while(!(key = readKeypad())); /*Get which keys pressed*/ decodeKeypad(key, carray); /*What are those keys*/ printf("%s\n",carray); /*Print those keys to screen*/ while(readKeypad() == key); /*Wait for the keypad to change*/ } } Problem 1: Write a library that works with the following pin assignments Row 0 -> PC0 Row 1 -> PC2 Row 2-> PC4 Row 3 -> PC6 Col 0-> PC8 Col 1->PC10 Col 2->PC12 Problem 2: Write a library that works with the following pin assignments Row 0 -> PC1 Row 1 -> PC3 Row2-> PC5 Row 3 -> PC7 Col 0-> PC9 Col 1->PC11 Col 2->PC13
write in C for a STM32F446RE microcontroller Write a source library that contains the with the following public functions: void keypadInit(void); /Initiallized the GPIO to read the keypad. uint16_t readKeypad(void); //Returns the state of all of the keypad buttons in the return value at the moment the function is called. void decodeKeypad(uint16_t, char *); //Takes the state of the keypad and returns (by reference) an array of the key's pressed. The library should work with the following main: int main (void) { uint16_t key; char carray[17]; keypadInit(); while(1) { while(!(key = readKeypad())); /*Get which keys pressed*/ decodeKeypad(key, carray); /*What are those keys*/ printf("%s\n",carray); /*Print those keys to screen*/ while(readKeypad() == key); /*Wait for the keypad to change*/ } } Problem 1: Write a library that works with the following pin assignments Row 0 -> PC0 Row 1 -> PC2 Row 2-> PC4 Row 3 -> PC6 Col 0-> PC8 Col 1->PC10 Col 2->PC12 Problem 2: Write a library that works with the following pin assignments Row 0 -> PC1 Row 1 -> PC3 Row2-> PC5 Row 3 -> PC7 Col 0-> PC9 Col 1->PC11 Col 2->PC13
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
write in C for a STM32F446RE microcontroller
Write a source library that contains the with the following public functions:
void keypadInit(void); /Initiallized the GPIO to read the keypad.
uint16_t readKeypad(void); //Returns the state of all of the keypad buttons in the return value at the moment the function is called.
void decodeKeypad(uint16_t, char *); //Takes the state of the keypad and returns (by reference) an array of the key's pressed.
The library should work with the following main:
int main (void)
{
uint16_t key;
char carray[17];
keypadInit();
while(1)
{
while(!(key = readKeypad())); /*Get which keys pressed*/
decodeKeypad(key, carray); /*What are those keys*/
printf("%s\n",carray); /*Print those keys to screen*/
while(readKeypad() == key); /*Wait for the keypad to change*/
}
}
{
uint16_t key;
char carray[17];
keypadInit();
while(1)
{
while(!(key = readKeypad())); /*Get which keys pressed*/
decodeKeypad(key, carray); /*What are those keys*/
printf("%s\n",carray); /*Print those keys to screen*/
while(readKeypad() == key); /*Wait for the keypad to change*/
}
}
Problem 1: Write a library that works with the following pin assignments
Row 0 -> PC0
Row 1 -> PC2
Row 2-> PC4
Row 3 -> PC6
Col 0-> PC8
Col 1->PC10
Col 2->PC12
Problem 2: Write a library that works with the following pin assignments
Row 0 -> PC1
Row 1 -> PC3
Row2-> PC5
Row 3 -> PC7
Col 0-> PC9
Col 1->PC11
Col 2->PC13
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education