hw functions for the SOLID slow control
Dependents: S_SCTRL_e_test SPItest sscm
Diff: S_SCTRL_SM1_hwfunct.cpp
- Revision:
- 6:24e981a63851
- Parent:
- 3:39671ee1347d
- Parent:
- 5:b527df9432c3
- Child:
- 7:cb139102ec05
diff -r 39671ee1347d -r 24e981a63851 S_SCTRL_SM1_hwfunct.cpp --- a/S_SCTRL_SM1_hwfunct.cpp Mon Sep 15 14:55:03 2014 +0000 +++ b/S_SCTRL_SM1_hwfunct.cpp Mon Sep 15 15:14:42 2014 +0000 @@ -4,7 +4,7 @@ #include "S_SCTRL_SM1_hwfunct.h" -#define HW_LIB_SRC_VERSION "1.00" +#define HW_LIB_SRC_VERSION "1.01" #define MAXLIBVERCHAR 100 // max char for lib version @@ -85,7 +85,37 @@ } -// set tje default , save values +// set the default , save values +void setdefault(HWlines hwl ) { + for ( int i=0;i<2;i++){ + hwl.msio[i]->input(); + *(hwl.direction[i])=LDIR_IN; + *(hwl.stio_mo[i])=RDIR_IN; + } + setcalsource(0,hwl); //intern +} + + +void set_bi_spi_mo(int masterout, DigitalInOut* msio, DigitalOut* ldir, DigitalOut* rdir){ + // default directions + if( masterout == 0 ) { // master in + msio->input(); + rdir->write(RDIR_IN); + ldir->write(LDIR_IN); + + } + else { //master out + + ldir->write(LDIR_OUT); + msio->output(); + rdir->write(RDIR_OUT); + } +} + + + + +// set the default , save values void setdefault(HWlines hwl ) { for ( int i=0;i<2;i++){ hwl.msio[i]->input(); @@ -102,4 +132,6 @@ sprintf(libversion,"hw lib versions src : %s header: %s ,date:%s %s \n\r",HW_LIB_SRC_VERSION,HW_LIB_HDR_VERSION , __DATE__,__TIME__); return libversion; -} \ No newline at end of file +} + +