The main header code of the C wrapper for libpruio. More...
Go to the source code of this file.
Classes | |
struct | adcSteps |
Wrapper structure for AdcSteps. More... | |
struct | adcSet |
Wrapper structure for AdcSet. More... | |
struct | adcUdt |
Wrapper structure for AdcUdt. More... | |
struct | gpioSet |
Wrapper structure for GpioSet. More... | |
struct | gpioArr |
Wrapper structure for GpioArr. More... | |
struct | gpioUdt |
Wrapper structure for GpioUdt. More... | |
struct | timerSet |
Wrapper structure for TimerSet. More... | |
struct | timerArr |
Wrapper structure for TimerArr. More... | |
struct | timerUdt |
Wrapper structure for TimerUdt. More... | |
struct | pwmssSet |
Wrapper structure for PwmssSet. More... | |
struct | pwmssArr |
Wrapper structure for PwmssArr. More... | |
struct | pwmssUdt |
Wrapper structure for PwmssUdt. More... | |
struct | pwmMod |
Wrapper structure for PwmMod. More... | |
struct | qepMod |
Wrapper structure for QepMod. More... | |
struct | ballSet |
Wrapper structure for BallSet. More... | |
struct | pruIo |
Wrapper structure for PruIo. More... | |
Macros | |
#define | PRUIO_VERSION "0.6.6" |
version string | |
#define | PRUIO_DEF_AVRAGE 4 |
The default setting for avaraging. | |
#define | PRUIO_DEF_ODELAY 183 |
The default value for open delay in channel settings. | |
#define | PRUIO_DEF_SDELAY 0 |
The default value for sample delay in channel settings. | |
#define | PRUIO_DEF_SAMPLS 1 |
The default number of samples to use (configures single mode). | |
#define | PRUIO_DEF_STPMSK 510 |
The default step mask (steps 1 to 8 for AIN0 to AIN7, no charge step). | |
#define | PRUIO_DEF_TIMERV 0 |
The default timer value (sampling rate). | |
#define | PRUIO_DEF_LSLMOD 4 |
The default bit mode (4 = 16 bit encoding). | |
#define | PRUIO_DEF_CLKDIV 0 |
The default clock divisor (0 = full speed AFE = 2.4 MHz). | |
Typedefs | |
typedef signed char | int8 |
8 bit signed integer data type. | |
typedef short | int16 |
16 bit signed integer data type. | |
typedef int | int32 |
32 bit signed integer data type. | |
typedef unsigned char | uint8 |
8 bit unsigned integer data type. | |
typedef unsigned short | uint16 |
16 bit unsigned integer data type. | |
typedef unsigned int | uint32 |
32 bit unsigned integer data type. | |
typedef float | float_t |
float data type. | |
typedef struct pruIo | pruIo |
forward declaration More... | |
typedef struct adcSet | adcSet |
Wrapper structure for AdcSet. More... | |
typedef struct adcUdt | adcUdt |
Wrapper structure for AdcUdt. More... | |
typedef struct gpioSet | gpioSet |
Wrapper structure for GpioSet. More... | |
typedef struct gpioArr | gpioArr |
Wrapper structure for GpioArr. More... | |
typedef struct gpioUdt | gpioUdt |
Wrapper structure for GpioUdt. More... | |
typedef struct timerSet | timerSet |
Wrapper structure for TimerSet. More... | |
typedef struct timerArr | timerArr |
Wrapper structure for TimerArr. More... | |
typedef struct timerUdt | timerUdt |
Wrapper structure for TimerUdt. More... | |
typedef struct pwmssSet | pwmssSet |
Wrapper structure for PwmssSet. More... | |
typedef struct pwmssArr | pwmssArr |
Wrapper structure for PwmssArr. More... | |
typedef struct pwmssUdt | pwmssUdt |
Wrapper structure for PwmssUdt. More... | |
typedef struct pwmMod | pwmMod |
Wrapper structure for PwmMod. More... | |
typedef struct capMod | capMod |
Wrapper structure for CapMod. More... | |
typedef struct qepMod | qepMod |
Wrapper structure for QepMod. More... | |
typedef struct ballSet | ballSet |
Wrapper structure for BallSet. More... | |
Enumerations | |
enum | BBTypes { BBB2x46 = 0 , PBB2x36 = 1 , BB_Blue = 2 , BBB2x46 = 0 , PBB2x36 = 1 , BB_Blue = 2 } |
Wrapper enumerators for board types. More... | |
enum | pinMuxing { PRUIO_PULL_DOWN = 0 , PRUIO_NO_PULL = 1 << 3 , PRUIO_PULL_UP = 1 << 4 , PRUIO_RX_ACTIV = 1 << 5 , PRUIO_GPIO_OUT0 = 7 + PRUIO_NO_PULL , PRUIO_GPIO_OUT1 = 7 + PRUIO_NO_PULL + 128 , PRUIO_GPIO_IN = 7 + PRUIO_NO_PULL + PRUIO_RX_ACTIV , PRUIO_GPIO_IN_0 = 7 + PRUIO_PULL_DOWN + PRUIO_RX_ACTIV , PRUIO_GPIO_IN_1 = 7 + PRUIO_PULL_UP + PRUIO_RX_ACTIV , PRUIO_PIN_RESET = 0xFF } |
Wrapper enumerators for PinMuxing. More... | |
enum | adcStepmask { AIN0 = 1 << 1 , AIN1 = 1 << 2 , AIN2 = 1 << 3 , AIN3 = 1 << 4 , AIN4 = 1 << 5 , AIN5 = 1 << 6 , AIN6 = 1 << 7 , AIN7 = 1 << 8 } |
Wrapper enumerators for AdcStepMask. More... | |
enum | activateDevice { PRUIO_ACT_PRU1 = 1 , PRUIO_ACT_ADC = 1 << 1 , PRUIO_ACT_GPIO0 = 1 << 2 , PRUIO_ACT_GPIO1 = 1 << 3 , PRUIO_ACT_GPIO2 = 1 << 4 , PRUIO_ACT_GPIO3 = 1 << 5 , PRUIO_ACT_PWM0 = 1 << 6 , PRUIO_ACT_PWM1 = 1 << 7 , PRUIO_ACT_PWM2 = 1 << 8 , PRUIO_ACT_TIM4 = 1 << 9 , PRUIO_ACT_TIM5 = 1 << 10 , PRUIO_ACT_TIM6 = 1 << 11 , PRUIO_ACT_TIM7 = 1 << 12 , PRUIO_DEF_ACTIVE = 0x1FFF , PRUIO_ACT_FREMUX = 0xFFF8 } |
Wrapper enumerators for ActivateDevice. More... | |
The main header code of the C wrapper for libpruio.
This file provides the declarations of macros, types and classes in C syntax. Include this file in your code to make use of libpruio. This file contains a translation of the context of all FreeBASIC headers (pruio.bi, pruio.hp, pruio_adc.bi, pruio_gpio.bi and pruio_pwm.bi) in one file.
Feel free to translate this file in order to create language bindings for non-C languages and use libpruio in polyglot applications. Check also file pruio_pins.h for a convenient way to declare header pins.
Licence: LGPLv2 (http://www.gnu.org/licenses/lgpl-2.0.html)
Copyright 2014-2023 by Thomas{ dOt ]Freiherr[ aT ]gmx[DoT}net
Definition in file pruio.h.
enum activateDevice |
Wrapper enumerators for ActivateDevice.
enum adcStepmask |
Wrapper enumerators for AdcStepMask.
enum BBTypes |
Wrapper enumerators for board types.
enum pinMuxing |
Wrapper enumerators for PinMuxing.
Wrapper function for AdcUdt::mm_trg_ain().
Io | The pointer of the PruIo instance. |
Stp | The step number to use for trigger input. |
AdcV | The sample value to match (positive check greater than, negative check less than). |
Rela | If AdcV is relative to the current input. |
Skip | The number of samples to skip (defaults to 0 = zero, max. 1023). |
Wrapper function for AdcUdt::mm_trg_pin().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to test. |
GpioV | The state to check (defaults to high = 1). |
Skip | The number of samples to skip (defaults to 0 = zero, max. 1023). |
Wrapper function for AdcUdt::mm_trg_pre().
Io | The pointer of the PruIo instance. |
Stp | The step number to use for trigger input. |
AdcV | The sample value to match (positive check greater than, negative check less than). |
Samp | The number of samples for the pre-trigger. |
Rela | If AdcV is relative to the current input. |
Wrapper function for AdcUdt::setStep().
Io | The pointer of the PruIo instance. |
Stp | Step index (0 = step 0 => charge step, 1 = step 1 (=> AIN0 by default), ..., 17 = idle step). |
ChN | Channel number to scan (0 = AIN0, 1 = AIN1, ...). |
Av | New value for avaraging (defaults to 4). |
SaD | New value for sample delay (defaults to 0). |
OpD | New value for open delay (defaults to 0x98). |
Wrapper function for CapMod::config().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to configure. |
FLow | Minimal frequency to measure (> .0232831). |
Wrapper function for CapMod::Value().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to test. |
Hz | A pointer to store the frequency value (or null). |
Du | A pointer to store the duty cycle value (or null). |
Wrapper function for PruIo::config().
Io | The pointer of the PruIo instance. |
Samp | The number of samples to fetch (defaults to zero). |
Mask | The mask for active steps (defaults to all 8 channels active in steps 1 to 8). |
Tmr | The timer value in [ns] to specify the sampling rate (defaults to zero, MM only). |
Mds | The modus for output bit encoding (defaults to 4 = 16 bit). |
void pruio_destroy | ( | pruIo * | Io | ) |
Wrapper function for the destructor PruIo::~PruIo().
Io | The pointer of the instance. |
Wrapper function for GpioUdt::config().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to set. |
Modus | The mode for the GPIO. |
Wrapper function for GpioUdt::flush().
Io | The pointer of the PruIo instance. |
Indx | The GPIO subsystem number to flush. |
Wrapper function for GpioUdt::setValue().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to set. |
Modus | The mode for the GPIO output. |
Wrapper function for GpioUdt::Value().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to test. |
Wrapper function for PruIo::mm_start().
Io | The pointer of the PruIo instance. |
Trg1 | Settings for first trigger (default = no trigger). |
Trg2 | Settings for second trigger (default = no trigger). |
Trg3 | Settings for third trigger (default = no trigger). |
Trg4 | Settings for fourth trigger (default = no trigger). |
Wrapper function for the constructor PruIo::PruIo().
Act | The mask for active subsystems and PRU number. |
Av | The avaraging for default steps (0 to 16, defaults to 0). |
OpD | The open delay for default steps (0 to 0x3FFFF, defaults to 0x98). |
SaD | The sample delay for default steps (0 to 255, defaults to 0). |
Since the constructor reads the original subsystem configurations and the destructor restores them, it's recommended to create and use just one PruIo instance at the same time.
Wrapper function for PruIo::Pin().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to describe. |
Wrapper function for PwmMod::setValue().
Io | The pointer of the PruIo instance |
Ball | the CPU ball number to set |
Hz | The frequency to set (or -1 for no change). |
Du | The duty cycle to set (0.0 to 1.0, or -1 for no change). |
Wrapper function for PwmMod::Value().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number to test. |
Hz | A pointer to store the frequency value (or null). |
Du | A pointer to store the duty cycle value (or null). |
char* pruio_qep_config | ( | pruIo * | Io, |
uint8 | Ball, | ||
uint32 | PMax, | ||
float_t | VHz, | ||
float_t | Scale, | ||
uint8 | Mo | ||
) |
Wrapper function for QepMod::config().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number (either input A, B or I). |
PMax | The maximum position counter value (defaults to &h7FFFFFFF). |
VHz | The frequency to compute velocity values (defaults to 25 Hz). |
Scale | The Scale factor for velocity values (defaults to 1.0). |
Mo | The modus to use for pinmuxing (0 or PRUIO_PIN_RESET). |
Wrapper function for QepMod::Value().
Io | The pointer of the PruIo instance. |
Ball | The CPU ball number (as in QepMod::config() call). |
Posi | A pointer to store the position value (or NULL). |
Velo | A pointer to store the valocity value (or NULL). |
char* pruio_rb_start | ( | pruIo * | Io | ) |
Wrapper function for PruIo::rb_start().
Io | The pointer of the PruIo instance. |
Wrapper function for TimerUdt::setValue().
Io | The pointer of the PruIo instance. |
Ball | The header pin to configure. |
Dur1 | The duration in [ms] before state change (or 0 to stop timer). |
Dur2 | The duration in [ms] for the state change (or 0 for minimal duration). |
Mode | The modus to set (defaults to 0 = one cycle positive pulse). |
Wrapper function for TimerUdt::Value().
Io | The pointer of the PruIo instance. |
Ball | The header pin to configure. |
Dur1 | The duration in [ms] before state change (or 0 to stop timer). |
Dur2 | The duration in [ms] for the state change (or 0 for minimal duration). |