... | ... | @@ -133,42 +133,45 @@ done by implementing a counter in the ADC core. |
|
|
|
|
|
This class is used to handle the GPIOs.
|
|
|
|
|
|
*Functions:**
|
|
|
\*`__init__(self, mem, addr)`: The builder. Offset address is 0x0000.
|
|
|
\*`direction(self, pin, is_out)`: Set the pin direction (0 for in and 1
|
|
|
for out).
|
|
|
\*`set(self, pin, value)`: Set or clear an output value on one pin.
|
|
|
\*`get(self, pin)`: Return boolean input pin value.
|
|
|
*Functions:**
|
|
|
|
|
|
- `__init__(self, mem, addr)`: The builder. Offset address is 0x0000.
|
|
|
- `direction(self, pin, is_out)`: Set the pin direction (0 for in and
|
|
|
1 for out).
|
|
|
- `set(self, pin, value)`: Set or clear an output value on one pin.
|
|
|
- `get(self, pin)`: Return boolean input pin value.
|
|
|
|
|
|
### BitBangedSPI
|
|
|
|
|
|
Used to control the SPI communication trough the GPIOs.
|
|
|
|
|
|
*Functions:**
|
|
|
\*`__init__(self, gpio, cs_pin, sck_pin, data_pin)`: The builder. All
|
|
|
the pins are defined here.
|
|
|
\*`cs(self, value)`: Set the value on the chip select pin.
|
|
|
\*`sck(self, value)`: Set the value on the clock pin.
|
|
|
\*`set_sdata(self, value)`: Used to send one data bit on the data pin.
|
|
|
\*`get_sdata(self)`: Used to read one data bit on the data pin.
|
|
|
\*`txrx(self, data, n_bits)`: Transmits or reads `n_bits`. If data is
|
|
|
set to zero, this function just reads what is on the data line.
|
|
|
*Functions:**
|
|
|
|
|
|
- `__init__(self, gpio, cs_pin, sck_pin, data_pin)`: The builder. All
|
|
|
the pins are defined here.
|
|
|
- `cs(self, value)`: Set the value on the chip select pin.
|
|
|
- `sck(self, value)`: Set the value on the clock pin.
|
|
|
- `set_sdata(self, value)`: Used to send one data bit on the data pin.
|
|
|
- `get_sdata(self)`: Used to read one data bit on the data pin.
|
|
|
- `txrx(self, data, n_bits)`: Transmits or reads `n_bits`. If data is
|
|
|
set to zero, this function just reads what is on the data line.
|
|
|
|
|
|
### Trigger
|
|
|
|
|
|
Controls the hardware trigger inside the FPGA.
|
|
|
|
|
|
*Functions:**
|
|
|
\*`__init__(self, mem, addr)`: The builder. The different addresses are
|
|
|
: 0x1000 for channel 0, 0x3000 for channel 1, 0x5000 for channel 2 and
|
|
|
0x7000 for channel 3.
|
|
|
\*`configure(self, edge, threshold_lo, threshold_hi, mask)`: Set the
|
|
|
trigger independently. Set the triggering edge (Rising edge if 0 and
|
|
|
Falling edge if 1). The two threshold levels are set here. Finally, the
|
|
|
mask is used to link the trigger to the other channels. If the trigger
|
|
|
mask is set to 0xF, this means that any event on any channel will
|
|
|
trigger the record on all the channels. Any other combination of trigger
|
|
|
can be configured.
|
|
|
*Functions:**
|
|
|
|
|
|
- `__init__(self, mem, addr)`: The builder. The different addresses
|
|
|
are : 0x1000 for channel 0, 0x3000 for channel 1, 0x5000 for channel
|
|
|
2 and 0x7000 for channel 3.
|
|
|
- `configure(self, edge, threshold_lo, threshold_hi, mask)`: Set the
|
|
|
trigger independently. Set the triggering edge (Rising edge if 0 and
|
|
|
Falling edge if 1). The two threshold levels are set here. Finally,
|
|
|
the mask is used to link the trigger to the other channels. If the
|
|
|
trigger mask is set to 0xF, this means that any event on any channel
|
|
|
will trigger the record on all the channels. Any other combination
|
|
|
of trigger can be configured.
|
|
|
|
|
|
<table>
|
|
|
<tbody>
|
... | ... | @@ -218,10 +221,10 @@ channel 2 will not trigger any recording as the mask is 0x0. And |
|
|
finally, an event occurring on channel 3 will only trigger the recording
|
|
|
on its channel.
|
|
|
|
|
|
\*`force(self)`: Used to force the trigger. Mainly used for debugging.
|
|
|
\*`triggered(self)`: Return True if an eligible event occurred on this
|
|
|
channel.
|
|
|
\*`arm(self)`: Arm the trigger
|
|
|
- `force(self)`: Used to force the trigger. Mainly used for debugging.
|
|
|
- `triggered(self)`: Return True if an eligible event occurred on this
|
|
|
channel.
|
|
|
- `arm(self)`: Arm the trigger
|
|
|
|
|
|
### Buffer
|
|
|
|
... | ... | @@ -232,27 +235,30 @@ a trigger, the pointer continues to write data but stops after looping |
|
|
avoiding erasing data arrived after the event. By stopping the pointer
|
|
|
earlier, it is possible to save pretrigger samples.
|
|
|
|
|
|
*Functions:**
|
|
|
\*`__init__(self, mem, addr)`: The builder. The possible addresses are :
|
|
|
0x2000 for channel 0, 0x4000 for channel 1, 0x6000 for channel 2 and
|
|
|
0x8000 for channel 3.
|
|
|
\*`set_pretrigger(self, pretrigger)`: Number of samples kept before the
|
|
|
event.
|
|
|
\*`start(self)`: Launch the continuous recording in the buffer.
|
|
|
\*`ready(self)`: Returns True when the buffer data is ready to be
|
|
|
transferred to the Ps.
|
|
|
\*`read(self)`: Returns the formatted data out of the buffer. This needs
|
|
|
the `sign_extend(value, bits)` global function used to format raw data.
|
|
|
*Functions:**
|
|
|
|
|
|
- `__init__(self, mem, addr)`: The builder. The possible addresses are
|
|
|
: 0x2000 for channel 0, 0x4000 for channel 1, 0x6000 for channel 2
|
|
|
and 0x8000 for channel 3.
|
|
|
- `set_pretrigger(self, pretrigger)`: Number of samples kept before
|
|
|
the event.
|
|
|
- `start(self)`: Launch the continuous recording in the buffer.
|
|
|
- `ready(self)`: Returns True when the buffer data is ready to be
|
|
|
transferred to the Ps.
|
|
|
- `read(self)`: Returns the formatted data out of the buffer. This
|
|
|
needs the `sign_extend(value, bits)` global function used to format
|
|
|
raw data.
|
|
|
|
|
|
### AD9253
|
|
|
|
|
|
This class is set for the ADC. It is basically represented by its SPI
|
|
|
communication.
|
|
|
|
|
|
\*Functions:\_
|
|
|
\*`__init__(self, spi)`: The builder. It needs the SPI interface to be
|
|
|
set.
|
|
|
\*`write_reg(self, reg, value)`: It is used to write in the ADC
|
|
|
registers.
|
|
|
\*`read_reg(self, ref)`: Used to read a specific ADC register.
|
|
|
*Functions:**
|
|
|
|
|
|
- `__init__(self, spi)`: The builder. It needs the SPI interface to be
|
|
|
set.
|
|
|
- `write_reg(self, reg, value)`: It is used to write in the ADC
|
|
|
registers.
|
|
|
- `read_reg(self, ref)`: Used to read a specific ADC register.
|
|
|
|