khalid el horri
/
nucleo_F746ZG_TDC502_port_programm_test
programme tdc502
Diff: main.cpp
- Revision:
- 0:893cddb940f0
- Child:
- 1:346b69769c2e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue May 16 09:56:45 2017 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "TDC502.h" +Serial pc(USBTX,USBRX); + +DigitalOut ale(PE_0,1); +TDC502 tdc502(PortD, 0x00FF, //PD_7, PD_6, PD_5, PD_4, PD_3, PD_2, PD_1, PD_0, DataD7 - D0 + PortA, 0x00F0, //PA_7,PA_6,PA_5,PA_4, adresse AD3 à AD0 + + PD_11,PD_12,PD_13, // rdn wrn csn + PE_2, PA_0 ); // INTFLAG TDC_READY +int main() +{ + + pc.baud(115200); + tdc502.TestPerformanceWrite(); + tdc502.TestPerformanceRead(); + tdc502.init(); + tdc502.ReadAllRegister(); + tdc502.StartMesure(); + while(1) + if (tdc502.data_ready()) { + tdc502.ReadData(); + wait(10.0); + tdc502.StartMesure(); + } +} \ No newline at end of file