采用 Curiosity Nano 的低功耗模式.pdf
(6.09 MB)
#include "mcc_generated_files/mcc.h"
#include <avr/sleep.h>
void GPIO_Interrupt(void);
uint16_t volatile result;
int main(void)
{
SYSTEM_Initialize();
ADC0.MUXPOS = ADC_MUXPOS_TEMPSENSE_gc;
PORTC_PC2_SetInterruptHandler(GPIO_Interrupt);
while (1){
sleep_cpu();
}
}
void GPIO_Interrupt(void)
{
result = ADC0_GetConversionResult();
}
该文档一步一步教你如何在MCC里配置并实现低功耗模式运行。
|