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
- Committer:
- liangzhen
- Date:
- 2012-08-03
- Revision:
- 1:acf14b6dd1be
- Parent:
- 0:c928c2d8bd02
- Child:
- 2:42e8a4eb3c00
File content as of revision 1:acf14b6dd1be:
#include "power_up.h"
#include "scan.h"
#include "master_i2c.h"
#include "JTAG.h"
using namespace std;
DigitalOut RESET (p21);
Serial s(USBTX, USBRX);
int main() {
//m2s_scan();
s.printf("DDRO_software starts ...\r\n");
s.printf("powerReset() ...\r\n");
//reset
powerReset();
s.printf("powerUp() ...\r\n");
//power up
powerUp();
//s.printf("master_write() ...\r\n");
//master_write();
PLL clk;
s.printf("testPLL() ...\r\n");
RESET = 0;
wait_us(10);
RESET = 1;
/*
for (int i=100;i<201;i+=5)
{
clk.setPLL(i);
double out=(double)5000*(double)i/1024;
s.printf("Setting PLL, output should be %e k\n", out);
wait(5);
}
*/
clk.setPLL(101);
/*
m2s_scan();
//send signal to the other mbed to measure
//take_meansurement(int command)
//read_value();
//receive the value from the other mbed
//listen for power down command from slave
s.printf("master_read() ...\r\n");
master_read();
*/
JTAG jtag;
RESET = 0;
wait_us(10);
RESET = 1;
s.printf("testJTAG() ...\r\n");
jtag.JTAG_test();
s.printf("powerDown() ...\r\n");
//power down
powerDown();
s.printf("DDRO_software ends.\r\n");
}