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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 7RQ
icon
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*/
    }
}
 
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
ADT and Class
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,