hw functions for the SOLID slow control
Dependents: S_SCTRL_e_test SPItest sscm
S_SCTRL_SM1_hwfunct.h@14:ee02872b282b, 2014-12-07 (annotated)
- Committer:
- wbeaumont
- Date:
- Sun Dec 07 22:38:07 2014 +0000
- Revision:
- 14:ee02872b282b
- Parent:
- 13:3d82f8e27414
- Child:
- 16:6bbb6bb0678a
added Deimos32 class to set bias voltage
Who changed what in which revision?
User | Revision | Line number | New 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 | 8:fe1477cd1c14 | 14 | */ |
wbeaumont | 1:af78e316f889 | 15 | typedef struct { |
wbeaumont | 5:b527df9432c3 | 16 | // BI-SPI |
wbeaumont | 0:8d755a0f3ab3 | 17 | DigitalInOut* msio[2]; |
wbeaumont | 0:8d755a0f3ab3 | 18 | DigitalOut* sclk[2]; |
wbeaumont | 0:8d755a0f3ab3 | 19 | DigitalOut* direction[2]; |
wbeaumont | 0:8d755a0f3ab3 | 20 | DigitalOut* stio_mo[2]; |
wbeaumont | 2:475caee897ec | 21 | DigitalOut* csb1[2]; |
wbeaumont | 2:475caee897ec | 22 | DigitalOut* csb2[2]; |
wbeaumont | 0:8d755a0f3ab3 | 23 | |
wbeaumont | 0:8d755a0f3ab3 | 24 | // SPI pins |
wbeaumont | 0:8d755a0f3ab3 | 25 | DigitalOut* mosi[2]; |
wbeaumont | 0:8d755a0f3ab3 | 26 | DigitalIn* miso[2]; |
wbeaumont | 0:8d755a0f3ab3 | 27 | DigitalOut* t_cs[2]; |
wbeaumont | 0:8d755a0f3ab3 | 28 | DigitalOut* tc_cs1[2]; |
wbeaumont | 0:8d755a0f3ab3 | 29 | DigitalOut* tc_cs2[2]; |
wbeaumont | 0:8d755a0f3ab3 | 30 | DigitalOut* dac_cs[2]; |
wbeaumont | 0:8d755a0f3ab3 | 31 | DigitalOut* dac_rst[2]; |
wbeaumont | 0:8d755a0f3ab3 | 32 | |
wbeaumont | 0:8d755a0f3ab3 | 33 | //cal |
wbeaumont | 0:8d755a0f3ab3 | 34 | DigitalOut* cal13[2]; // physical the same so will point to the same port |
wbeaumont | 0:8d755a0f3ab3 | 35 | DigitalOut* cal24[2]; // physical the same so will point to the same port |
wbeaumont | 0:8d755a0f3ab3 | 36 | DigitalOut* calint[2]; |
wbeaumont | 0:8d755a0f3ab3 | 37 | // not related to connector 1 /2 |
wbeaumont | 0:8d755a0f3ab3 | 38 | DigitalOut* calext; |
wbeaumont | 0:8d755a0f3ab3 | 39 | DigitalOut* calgenext; |
wbeaumont | 0:8d755a0f3ab3 | 40 | |
wbeaumont | 0:8d755a0f3ab3 | 41 | DigitalOut* ledred; |
wbeaumont | 0:8d755a0f3ab3 | 42 | DigitalOut* ledgreen; |
wbeaumont | 0:8d755a0f3ab3 | 43 | |
wbeaumont | 8:fe1477cd1c14 | 44 | DigitalIn* snr[5]; |
wbeaumont | 8:fe1477cd1c14 | 45 | |
wbeaumont | 8:fe1477cd1c14 | 46 | |
wbeaumont | 8:fe1477cd1c14 | 47 | |
wbeaumont | 1:af78e316f889 | 48 | AnalogIn* ain[2]; |
wbeaumont | 5:b527df9432c3 | 49 | } HWlines; |
wbeaumont | 1:af78e316f889 | 50 | |
wbeaumont | 1:af78e316f889 | 51 | void assignports(HWlines *hwlines ); |
wbeaumont | 0:8d755a0f3ab3 | 52 | void setcalsource( int extcal, HWlines hwl); |
wbeaumont | 5:b527df9432c3 | 53 | void set_bi_spi_mo(int masterout, DigitalInOut* msio, DigitalOut* ldir, DigitalOut* rdir); |
wbeaumont | 0:8d755a0f3ab3 | 54 | void setdefault(HWlines hwl ) ; |
wbeaumont | 8:fe1477cd1c14 | 55 | char* hwfunct_lib_version(); // returns this lib version info |
wbeaumont | 8:fe1477cd1c14 | 56 | int get_serialnr(HWlines *hwlines ); // get the electronic serial nr of the board |
wbeaumont | 11:0416cf017b7a | 57 | |
wbeaumont | 11:0416cf017b7a | 58 | // generate a cal pulse, duration 10us |
wbeaumont | 11:0416cf017b7a | 59 | // no connector selection parameter as these signals a common for both connectors |
wbeaumont | 11:0416cf017b7a | 60 | // @PARAM HWlines structure of the hardware line |
wbeaumont | 11:0416cf017b7a | 61 | // @PARAM calline , 0 fire both ( processor minimum delay , 1 for CAL signal 1& 3, 2 for CAL signal 2&4 |
wbeaumont | 11:0416cf017b7a | 62 | void toggle_cal(HWlines hwl, int calline); |
wbeaumont | 12:467def75b457 | 63 | // set the cal line ( to the FED ) active or not active |
wbeaumont | 12:467def75b457 | 64 | // no connector selection parameter as these signals a common for both connectors |
wbeaumont | 12:467def75b457 | 65 | // @PARAM HWlines structure of the hardware line |
wbeaumont | 12:467def75b457 | 66 | // @PARAM calline , 0 fire both ( processor minimum delay , 1 for CAL signal 1& 3, 2 for CAL signal 2&4 |
wbeaumont | 12:467def75b457 | 67 | // @PARAM level if level = 1 CAL signal is set to active else set to deactive |
wbeaumont | 12:467def75b457 | 68 | void set_cal_line(HWlines hwl, int calline ,int level ); |
wbeaumont | 14:ee02872b282b | 69 | |
wbeaumont | 1:af78e316f889 | 70 | #endif |