libpruio  0.6.8
Fast and easy Digital/Analog Input/Output for Beaglebones
rb_file.c File Reference

Example: fetch ADC samples in a ring buffer and save to file. More...

#include "unistd.h"
#include "time.h"
#include "stdio.h"
#include "libpruio/pruio.h"
Include dependency graph for rb_file.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 The main function. More...
 

Detailed Description

Example: fetch ADC samples in a ring buffer and save to file.

This file contains an example on how to use the ring buffer mode of libpruio. A fixed step mask of AIN-0, AIN-1 and AIN-2 get configured for maximum speed, sampled in to the ring buffer and from there saved as raw data to some files. Find a functional description in section rb_file.

Licence: GPLv3, Copyright 2014-2023 by Thomas{ doT ]Freiherr[ At ]gmx[ DoT }net

Thanks for C code translation: Nils Kohrs nils..nosp@m.kohr.nosp@m.s@gma.nosp@m.il.c.nosp@m.om

Compile by: gcc -Wall -o rb_file rb_file.c -lpruio

Since
0.4.0

Definition in file rb_file.c.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

The main function.

< The number of samples in the files (per step).

< The sampling rate in ns (20000 -> 50 kHz).

< The number of active steps (must match setStep calls and mask).

< The number of files to write.

< The output file names.

create new driver

< The active steps (9 to 11).

< The maximum total index.

< The maximum index of the half ring buffer.

< The number of samples (per step).

< A pointer to the start of the ring buffer.

< A pointer to the middle of the ring buffer.

< File counter.

< Start index.

Definition at line 25 of file rb_file.c.

Here is the call graph for this function: