KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
acou.h
Go to the documentation of this file.
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2013-2017 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : hydro.h
11  * Created : 10 may 2013
12  * Author : Christophe Hugon, Vincent van Beveren
13  */
14 
15 #ifndef ACOU_H_
16 #define ACOU_H_
17 
18 #include <stdint.h>
19 
20 /**
21  * @file
22  *
23  * @ingroup wbdrivers
24  *
25  * Acoustic Driver.
26  * It allows to enable/disable the acoustic device, configure the channels and the resolution.
27  * It also allows to set the sampling rate, only used for debug.
28  */
29 
30 /**
31  * Register description for control of acoustic.
32  */
33 typedef union {
34  uint32_t value; ///< the full 32 bit register
35  struct {
36  uint32_t spare:16;
37  uint32_t sampling:8; ///< sampling of the AES frame: 1=each frame, 2=one frame each two, ...
38  uint32_t spare2:3;
39  uint32_t res_sel:2; ///< resolution select: 0=12 bit, 1=16 bit, 2=24 bit
40  uint32_t ch_sel:2; ///< channel select: 0=both, 1=ch 1, 2=ch 2
41  uint32_t onoff:1; ///< switch on the hydro
42  } bit;
43 } AcouCtrl;
44 
45 /**
46  * enum for bit resolution
47  */
48 typedef enum {
49  ACOU_RES_12BIT = 0, //!< 12 bits
50  ACOU_RES_16BIT = 1, //!< 16 bits
51  ACOU_RES_24BIT = 2 //!< 32 bits
52 } AcouRes;
53 
54 /**
55  * enum for channels
56  */
57 typedef enum {
58  ACOU_CH_BOTH = 0,//!< Both channels
59  ACOU_CH_1 = 1, //!< Channel 1
60  ACOU_CH_2 = 2 //!< Channel 2
61 } AcouCh;
62 
63 /**
64  * Initializes the acoustics (AES)
65  */
66 void acouInit();
67 
68 /**
69  * Turns the hydrophone on
70  */
71 void acouOn();
72 
73 /**
74  * Truns the hydrohpone off
75  */
76 void acouOff();
77 
78 /**
79  * Set the sampling interval.
80  *
81  * @param val Interval, 1=each frame, 2=every other frame, 3=every 3rd frame, etc...
82  */
83 void acouSetSampling(uint8_t val);
84 
85 /**
86  * Set the bit resolution
87  *
88  * @param val one of ACOU_RES_*
89  */
90 void acouSetResolution(AcouRes val);
91 
92 /**
93  * Set the channel configuration
94  *
95  * @param val one of ACOU_CH_*
96  */
97 void acouSetChannel(AcouCh val);
98 
99 
100 
101 
102 #endif /* ACOU_H_ */
uint32_t value
the full 32 bit register
Definition: acou.h:34
AcouRes
enum for bit resolution
Definition: acou.h:48
AcouCh
enum for channels
Definition: acou.h:57
void acouOn()
Turns the hydrophone on.
Definition: acou.c:30
void acouInit()
Initializes the acoustics (AES)
Definition: acou.c:23
12 bits
Definition: acou.h:49
void acouSetSampling(uint8_t val)
Set the sampling interval.
Definition: acou.c:45
16 bits
Definition: acou.h:50
Both channels.
Definition: acou.h:58
void acouOff()
Truns the hydrohpone off.
Definition: acou.c:39
Register description for control of acoustic.
Definition: acou.h:33
Channel 2.
Definition: acou.h:60
void acouSetResolution(AcouRes val)
Set the bit resolution.
Definition: acou.c:51
void acouSetChannel(AcouCh val)
Set the channel configuration.
Definition: acou.c:57
Channel 1.
Definition: acou.h:59
32 bits
Definition: acou.h:51