hw functions for the SOLID slow control

Dependents:   S_SCTRL_e_test SPItest sscm

Committer:
wbeaumont
Date:
Fri Oct 23 11:22:52 2015 +0000
Revision:
16:6bbb6bb0678a
Parent:
14:ee02872b282b
production version archiving

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wbeaumont 1:af78e316f889 1 #ifndef S_SCTRL_SM1_hwfunct_H
wbeaumont 1:af78e316f889 2 #define S_SCTRL_SM1_hwfunct_H
wbeaumont 0:8d755a0f3ab3 3
wbeaumont 8:fe1477cd1c14 4
wbeaumont 14:ee02872b282b 5 #define HW_LIB_HDR_VERSION "1.33"
wbeaumont 2:475caee897ec 6
wbeaumont 8:fe1477cd1c14 7 /* hardware functions
wbeaumont 8:fe1477cd1c14 8 * ver 1.0
wbeaumont 8:fe1477cd1c14 9 * ver 1.1x connectors signal working
wbeaumont 8:fe1477cd1c14 10 * ver 1.20 added serialnr read
wbeaumont 12:467def75b457 11 * ver 1.31 added CAL line lvl function
wbeaumont 13:3d82f8e27414 12 * ver 1.32 added bias2dac voltage and dac2bias
wbeaumont 14:ee02872b282b 13 * ver 1.33 removed bias2dac voltage and dac2bias
wbeaumont 16:6bbb6bb0678a 14 *
wbeaumont 16:6bbb6bb0678a 15 * (C) Wim Beaumont Univeristeit Antwerpen 2014 , 2015
wbeaumont 8:fe1477cd1c14 16 */
wbeaumont 1:af78e316f889 17 typedef struct {
wbeaumont 5:b527df9432c3 18 // BI-SPI
wbeaumont 0:8d755a0f3ab3 19 DigitalInOut* msio[2];
wbeaumont 0:8d755a0f3ab3 20 DigitalOut* sclk[2];
wbeaumont 0:8d755a0f3ab3 21 DigitalOut* direction[2];
wbeaumont 0:8d755a0f3ab3 22 DigitalOut* stio_mo[2];
wbeaumont 2:475caee897ec 23 DigitalOut* csb1[2];
wbeaumont 2:475caee897ec 24 DigitalOut* csb2[2];
wbeaumont 0:8d755a0f3ab3 25
wbeaumont 0:8d755a0f3ab3 26 // SPI pins
wbeaumont 0:8d755a0f3ab3 27 DigitalOut* mosi[2];
wbeaumont 0:8d755a0f3ab3 28 DigitalIn* miso[2];
wbeaumont 0:8d755a0f3ab3 29 DigitalOut* t_cs[2];
wbeaumont 0:8d755a0f3ab3 30 DigitalOut* tc_cs1[2];
wbeaumont 0:8d755a0f3ab3 31 DigitalOut* tc_cs2[2];
wbeaumont 0:8d755a0f3ab3 32 DigitalOut* dac_cs[2];
wbeaumont 0:8d755a0f3ab3 33 DigitalOut* dac_rst[2];
wbeaumont 0:8d755a0f3ab3 34
wbeaumont 0:8d755a0f3ab3 35 //cal
wbeaumont 0:8d755a0f3ab3 36 DigitalOut* cal13[2]; // physical the same so will point to the same port
wbeaumont 0:8d755a0f3ab3 37 DigitalOut* cal24[2]; // physical the same so will point to the same port
wbeaumont 0:8d755a0f3ab3 38 DigitalOut* calint[2];
wbeaumont 0:8d755a0f3ab3 39 // not related to connector 1 /2
wbeaumont 0:8d755a0f3ab3 40 DigitalOut* calext;
wbeaumont 0:8d755a0f3ab3 41 DigitalOut* calgenext;
wbeaumont 0:8d755a0f3ab3 42
wbeaumont 0:8d755a0f3ab3 43 DigitalOut* ledred;
wbeaumont 0:8d755a0f3ab3 44 DigitalOut* ledgreen;
wbeaumont 0:8d755a0f3ab3 45
wbeaumont 8:fe1477cd1c14 46 DigitalIn* snr[5];
wbeaumont 8:fe1477cd1c14 47
wbeaumont 8:fe1477cd1c14 48
wbeaumont 8:fe1477cd1c14 49
wbeaumont 1:af78e316f889 50 AnalogIn* ain[2];
wbeaumont 5:b527df9432c3 51 } HWlines;
wbeaumont 1:af78e316f889 52
wbeaumont 1:af78e316f889 53 void assignports(HWlines *hwlines );
wbeaumont 0:8d755a0f3ab3 54 void setcalsource( int extcal, HWlines hwl);
wbeaumont 5:b527df9432c3 55 void set_bi_spi_mo(int masterout, DigitalInOut* msio, DigitalOut* ldir, DigitalOut* rdir);
wbeaumont 0:8d755a0f3ab3 56 void setdefault(HWlines hwl ) ;
wbeaumont 8:fe1477cd1c14 57 char* hwfunct_lib_version(); // returns this lib version info
wbeaumont 8:fe1477cd1c14 58 int get_serialnr(HWlines *hwlines ); // get the electronic serial nr of the board
wbeaumont 11:0416cf017b7a 59
wbeaumont 11:0416cf017b7a 60 // generate a cal pulse, duration 10us
wbeaumont 11:0416cf017b7a 61 // no connector selection parameter as these signals a common for both connectors
wbeaumont 11:0416cf017b7a 62 // @PARAM HWlines structure of the hardware line
wbeaumont 11:0416cf017b7a 63 // @PARAM calline , 0 fire both ( processor minimum delay , 1 for CAL signal 1& 3, 2 for CAL signal 2&4
wbeaumont 11:0416cf017b7a 64 void toggle_cal(HWlines hwl, int calline);
wbeaumont 12:467def75b457 65 // set the cal line ( to the FED ) active or not active
wbeaumont 12:467def75b457 66 // no connector selection parameter as these signals a common for both connectors
wbeaumont 12:467def75b457 67 // @PARAM HWlines structure of the hardware line
wbeaumont 12:467def75b457 68 // @PARAM calline , 0 fire both ( processor minimum delay , 1 for CAL signal 1& 3, 2 for CAL signal 2&4
wbeaumont 12:467def75b457 69 // @PARAM level if level = 1 CAL signal is set to active else set to deactive
wbeaumont 12:467def75b457 70 void set_cal_line(HWlines hwl, int calline ,int level );
wbeaumont 14:ee02872b282b 71
wbeaumont 1:af78e316f889 72 #endif