KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wltune.h
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2012-2017 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : wltune.h
11  * Created : 15 sep. 2017
12  * Author : Vincent van Beveren
13  */
14 #ifndef MODULES_WLTUNE_H_
15 #define MODULES_WLTUNE_H_
16 
17 #include "wrx_proto.h"
18 #include "drv/wb/wrx.h"
19 
20 typedef enum {
21  WL_TUNE_STATE_IDLE = 0,
22  WL_TUNE_STATE_BUSY = 1,
23  WL_TUNE_STATE_WAITACK = 2,
24  WL_TUNE_STATE_ERROR = 7,
25 } WlTuneState;
26 
27 extern WrxTuneInfo wlTuneInfo;
28 extern bool wlLastTuneNoAck;
29 extern WlTuneState wlTuneState;
30 
31 
32 /**
33  * Initialize Wavelength tuning.
34  * @return
35  */
36 bool wltune_init();
37 
38 /**
39  * Shows the WL-tune information.
40  */
41 void wltune_show_info();
42 
43 /**
44  * Request update of tuning information.
45  */
46 bool wltune_update_info();
47 
48 /**
49  * Set wavelength tune word.
50  */
51 bool wltune_set_word(int32_t t);
52 
53 /**
54  * Set acknowledgment. Only invoke if you are 100% sure the laser is in band.
55  */
56 bool wltune_ack();
57 
58 /**
59  * Must be called each second.
60  */
61 bool wltune_periodic();
62 
63 #endif /* MODULES_WLTUNE_H_ */
WhiteRabbit exchange exchanges information between the 2nd LM32 and WhiteRabbit though a small client...