#include <sys/types.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <signal.h>
#include <time.h>
#include <sys/termios.h>
#include <fcntl.h>
Go to the source code of this file.
Data Structures | |
| struct | adxl_reading_t |
| Struct used to return raw and processed readings from the ADXL. More... | |
Defines | |
| #define | _ADXL_UTIL_H_ |
| #define | NUM_ADXL_CHANNELS 2 |
| Number of possible data channels - analog plus digital. | |
| #define | ADXL_READ_LEN 4 |
| Number of bytes per ADXL reading. | |
| #define | ADXL_DATUM_LEN 24 |
| Size of a NSDS-formatted reading - used for buffer sizing. | |
| #define | ADXL_MAX_RATE_HZ 250 |
| Max sample rate, approximate. | |
Functions | |
| int | adxl_open (const char *comport_file) |
| Open port and configure control lines, etc. | |
| int | adxl_read (const int comm_fd, adxl_reading_t *result) |
| Read a single set of values from the ADXL board. | |
| int | adxl_close (const int comm_fd) |
| Simple wrapper to close the port. | |
| void | adxl_sighandler (int signal) |
| Control-break handler. Sets global flag to indicate exit request. | |
Variables | |
| bool | control_break |
| Global boolean set by signal handler to force exit. | |
Definition in file adxl_util.h.
|
|
Definition at line 34 of file adxl_util.h. |
|
|
Size of a NSDS-formatted reading - used for buffer sizing.
Definition at line 59 of file adxl_util.h. Referenced by daq_thread_main(). |
|
|
Max sample rate, approximate.
Definition at line 62 of file adxl_util.h. Referenced by main(). |
|
|
Number of bytes per ADXL reading.
Definition at line 56 of file adxl_util.h. Referenced by adxl_read(). |
|
|
Number of possible data channels - analog plus digital.
Definition at line 53 of file adxl_util.h. Referenced by adxl_do_work(), daq_do_work(), daq_thread_main(), data_channel_enabled(), data_channel_flag(), and main(). |
|
|
Simple wrapper to close the port. ... which releases the control lines and shuts down the DAQ.
Definition at line 182 of file adxl_util.c. Referenced by adxl_do_work(), and daq_thread_main(). |
|
|
Open port and configure control lines, etc. Function to open the serial port and set up the rather peculiar comms requirements of the ADXL202: 38400 baud, N81 No flow control (?) Powered by RTS
Definition at line 47 of file adxl_util.c. Referenced by adxl_do_work(), and daq_thread_main(). |
|
||||||||||||
|
Read a single set of values from the ADXL board.
Definition at line 118 of file adxl_util.c. References ADXL_READ_LEN, adxl_reading_t::G, and adxl_reading_t::raw. Referenced by adxl_do_work(), and daq_thread_main(). |
|
|
Control-break handler. Sets global flag to indicate exit request.
Definition at line 202 of file adxl_util.c. References control_break. Referenced by main(). |
|
|
Global boolean set by signal handler to force exit.
Definition at line 49 of file adxl_util.h. Referenced by adxl_do_work(), adxl_sighandler(), daq_main_loop(), daq_thread_main(), and main(). |
1.3