0
0
Embedded Cprogramming~10 mins

Wake-up sources configuration in Embedded C - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable the wake-up source for the timer.

Embedded C
WAKEUP_EnableSource([1]);
Drag options to blanks, or click blank then click option'
AWAKEUP_SOURCE_GPIO
BWAKEUP_SOURCE_UART
CWAKEUP_SOURCE_TIMER
DWAKEUP_SOURCE_ADC
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a wake-up source unrelated to the timer.
Using a peripheral name instead of a wake-up source constant.
2fill in blank
medium

Complete the code to configure the GPIO pin as a wake-up source.

Embedded C
WAKEUP_ConfigGPIO([1], GPIO_PIN_5);
Drag options to blanks, or click blank then click option'
AGPIO_PORT_B
BGPIO_PORT_C
CGPIO_PORT_A
DGPIO_PORT_D
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting the wrong GPIO port.
Confusing pin numbers with port names.
3fill in blank
hard

Fix the error in the code to correctly disable the UART wake-up source.

Embedded C
WAKEUP_DisableSource([1]);
Drag options to blanks, or click blank then click option'
AWAKEUP_SOURCE_TIMER
BWAKEUP_SOURCE_GPIO
CWAKEUP_SOURCE_ADC
DWAKEUP_SOURCE_UART
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the wrong wake-up source constant.
Confusing enable and disable functions.
4fill in blank
hard

Fill both blanks to configure and enable the ADC as a wake-up source.

Embedded C
WAKEUP_ConfigADC([1]);
WAKEUP_EnableSource([2]);
Drag options to blanks, or click blank then click option'
AADC_CHANNEL_3
BADC_CHANNEL_5
CWAKEUP_SOURCE_ADC
DWAKEUP_SOURCE_TIMER
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing ADC channels with wake-up source constants.
Enabling the wrong wake-up source.
5fill in blank
hard

Fill all three blanks to create a wake-up source dictionary with GPIO and Timer sources.

Embedded C
const WakeupSourceConfig wakeup_sources = {
    [1]: GPIO_PIN_7,
    [2]: TIMER_2,
    [3]: UART_1
};
Drag options to blanks, or click blank then click option'
AWAKEUP_SOURCE_GPIO
BWAKEUP_SOURCE_TIMER
CWAKEUP_SOURCE_UART
DWAKEUP_SOURCE_ADC
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect constants for the dictionary keys.
Mixing up peripheral names and wake-up source constants.