Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "gpio.h" 00002 #include "mbed.h" 00003 #include "hardware_adc.h" 00004 #include "hardware_dma_controller.h" 00005 00006 Serial pc(USBTX, USBRX); 00007 00008 00009 int main(void) 00010 { 00011 uint32_t i,j,k; 00012 j = 0; 00013 00014 //For Design Problem 1 - Exercise 10 - START 00015 initADC3_5_withDMA(); 00016 InitPortBPin0asOutput(); //initialize GPIOB as Output 00017 startADCConversion(); 00018 //For Design Problem 1 - Exercise 10 - END 00019 00020 //For Design Problem 2 - Exercise 10 - START 00021 initADC3_567_withDMA(); 00022 InitPortBPin0asOutput(); //initialize GPIOB as Output 00023 startADCConversion(); 00024 //For Design Problem 2 - Exercise 10 - END 00025 00026 while(1) 00027 { 00028 for (i=0; i<10000000; i++) 00029 { 00030 for(k=0; k<10000000; k++) 00031 { 00032 j=j+1; //Tiny Delay 00033 } 00034 } 00035 00036 //Code for DMA - DESIGN PROBLEM 1 - Exercise 10 - START 00037 pc.printf("ADC Value is %u\n", returnADC3StoredValue1Channel(0)); 00038 toggleGPIOB0(); 00039 //Code for DMA - DESIGN PROBLEM 1 - Exercise 10 - END 00040 00041 00042 //Code for DMA - DESIGN PROBLEM 2 - Exercise 10 - START 00043 pc.printf("ADC Value 1 is %u, ADC Value 2 is % u and ADC Value 3 is %u\n", returnADC3StoredValue3Channel(0), returnADC3StoredValue3Channel(1), returnADC3StoredValue3Channel(2)); 00044 toggleGPIOB0(); 00045 //Code for DMA - DESIGN PROBLEM 2 - Exercise 10 - END 00046 } 00047 }
Generated on Mon Jan 16 2023 14:41:56 by
1.7.2