The main header code of the C wrapper for libpruio. More...
#include "prussdrv.h"
#include "pruss_intc_mapping.h"
Go to the source code of this file.
Classes | |
class | AdcSteps |
user defined type for a step setting More... | |
class | GpioSet |
user defined type for a GPIO setting More... | |
class | PruIo |
user defined type (class) for the driver structure More... | |
Macros | |
#define | PRUIO_BALL_AZ 109 |
#define | PRUIO_BALL_OFFS 256 |
#define | PRUIO_GPIO_AZ 3 |
#define | PRUIO_GPIO_OFFS 64 |
#define | PRUIO_GPIO_DATA 24 |
#define | PRUIO_GPIO_BLCK 32 |
#define | PRUIO_ADC_OFFS 512 |
#define | PRUIO_ADC_DATA 228 |
#define | PRUIO_ADC_EMPTY 12 |
#define | PRUIO_ADC_BUFF 16 |
#define | PRUIO_TRG_PARA 4 |
#define | PRUIO_IRPT 25 |
#define | PRUIO_MSG_INIT_OK 4294967295 |
#define | PRUIO_MSG_EXIT_OK 4294967294 |
#define | PRUIO_MSG_ADC_ERRR 4294967293 |
#define | PRUIO_MSG_IO_OK 4294967292 |
#define | PRUIO_MSG_MM_WAIT 4294967291 |
#define | PRUIO_MSG_MM_TRG1 4294967290 |
#define | PRUIO_MSG_MM_TRG2 4294967289 |
#define | PRUIO_MSG_MM_TRG3 4294967288 |
#define | PRUIO_MSG_MM_TRG4 4294967287 |
#define | AM33XX |
tell pruss_intc_mapping.bi that we use ARM33xx More... | |
#define | PRUIO_CHAN CHANNEL5 |
the PRUSS driver library More... | |
#define | PRUIO_MASK PRU_EVTOUT5_HOSTEN_MASK |
the mask to enable PRU interrupts (must match PRUIO_IRPT) More... | |
#define | PRUIO_EMAP PRU_EVTOUT5 |
the event for PRU messages (mapping, must match PRUIO_IRPT) More... | |
#define | PRUIO_EVNT PRU_EVTOUT_5 |
the event for PRU messages (must match PRUIO_IRPT) More... | |
#define | PRUIO_DEF_AVRAGE 4 |
the default setting for avaraging More... | |
#define | PRUIO_DEF_ODELAY 183 |
the default value for open delay in channel settings More... | |
#define | PRUIO_DEF_SDELAY 0 |
the default value for sample delay in channel settings More... | |
#define | PRUIO_DEF_PRUSS 1 |
the default PRU subsystem to use More... | |
#define | PRUIO_DEF_SAMPLS 0 |
the default number of samples to use (configures single mode) More... | |
#define | PRUIO_DEF_STPMSK 0x1FE /* &b111111110 */ |
the default step mask (steps 1 to 8 for AIN0 to AIN7, no charge step) More... | |
#define | PRUIO_DEF_TIMERV 0 |
the default timer value (sampling rate) More... | |
#define | PRUIO_DEF_LSLMOD 4 |
the default bit mode (4 = 16 bit encoding) More... | |
#define | PRUIO_DEF_CLKDIV 0 |
the default clock divisor (0 = full speed AFE = 2.4 MHz) More... | |
#define | PRUIO_IN 0x2F /* &b00101111 */ |
convenience macro to configure an input pin without pullup or pulldown More... | |
#define | PRUIO_IN_0 0x27 /* &b00100111 */ |
convenience macro to configure an low input pin (with pulldown resistor) More... | |
#define | PRUIO_IN_1 0x37 /* &b00110111 */ |
convenience macro to configure an high input pin (with pullup resistor) More... | |
#define | PRUIO_OUT0 0xF /* &b00001111 */ |
convenience macro to configure an output pin initial low More... | |
#define | PRUIO_OUT1 0x8F /* &b10001111 */ |
convenience macro to configure an output pin initial high More... | |
#define | PRUIO_PIN_RESET 0xFF /* &b11111111 */ |
convenience macro to re-configure a pin to its original (initial) state More... | |
Typedefs | |
typedef unsigned int | uint32 |
32 bit unsigned integer data type More... | |
typedef unsigned short | uint16 |
16 bit unsigned integer data type More... | |
typedef unsigned char | uint8 |
8 bit unsigned integer data type More... | |
typedef int | int32 |
32 bit signed integer data type More... | |
typedef short | int16 |
16 bit signed integer data type More... | |
typedef signed char | int8 |
8 bit signed integer data type More... | |
typedef struct PruIo | PruIo |
user defined type (class) for the driver structure More... | |
The main header code of the C wrapper for libpruio.
This file provides the declarations of the PruIo class member functions in C syntax. It also can be used to create language bindings for non-C languages to use libpruio in polyglot applications.
Licence: LGPLv2 (http://www.gnu.org/licenses/lgpl-2.0.html)
Copyright 2014 by Thomas{ dOt ]Freiherr[ At ]gmx[ DoT }net
Definition in file pruio_c_wrapper.h.
class AdcSteps |
user defined type for a step setting
Definition at line 115 of file pruio_c_wrapper.h.
Class Members | ||
---|---|---|
uint32 | Confg | context for configuration register |
uint32 | Delay | context for delay register |
class GpioSet |
user defined type for a GPIO setting
Definition at line 121 of file pruio_c_wrapper.h.
Class Members | ||
---|---|---|
uint32 | Addr | base address of GPIO device |
uint32 | ClrM | mask to clear pins to low |
uint32 | SetM | mask to set pins to high |
uint32 | OutE | mask to enable pins for output |
uint32 | Stat | current state of pins (mixed) |
uint32 | StaO | current state of output pins |
uint32 | fe1 | future expansion |
uint32 | fe2 |
#define PRUIO_BALL_AZ 109 |
Definition at line 20 of file pruio_c_wrapper.h.
#define PRUIO_BALL_OFFS 256 |
Definition at line 21 of file pruio_c_wrapper.h.
#define PRUIO_GPIO_AZ 3 |
Definition at line 23 of file pruio_c_wrapper.h.
#define PRUIO_GPIO_OFFS 64 |
Definition at line 24 of file pruio_c_wrapper.h.
#define PRUIO_GPIO_DATA 24 |
Definition at line 25 of file pruio_c_wrapper.h.
#define PRUIO_GPIO_BLCK 32 |
Definition at line 26 of file pruio_c_wrapper.h.
#define PRUIO_ADC_OFFS 512 |
Definition at line 28 of file pruio_c_wrapper.h.
#define PRUIO_ADC_DATA 228 |
Definition at line 29 of file pruio_c_wrapper.h.
#define PRUIO_ADC_EMPTY 12 |
Definition at line 30 of file pruio_c_wrapper.h.
#define PRUIO_ADC_BUFF 16 |
Definition at line 31 of file pruio_c_wrapper.h.
#define PRUIO_TRG_PARA 4 |
Definition at line 32 of file pruio_c_wrapper.h.
#define PRUIO_IRPT 25 |
Definition at line 34 of file pruio_c_wrapper.h.
#define PRUIO_MSG_INIT_OK 4294967295 |
Definition at line 36 of file pruio_c_wrapper.h.
#define PRUIO_MSG_EXIT_OK 4294967294 |
Definition at line 37 of file pruio_c_wrapper.h.
#define PRUIO_MSG_ADC_ERRR 4294967293 |
Definition at line 38 of file pruio_c_wrapper.h.
#define PRUIO_MSG_IO_OK 4294967292 |
Definition at line 39 of file pruio_c_wrapper.h.
#define PRUIO_MSG_MM_WAIT 4294967291 |
Definition at line 40 of file pruio_c_wrapper.h.
#define PRUIO_MSG_MM_TRG1 4294967290 |
Definition at line 41 of file pruio_c_wrapper.h.
#define PRUIO_MSG_MM_TRG2 4294967289 |
Definition at line 42 of file pruio_c_wrapper.h.
#define PRUIO_MSG_MM_TRG3 4294967288 |
Definition at line 43 of file pruio_c_wrapper.h.
#define PRUIO_MSG_MM_TRG4 4294967287 |
Definition at line 44 of file pruio_c_wrapper.h.
#define AM33XX |
tell pruss_intc_mapping.bi that we use ARM33xx
Definition at line 49 of file pruio_c_wrapper.h.
#define PRUIO_CHAN CHANNEL5 |
the PRUSS driver library
PRUSS driver interrupt settings the channel for PRU messages (must match PRUIO_IRPT)
Definition at line 57 of file pruio_c_wrapper.h.
#define PRUIO_MASK PRU_EVTOUT5_HOSTEN_MASK |
the mask to enable PRU interrupts (must match PRUIO_IRPT)
Definition at line 59 of file pruio_c_wrapper.h.
#define PRUIO_EMAP PRU_EVTOUT5 |
the event for PRU messages (mapping, must match PRUIO_IRPT)
Definition at line 61 of file pruio_c_wrapper.h.
#define PRUIO_EVNT PRU_EVTOUT_5 |
the event for PRU messages (must match PRUIO_IRPT)
Definition at line 63 of file pruio_c_wrapper.h.
#define PRUIO_DEF_AVRAGE 4 |
the default setting for avaraging
Definition at line 66 of file pruio_c_wrapper.h.
#define PRUIO_DEF_ODELAY 183 |
the default value for open delay in channel settings
Definition at line 68 of file pruio_c_wrapper.h.
#define PRUIO_DEF_SDELAY 0 |
the default value for sample delay in channel settings
Definition at line 70 of file pruio_c_wrapper.h.
#define PRUIO_DEF_PRUSS 1 |
the default PRU subsystem to use
Definition at line 72 of file pruio_c_wrapper.h.
#define PRUIO_DEF_SAMPLS 0 |
the default number of samples to use (configures single mode)
Definition at line 74 of file pruio_c_wrapper.h.
#define PRUIO_DEF_STPMSK 0x1FE /* &b111111110 */ |
the default step mask (steps 1 to 8 for AIN0 to AIN7, no charge step)
Definition at line 76 of file pruio_c_wrapper.h.
#define PRUIO_DEF_TIMERV 0 |
the default timer value (sampling rate)
Definition at line 78 of file pruio_c_wrapper.h.
#define PRUIO_DEF_LSLMOD 4 |
the default bit mode (4 = 16 bit encoding)
Definition at line 80 of file pruio_c_wrapper.h.
#define PRUIO_DEF_CLKDIV 0 |
the default clock divisor (0 = full speed AFE = 2.4 MHz)
Definition at line 82 of file pruio_c_wrapper.h.
#define PRUIO_IN 0x2F /* &b00101111 */ |
convenience macro to configure an input pin without pullup or pulldown
Definition at line 85 of file pruio_c_wrapper.h.
#define PRUIO_IN_0 0x27 /* &b00100111 */ |
convenience macro to configure an low input pin (with pulldown resistor)
Definition at line 87 of file pruio_c_wrapper.h.
#define PRUIO_IN_1 0x37 /* &b00110111 */ |
convenience macro to configure an high input pin (with pullup resistor)
Definition at line 89 of file pruio_c_wrapper.h.
#define PRUIO_OUT0 0xF /* &b00001111 */ |
convenience macro to configure an output pin initial low
Definition at line 91 of file pruio_c_wrapper.h.
#define PRUIO_OUT1 0x8F /* &b10001111 */ |
convenience macro to configure an output pin initial high
Definition at line 93 of file pruio_c_wrapper.h.
#define PRUIO_PIN_RESET 0xFF /* &b11111111 */ |
convenience macro to re-configure a pin to its original (initial) state
Definition at line 95 of file pruio_c_wrapper.h.
typedef unsigned int uint32 |
32 bit unsigned integer data type
Definition at line 107 of file pruio_c_wrapper.h.
typedef unsigned short uint16 |
16 bit unsigned integer data type
Definition at line 108 of file pruio_c_wrapper.h.
typedef unsigned char uint8 |
8 bit unsigned integer data type
Definition at line 109 of file pruio_c_wrapper.h.
typedef int int32 |
32 bit signed integer data type
Definition at line 110 of file pruio_c_wrapper.h.
typedef short int16 |
16 bit signed integer data type
Definition at line 111 of file pruio_c_wrapper.h.
typedef signed char int8 |
8 bit signed integer data type
Definition at line 112 of file pruio_c_wrapper.h.
enum PRUIO_PIN_LOCKING |
Definition at line 97 of file pruio_c_wrapper.h.
C wrapper to create a PruIo instance.
Av | avaraging for default steps (0 to 16, defaults to 0) |
OpD | open delay for default steps (0 to 0x3FFFF, defaults to 0x98) |
SaD | sample delay for default steps (0 to 255, defaults to 0) |
Pru | number of PRU subsystem to use (0 or 1, defaults to 1) |
This function wraps the constructor, check PruIo::PruIo() for details.
Since the constructor reads the original devices configurations and the destructor restores them, it's recommended to create and use just one PruIo instance at the same time.
void pruio_destroy | ( | PruIo * | Io) |
C wrapper to destroy a PruIo instance.
Io | The pointer of the instance. |
This function wraps the destructor, check PruIo::~PruIo() for details. (Doxygen should create a link here?!)
C wrapper for function PruIo::config().
Io | The pointer of the PruIo instance |
Samp | number of samples to fetch (defaults to zero) |
Mask | mask for active steps (defaults to all 8 channels active in steps 1 to 8) |
Tmr | timer value in [ns] to specify the sampling rate (defaults to zero, MM only) |
Mds | modus for output (defaults to 4 = 16 bit) |
ClDv | divisor for ADC input clock (defaults to 0 = full speed = 2.4 MHz) |
This function wraps the member function config, check PruIo::config() for details.
C wrapper for function PruIo::adc_step().
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) |
This function wraps the member function adc_step, check PruIo::adc_step() for details.
C wrapper for function PruIo::gpio_get_config().
Io | The pointer of the PruIo instance |
Ball | the CPU ball number to describe |
This function wraps the member function gpio_get_config, check PruIo::gpio_get_config() for details.
C wrapper for function PruIo::gpio_set().
Io | The pointer of the PruIo instance |
Ball | the CPU ball number to set |
Modus | the mode for the GPIO |
Lokk | the locking specification |
This function wraps the member function gpio_set, check PruIo::gpio_set() for details.
C wrapper for function PruIo::gpio_get().
Io | The pointer of the PruIo instance |
Ball | the CPU ball number to test |
This function wraps the member function gpio_get, check PruIo::gpio_get() for details.
C wrapper for function PruIo::gpio_out().
Io | The pointer of the PruIo instance |
Ball | the CPU ball number to test |
Modus | the state to set (0 = low, high otherwise) |
This function wraps the member function gpio_out, check PruIo::gpio_out() for details.
C wrapper for function PruIo::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) |
This function wraps the member function mm_trg_pin, check PruIo::mm_trg_pin() for details.
C wrapper for function PruIo::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) |
This function wraps the member function mm_trg_ain, check PruIo::mm_trg_ain() for details.
C wrapper for function PruIo::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 |
This function wraps the member function mm_trg_pre, check PruIo::mm_trg_pre() for details.
C wrapper for function 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) |
This function wraps the member function mm_start, check PruIo::mm_start() for details.