eaarl-io  1.0.1+71abbd4
EAARL Input/Output Library (Public API)
Data Structures | Macros | Functions
pulse.h File Reference

Structure and support for EAARL pulse data. More...

#include "eaarlio/error.h"
#include "eaarlio/memory.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  eaarlio_pulse
 EAARL pulse record. More...
 

Macros

#define EAARLIO_MAX_RX_COUNT   4
 Maximum number of return waveforms that are possible for TLD data. More...
 
#define eaarlio_pulse_empty()
 Empty eaarlio_pulse value. More...
 

Functions

eaarlio_error eaarlio_pulse_free (struct eaarlio_pulse *pulse, struct eaarlio_memory *memory)
 Release memory held within an eaarlio_pulse. More...
 

Detailed Description

Structure and support for EAARL pulse data.


Data Structure Documentation

◆ eaarlio_pulse

struct eaarlio_pulse

EAARL pulse record.

Examples:
eaarlio_yaml.c, and example_flight_read_raster_pulse.c.
Data Fields
uint8_t bias_rx[EAARLIO_MAX_RX_COUNT] Channel range bias in nanoseconds.
uint8_t bias_tx Transmit range bias in nanoseconds.
uint16_t range Range measurement for laser.

Measurement is in nanoseconds. Measures travel time from mirror to start of raster and back.

unsigned char * rx[EAARLIO_MAX_RX_COUNT] Return waveforms.
uint8_t rx_count Number of return waveforms.
Warning
This must not exceed EAARLIO_MAX_RX_COUNT.
uint16_t rx_len[EAARLIO_MAX_RX_COUNT] Lengths of eaarlio_pulse::rx.
int16_t scan_angle_counts Angle of scanner, in hardware units.

Use eaarlio_units_pulse_scan_angle to derive angle in degrees.

uint8_t thresh_rx Return waveform hardware threshold failure.

1 indicates that the return waveforms failed the hardware defined treshold

uint8_t thresh_tx Transmit waveform hardware threshold failure.

1 indicates that the transmit waveform failed the hardware defined treshold

uint32_t time_offset Additional fractional time elapsed since raster timestamp.

Use eaarlio_units_pulse_time to derive floating point time.

unsigned char * tx Transmit waveform.
uint8_t tx_len Length of eaarlio_pulse::tx.

Macro Definition Documentation

◆ EAARLIO_MAX_RX_COUNT

#define EAARLIO_MAX_RX_COUNT   4

Maximum number of return waveforms that are possible for TLD data.

The file format does not support more than this.

Examples:
eaarlio_yaml.c, and example_flight_read_raster_pulse.c.

◆ eaarlio_pulse_empty

#define eaarlio_pulse_empty ( )
Value:
(struct eaarlio_pulse) \
{ \
.time_offset = 0, .rx_count = 0, .scan_angle_counts = 0, .range = 0, \
.thresh_tx = 0, .thresh_rx = 0, .bias_tx = 0, \
.bias_rx = { 0, 0, 0, 0 }, .tx_len = 0, .tx = NULL, \
.rx_len = { 0, 0, 0, 0 }, .rx = { \
NULL, \
NULL, \
NULL, \
NULL \
} \
}
EAARL pulse record.
Definition: pulse.h:23

Empty eaarlio_pulse value.

All numeric fields will contain zero values. All pointers will be null.

Function Documentation

◆ eaarlio_pulse_free()

eaarlio_error eaarlio_pulse_free ( struct eaarlio_pulse pulse,
struct eaarlio_memory memory 
)

Release memory held within an eaarlio_pulse.

Parameters
[in,out]pulsePulse with memory to release
[in]memoryMemory handler, or NULL for stdlib
Returns
On success, EAARLIO_SUCCESS.
On failure, eaarlio_error representing the failure condition.
Postcondition
On success, all pointer fields (pulse->tx, pulse->rx[0], pulse->rx[1], pulse->rx[2], pulse->rx[3]) will be null.
On success, any memory that was allocated for the pointer fields has been released.
Remarks
The pointer to pulse is not released.
Pointer fields may be null. If so, they are left alone.