KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
acou.c
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2013 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : hydro.c
11  * Created : 10 may 2013
12  * Author : Christophe Hugon
13  */
14 
15 
16 #include "drv/wb/acou.h"
17 #include "lm32soc/dev_soc.h"
18 #include "kernel/errata.h"
19 
20 
21 static AcouCtrl acou_reg;
22 
23 void acouInit ()
24 {
25  acou_reg.bit.sampling = 1;
26  acou_reg.bit.onoff = 0;
27  ACOU->CTRL=acou_reg.value;
28 }
29 
30 void acouOn ()
31 {
32  // This BASE contains errata 12V hydrophone and may not be enabled
33  if (errataActive(ERRATA_HYDRO_12V)) return;
34  acou_reg.bit.onoff = 1;
35  ACOU->CTRL=acou_reg.value;
36 }
37 
38 
39 void acouOff ()
40 {
41  acou_reg.bit.onoff = 0;
42  ACOU->CTRL=acou_reg.value;
43 }
44 
45 void acouSetSampling(uint8_t val)
46 {
47  acou_reg.bit.sampling = val;
48  ACOU->CTRL=acou_reg.value;
49 }
50 
52 {
53  acou_reg.bit.res_sel = val;
54  ACOU->CTRL=acou_reg.value;
55 }
56 
58 {
59  acou_reg.bit.ch_sel = val;
60  ACOU->CTRL=acou_reg.value;
61 }
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
uint32_t sampling
sampling of the AES frame: 1=each frame, 2=one frame each two, ...
Definition: acou.h:37
void acouInit()
Initializes the acoustics (AES)
Definition: acou.c:23
#define ACOU
Acou base pointer.
Definition: dev_soc.h:58
void acouSetSampling(uint8_t val)
Set the sampling interval.
Definition: acou.c:45
uint32_t res_sel
resolution select: 0=12 bit, 1=16 bit, 2=24 bit
Definition: acou.h:39
void acouOff()
Truns the hydrohpone off.
Definition: acou.c:39
uint32_t onoff
switch on the hydro
Definition: acou.h:41
Register description for control of acoustic.
Definition: acou.h:33
This file assigns all device structures to memory mapped structures.
void acouSetResolution(AcouRes val)
Set the bit resolution.
Definition: acou.c:51
void acouSetChannel(AcouCh val)
Set the channel configuration.
Definition: acou.c:57
uint32_t ch_sel
channel select: 0=both, 1=ch 1, 2=ch 2
Definition: acou.h:40
Acoustic Driver.