libpruio  0.6.8
Fast and easy Digital/Analog Input/Output for Beaglebones
pruio.h
Go to the documentation of this file.
1 
25 #ifdef __cplusplus
26  extern "C" {
27 #endif /* __cplusplus */
28 
29 // common declarations
30 #include "pruio.hp"
31 
33 #define PRUIO_VERSION "0.6.6"
34 
35 //#include "../pruio/pruio.bi" (transformed)
36 typedef signed char int8;
37 typedef short int16;
38 typedef int int32;
39 typedef unsigned char uint8;
40 typedef unsigned short uint16;
41 typedef unsigned int uint32;
42 typedef float float_t;
43 
45 typedef struct pruIo pruIo;
46 
47 //#include "pruio_adc.h"
49 #define PRUIO_DEF_AVRAGE 4
51 #define PRUIO_DEF_ODELAY 183
53 #define PRUIO_DEF_SDELAY 0
55 #define PRUIO_DEF_SAMPLS 1
57 #define PRUIO_DEF_STPMSK 510 // &b111111110
59 #define PRUIO_DEF_TIMERV 0
61 #define PRUIO_DEF_LSLMOD 4
63 #define PRUIO_DEF_CLKDIV 0
64 
69 struct adcSteps{
70  uint32
73 };
74 
79 typedef struct adcSet{
80  uint32
81  DeAd,
82  ClAd,
83  ClVa;
84 
85  uint32
95  CTRL,
102 
104  struct adcSteps St_p[16 + 1];
105 
106  uint32
114 
119 typedef struct adcUdt{
121  adcSet
122  *Init,
123  *Conf;
124  uint32
128  uint16
131  uint16
132  *Value;
134 
135 //#include "pruio_gpio.h"
140 typedef struct gpioSet{
141  uint32
145 
146  uint32
149  EOI,
162  OE,
174 
179 typedef struct gpioArr{
180  uint32
182  uint32
185  Mix;
187 
188 
193 typedef struct gpioUdt{
195  gpioSet
198  gpioArr
200  uint32
203  uint8
206  Fe1,
207  Fe2;
209 
210 
211 
212 
213 //#include "pruio_timer.bi"
218 typedef struct timerSet{
219  uint32
223 
224  uint32
233  , TCLR
234  , TCRR
235  , TLDR
236  , TTGR
237  , TWPS
238  , TMAR
239  , TCAR1
240  , TSICR
241  , TCAR2;
243 
244 
249 typedef struct timerArr{
250  uint32
252 
253  uint32
255  , TCAR1
256  , TCAR2;
258 
259 
264 typedef struct timerUdt{
266  timerSet
269  timerArr
271  uint32
278  char*
279  E0
280  , E1
281  , E2;
283 
284 
285 //#include "pruio_pwm.bi"
290 typedef struct pwmssSet{
291  uint32
295 
296  uint32
301 
302  uint32
309  uint16
316  uint32
318 
319  uint32
329  uint16
346  uint32
348 
349  uint16
356 
361 
366 
370 
377 
383 
385 
388 
389 
394 typedef struct pwmssArr{
395  uint32
397  uint32
399  , C1
400  , C2
401  , QPos
402  , NPos
403  , OPos
404  , PLat;
406 
407 
412 typedef struct pwmssUdt{
414  pwmssSet
417  pwmssArr
420  const uint16
422  , CapMod;
424 
425 
430 typedef struct pwmMod{
432  uint16
435  , AqCtl[1 + 1][PRUIO_AZ_PWMSS + 1][2 + 1];
436  char
437  *E0
438  , *E1
439  , *E2
440  , *E3
441  , *E4;
443 
448 typedef struct capMod capMod;
449 
454 typedef struct qepMod{
456  float_t
459  uint32
461  char
462  *E0
463  , *E1
464  , *E2;
466 
467 
468 // PRUSS driver interrupt settings
469 #include "pruio_intc.h"
470 
475 enum BBTypes{
476  BBB2x46 = 0,
477  PBB2x36 = 1,
478  BB_Blue = 2
479 };
480 
487  PRUIO_NO_PULL = 1 << 3,
488  PRUIO_PULL_UP = 1 << 4,
489  PRUIO_RX_ACTIV = 1 << 5,
495  PRUIO_PIN_RESET = 0xFF
496 };
497 
503  AIN0 = 1 << 1
504 , AIN1 = 1 << 2
505 , AIN2 = 1 << 3
506 , AIN3 = 1 << 4
507 , AIN4 = 1 << 5
508 , AIN5 = 1 << 6
509 , AIN6 = 1 << 7
510 , AIN7 = 1 << 8
511 };
512 
518  PRUIO_ACT_PRU1 = 1
519 , PRUIO_ACT_ADC = 1 << 1
520 , PRUIO_ACT_GPIO0 = 1 << 2
521 , PRUIO_ACT_GPIO1 = 1 << 3
522 , PRUIO_ACT_GPIO2 = 1 << 4
523 , PRUIO_ACT_GPIO3 = 1 << 5
524 , PRUIO_ACT_PWM0 = 1 << 6
525 , PRUIO_ACT_PWM1 = 1 << 7
526 , PRUIO_ACT_PWM2 = 1 << 8
527 , PRUIO_ACT_TIM4 = 1 << 9
528 , PRUIO_ACT_TIM5 = 1 << 10
529 , PRUIO_ACT_TIM6 = 1 << 11
530 , PRUIO_ACT_TIM7 = 1 << 12
531 , PRUIO_DEF_ACTIVE = 0x1FFF
532 , PRUIO_ACT_FREMUX = 0xFFF8
533 };
534 
535 
540 typedef struct ballSet{
541  uint32
545 
550 typedef struct pruIo{
551  char* Errr;
552 
561 
563  ballSet
564  *Init,
565  *Conf;
566  void
567  *ERam,
568  *DInit,
569  *DConf,
570  *MOffs;
571  uint8
574  uint32
582  int16
585  uint32
588  char
590  (*setPin)(pruIo*, uint8, uint8);
595  uint32 WaitCycles;
596 } pruIo;
597 
611 pruIo* pruio_new(uint16 Act, uint8 Av, uint32 OpD, uint8 SaD);
612 
619 
630 char* pruio_config(pruIo* Io, uint32 Samp, uint32 Mask, uint32 Tmr, uint16 Mds);
631 
639 char* pruio_Pin(pruIo* Io, uint8 Ball);
640 
651 char* pruio_mm_start(pruIo* Io, uint32 Trg1, uint32 Trg2, uint32 Trg3, uint32 Trg4);
652 
660 
661 
670 char* pruio_gpio_config(pruIo* Io, uint8 Ball, uint8 Modus);
671 
680 char* pruio_gpio_setValue(pruIo* Io, uint8 Ball, uint8 Modus);
681 
689 char* pruio_gpio_flush(pruIo* Io, uint8 Indx);
690 
699 
700 
712 char* pruio_adc_setStep(pruIo* Io, uint8 Stp, uint8 ChN, uint8 Av, uint8 SaD, uint32 OpD);
713 
724 
725 
737 
749 
750 
762 char* pruio_qep_config(pruIo* Io, uint8 Ball, uint32 PMax, float_t VHz, float_t Scale, uint8 Mo);
763 
773 char* pruio_qep_Value(pruIo* Io, uint8 Ball, uint32* Posi, float_t* Velo);
774 
775 
784 char* pruio_cap_config(pruIo* Io, uint8 Ball, float_t FLow);
785 
795 char* pruio_cap_Value(pruIo* Io, uint8 Ball, float_t* Hz, float_t* Du);
796 
797 
807 char* pruio_pwm_Value(pruIo* Io, uint8 Ball, float_t* Hz, float_t* Du);
808 
818 char* pruio_pwm_setValue(pruIo* Io, uint8 Ball, float_t Hz, float_t Du);
819 
829 char* pruio_tim_Value(pruIo* Io, uint8 Ball, float_t* Dur1, float_t* Dur2);
830 
841 char* pruio_tim_setValue(pruIo* Io, uint8 Ball, float_t Dur1, float_t Dur2, uint16 Mode);
842 
843 #ifdef __cplusplus
844  }
845 #endif /* __cplusplus */
UDT for PWM modules, containing the functions to drive the hardware.
Definition: pruio_pwmss.bi:239
struct pwmssArr pwmssArr
Wrapper structure for PwmssArr.
unsigned short uint16
16 bit unsigned integer data type.
Definition: pruio.h:40
BBTypes
Wrapper enumerators for board types.
Definition: pruio.h:475
@ BB_Blue
Beaglebone Blue with connectors, SD.
Definition: pruio.h:478
@ PBB2x36
PocketBeagle board with 2x36 headers, SD.
Definition: pruio.h:477
@ BBB2x46
Classic Beaglebone board with 2x46 headers, JT, SD.
Definition: pruio.h:476
struct pwmssSet pwmssSet
Wrapper structure for PwmssSet.
struct timerSet timerSet
Wrapper structure for TimerSet.
unsigned int uint32
32 bit unsigned integer data type.
Definition: pruio.h:41
signed char int8
8 bit signed integer data type.
Definition: pruio.h:36
struct gpioUdt gpioUdt
Wrapper structure for GpioUdt.
char * pruio_config(pruIo *Io, uint32 Samp, uint32 Mask, uint32 Tmr, uint16 Mds)
Wrapper function for PruIo::config().
char * pruio_mm_start(pruIo *Io, uint32 Trg1, uint32 Trg2, uint32 Trg3, uint32 Trg4)
Wrapper function for PruIo::mm_start().
uint32 pruio_adc_mm_trg_pre(pruIo *Io, uint8 Stp, int32 AdcV, uint16 Samp, uint8 Rela)
Wrapper function for AdcUdt::mm_trg_pre().
char * pruio_gpio_flush(pruIo *Io, uint8 Indx)
Wrapper function for GpioUdt::flush().
char * pruio_cap_Value(pruIo *Io, uint8 Ball, float_t *Hz, float_t *Du)
Wrapper function for CapMod::Value().
float float_t
float data type.
Definition: pruio.h:42
uint32 pruio_adc_mm_trg_ain(pruIo *Io, uint8 Stp, int32 AdcV, uint8 Rela, uint16 Skip)
Wrapper function for AdcUdt::mm_trg_ain().
short int16
16 bit signed integer data type.
Definition: pruio.h:37
char * pruio_tim_Value(pruIo *Io, uint8 Ball, float_t *Dur1, float_t *Dur2)
Wrapper function for TimerUdt::Value().
struct adcUdt adcUdt
Wrapper structure for AdcUdt.
struct capMod capMod
Wrapper structure for CapMod.
Definition: pruio.h:448
int int32
32 bit signed integer data type.
Definition: pruio.h:38
struct ballSet ballSet
Wrapper structure for BallSet.
char * pruio_pwm_setValue(pruIo *Io, uint8 Ball, float_t Hz, float_t Du)
Wrapper function for PwmMod::setValue().
struct gpioSet gpioSet
Wrapper structure for GpioSet.
char * pruio_Pin(pruIo *Io, uint8 Ball)
Wrapper function for PruIo::Pin().
struct pwmssUdt pwmssUdt
Wrapper structure for PwmssUdt.
uint32 pruio_gpio_Value(pruIo *Io, uint8 Ball)
Wrapper function for GpioUdt::Value().
pruIo * pruio_new(uint16 Act, uint8 Av, uint32 OpD, uint8 SaD)
Wrapper function for the constructor PruIo::PruIo().
adcStepmask
Wrapper enumerators for AdcStepMask.
Definition: pruio.h:502
@ AIN5
Activate Step 6 (default config: AIN5)
Definition: pruio.h:508
@ AIN2
Activate Step 3 (default config: AIN2)
Definition: pruio.h:505
@ AIN4
Activate Step 5 (default config: AIN4)
Definition: pruio.h:507
@ AIN7
Activate Step 8 (default config: AIN7)
Definition: pruio.h:510
@ AIN0
Activate Step 1 (default config: AIN0)
Definition: pruio.h:503
@ AIN6
Activate Step 7 (default config: AIN6)
Definition: pruio.h:509
@ AIN3
Activate Step 4 (default config: AIN3)
Definition: pruio.h:506
@ AIN1
Activate Step 2 (default config: AIN1)
Definition: pruio.h:504
struct timerArr timerArr
Wrapper structure for TimerArr.
struct timerUdt timerUdt
Wrapper structure for TimerUdt.
char * pruio_qep_config(pruIo *Io, uint8 Ball, uint32 PMax, float_t VHz, float_t Scale, uint8 Mo)
Wrapper function for QepMod::config().
pinMuxing
Wrapper enumerators for PinMuxing.
Definition: pruio.h:485
@ PRUIO_GPIO_OUT1
GPIO output high (no resistor).
Definition: pruio.h:491
@ PRUIO_GPIO_IN
GPIO input (no resistor).
Definition: pruio.h:492
@ PRUIO_NO_PULL
No resistor connected (&b001000).
Definition: pruio.h:487
@ PRUIO_PULL_UP
Pullup resistor connected (&b010000).
Definition: pruio.h:488
@ PRUIO_RX_ACTIV
Input receiver enabled (&b100000).
Definition: pruio.h:489
@ PRUIO_PULL_DOWN
Pulldown resistor connected (&b000000).
Definition: pruio.h:486
@ PRUIO_GPIO_IN_0
GPIO input (pulldown resistor).
Definition: pruio.h:493
@ PRUIO_GPIO_IN_1
GPIO input (pullup resistor).
Definition: pruio.h:494
@ PRUIO_GPIO_OUT0
GPIO output low (no resistor).
Definition: pruio.h:490
char * pruio_cap_config(pruIo *Io, uint8 Ball, float_t FLow)
Wrapper function for CapMod::config().
struct qepMod qepMod
Wrapper structure for QepMod.
char * pruio_pwm_Value(pruIo *Io, uint8 Ball, float_t *Hz, float_t *Du)
Wrapper function for PwmMod::Value().
struct pruIo pruIo
forward declaration
Definition: pruio.h:45
struct adcSet adcSet
Wrapper structure for AdcSet.
char * pruio_adc_setStep(pruIo *Io, uint8 Stp, uint8 ChN, uint8 Av, uint8 SaD, uint32 OpD)
Wrapper function for AdcUdt::setStep().
char * pruio_gpio_config(pruIo *Io, uint8 Ball, uint8 Modus)
Wrapper function for GpioUdt::config().
struct gpioArr gpioArr
Wrapper structure for GpioArr.
char * pruio_qep_Value(pruIo *Io, uint8 Ball, uint32 *Posi, float_t *Velo)
Wrapper function for QepMod::Value().
char * pruio_rb_start(pruIo *Io)
Wrapper function for PruIo::rb_start().
void pruio_destroy(pruIo *Io)
Wrapper function for the destructor PruIo::~PruIo().
struct pwmMod pwmMod
Wrapper structure for PwmMod.
unsigned char uint8
8 bit unsigned integer data type.
Definition: pruio.h:39
activateDevice
Wrapper enumerators for ActivateDevice.
Definition: pruio.h:517
@ PRUIO_DEF_ACTIVE
Activate all subsystems.
Definition: pruio.h:531
@ PRUIO_ACT_FREMUX
Activate free LKM muxing.
Definition: pruio.h:532
@ PRUIO_ACT_TIM5
Activate TIMER-5.
Definition: pruio.h:528
@ PRUIO_ACT_GPIO0
Activate GPIO-0.
Definition: pruio.h:520
@ PRUIO_ACT_GPIO2
Activate GPIO-2.
Definition: pruio.h:522
@ PRUIO_ACT_GPIO3
Activate GPIO-3.
Definition: pruio.h:523
@ PRUIO_ACT_PWM2
Activate PWMSS-2 (including eCAP, eQEP, ePWM).
Definition: pruio.h:526
@ PRUIO_ACT_PWM1
Activate PWMSS-1 (including eCAP, eQEP, ePWM).
Definition: pruio.h:525
@ PRUIO_ACT_TIM7
Activate TIMER-7.
Definition: pruio.h:530
@ PRUIO_ACT_ADC
Activate ADC.
Definition: pruio.h:519
@ PRUIO_ACT_PWM0
Activate PWMSS-0 (including eCAP, eQEP, ePWM).
Definition: pruio.h:524
@ PRUIO_ACT_TIM4
Activate TIMER-4.
Definition: pruio.h:527
@ PRUIO_ACT_TIM6
Activate TIMER-6.
Definition: pruio.h:529
@ PRUIO_ACT_GPIO1
Activate GPIO-1.
Definition: pruio.h:521
@ PRUIO_ACT_PRU1
Activate PRU-1 (= default, instead of PRU-0).
Definition: pruio.h:518
char * pruio_gpio_setValue(pruIo *Io, uint8 Ball, uint8 Modus)
Wrapper function for GpioUdt::setValue().
uint32 pruio_adc_mm_trg_pin(pruIo *Io, uint8 Ball, uint8 GpioV, uint16 Skip)
Wrapper function for AdcUdt::mm_trg_pin().
char * pruio_tim_setValue(pruIo *Io, uint8 Ball, float_t Dur1, float_t Dur2, uint16 Mode)
Wrapper function for TimerUdt::setValue().
This file synchronizes parameters between FreeBASIC, C and PASM source code.
#define PRUIO_AZ_GPIO
The number of GPIO subsystems (minus one)
Definition: pruio.hp:112
#define PRUIO_AZ_PWMSS
The number of PWM subsystems (minus one)
Definition: pruio.hp:113
#define PRUIO_AZ_BALL
The number of CPU balls to handle (minus one)
Definition: pruio.hp:111
C header file for interrupt controller defines.
#define VHz
The frequency for speed measurement.
Definition: qep.c:30
Init data structure for the interrupt controller setting.
Definition: pruio_intc.h:98
Wrapper structure for AdcSet.
Definition: pruio.h:79
uint32 IDLECONFIG
Register at offset 58h (chap. 12.5.1.16).
Definition: pruio.h:101
uint32 ClAd
Clock address.
Definition: pruio.h:82
uint32 REVISION
Register at offset 00h (chap. 12.5.1.1).
Definition: pruio.h:86
uint32 FIFO1THRESHOLD
Register at offset F4h (chap. 12.5.1.55).
Definition: pruio.h:111
uint32 ADCSTAT
Register at offset 44h (chap. 12.5.1.11).
Definition: pruio.h:96
uint32 SYSCONFIG
Register at offset 10h (chap. 12.5.1.2).
Definition: pruio.h:87
uint32 IRQSTATUS_RAW
Register at offset 24h (chap. 12.5.1.3).
Definition: pruio.h:88
uint32 DMA1REQ
Register at offset F8h (chap. 12.5.1.56).
Definition: pruio.h:112
uint32 DMAENABLE_CLR
Register at offset 3Ch (chap. 12.5.1.9).
Definition: pruio.h:94
uint32 CTRL
Register at offset 40h (chap. 12.5.1.10).
Definition: pruio.h:95
uint32 ClVa
Clock value.
Definition: pruio.h:83
uint32 ADC_CLKDIV
Register at offset 4Ch (chap. 12.5.1.13).
Definition: pruio.h:98
uint32 FIFO1COUNT
Register at offset F0h (chap. 12.5.1.54).
Definition: pruio.h:110
uint32 DMAENABLE_SET
Register at offset 38h (chap. 12.5.1.8).
Definition: pruio.h:93
uint32 ADC_MISC
Register at offset 50h (chap. 12.5.1.14).
Definition: pruio.h:99
uint32 STEPENABLE
Register at offset 54h (chap. 12.5.1.15).
Definition: pruio.h:100
struct adcSteps St_p[16+1]
step configuration (chap. 12.5.1.16 ff, charge step + 16 steps, by default steps 1 to 8 are used for ...
Definition: pruio.h:104
uint32 IRQSTATUS
Register at offset 28h (chap. 12.5.1.4).
Definition: pruio.h:89
uint32 DeAd
Subsystem address.
Definition: pruio.h:81
uint32 ADCRANGE
Register at offset 48h (chap. 12.5.1.12).
Definition: pruio.h:97
uint32 DMA0REQ
Register at offset ECh (chap. 12.5.1.53).
Definition: pruio.h:109
uint32 IRQENABLE_SET
Register at offset 2Ch (chap. 12.5.1.5).
Definition: pruio.h:90
uint32 IRQENABLE_CLR
Register at offset 30h (chap. 12.5.1.6).
Definition: pruio.h:91
uint32 IRQWAKEUP
Register at offset 34h (chap. 12.5.1.7).
Definition: pruio.h:92
uint32 FIFO0COUNT
Register at offset E4h (chap. 12.5.1.51).
Definition: pruio.h:107
uint32 FIFO0THRESHOLD
Register at offset E8h (chap. 12.5.1.52).
Definition: pruio.h:108
Wrapper structure for AdcSteps.
Definition: pruio.h:69
uint32 Confg
Context for configuration register.
Definition: pruio.h:71
uint32 Delay
Context for delay register.
Definition: pruio.h:72
Wrapper structure for AdcUdt.
Definition: pruio.h:119
uint32 Samples
Number of samples (specifies run mode: 0 = config, 1 = IO mode, >1 = MM mode).
Definition: pruio.h:125
uint16 ChAz
The number of active steps.
Definition: pruio.h:130
uint32 TimerVal
Timer value in [ns].
Definition: pruio.h:126
uint16 * Value
Fetched ADC samples.
Definition: pruio.h:132
adcSet * Conf
Current subsystem configuration, used in PruIo::config().
Definition: pruio.h:123
pruIo * Top
Pointer to the calling PruIo instance.
Definition: pruio.h:120
uint32 InitParA
Offset to read data block offset.
Definition: pruio.h:127
uint16 LslMode
Bit shift modus (0 to 4, for 12 to 16 bits).
Definition: pruio.h:129
adcSet * Init
Initial subsystem configuration, used in the destructor PruIo::~PruIo().
Definition: pruio.h:122
Wrapper structure for BallSet.
Definition: pruio.h:540
uint32 DeAd
Base address of Control Module subsystem.
Definition: pruio.h:542
uint8 Value[PRUIO_AZ_BALL+1]
The values of the pad control registers.
Definition: pruio.h:543
Wrapper structure for GpioArr.
Definition: pruio.h:179
uint32 DeAd
Base address of GPIO subsystem + 0x100.
Definition: pruio.h:181
uint32 Mix
Current state of pins (IN&OUT mixed).
Definition: pruio.h:185
uint32 DATAIN
Current Value of DATAIN register (IO).
Definition: pruio.h:183
uint32 DATAOUT
Current Value of DATAOUT register (IO).
Definition: pruio.h:184
Wrapper structure for GpioSet.
Definition: pruio.h:140
uint32 ClAd
Clock address.
Definition: pruio.h:143
uint32 SYSCONFIG
Register at offset 10h (chap. 25.4.1.2).
Definition: pruio.h:148
uint32 IRQSTATUS_CLR_0
Register at offset 3Ch (chap. 25.4.1.10).
Definition: pruio.h:156
uint32 DEBOUNCINGTIME
Register at offset 154h (chap. 25.4.1.24).
Definition: pruio.h:170
uint32 EOI
Register at offset 20h (chap. 25.4.1.3).
Definition: pruio.h:149
uint32 DEBOUNCENABLE
Register at offset 150h (chap. 25.4.1.23).
Definition: pruio.h:169
uint32 CLEARDATAOUT
Register at offset 190h (chap. 25.4.1.25).
Definition: pruio.h:171
uint32 DATAIN
Register at offset 138h (chap. 25.4.1.17).
Definition: pruio.h:163
uint32 CTRL
Register at offset 130h (chap. 25.4.1.15).
Definition: pruio.h:161
uint32 LEVELDETECT1
Register at offset 144h (chap. 25.4.1.20).
Definition: pruio.h:166
uint32 IRQSTATUS_SET_0
Register at offset 34h (chap. 25.4.1.8).
Definition: pruio.h:154
uint32 IRQWAKEN_0
Register at offset 44h (chap. 25.4.1.12).
Definition: pruio.h:158
uint32 IRQWAKEN_1
Register at offset 48h (chap. 25.4.1.13).
Definition: pruio.h:159
uint32 IRQSTATUS_SET_1
Register at offset 38h (chap. 25.4.1.9).
Definition: pruio.h:155
uint32 FALLINGDETECT
Register at offset 14Ch (chap. 25.4.1.22).
Definition: pruio.h:168
uint32 IRQSTATUS_CLR_1
Register at offset 40h (chap. 25.4.1.11).
Definition: pruio.h:157
uint32 ClVa
Clock value.
Definition: pruio.h:144
uint32 LEVELDETECT0
Register at offset 140h (chap. 25.4.1.19).
Definition: pruio.h:165
uint32 SETDATAOUT
Register at offset 194h (chap. 25.4.1.26).
Definition: pruio.h:172
uint32 RISINGDETECT
Register at offset 148h (chap. 25.4.1.21).
Definition: pruio.h:167
uint32 IRQSTATUS_0
Register at offset 2Ch (chap. 25.4.1.6).
Definition: pruio.h:152
uint32 DeAd
Subsystem address.
Definition: pruio.h:142
uint32 IRQSTATUS_1
Register at offset 30h (chap. 25.4.1.7).
Definition: pruio.h:153
uint32 SYSSTATUS
Register at offset 114h (chap. 25.4.1.14).
Definition: pruio.h:160
uint32 DATAOUT
Register at offset 13Ch (chap. 25.4.1.18).
Definition: pruio.h:164
uint32 IRQSTATUS_RAW_1
Register at offset 28h (chap. 25.4.1.5).
Definition: pruio.h:151
uint32 OE
Register at offset 134h (chap. 25.4.1.16).
Definition: pruio.h:162
uint32 REVISION
Register at offset 00h (chap. 25.4.1.1).
Definition: pruio.h:147
uint32 IRQSTATUS_RAW_0
Register at offset 24h (chap. 25.4.1.4).
Definition: pruio.h:150
Wrapper structure for GpioUdt.
Definition: pruio.h:193
gpioSet * Conf[PRUIO_AZ_GPIO+1]
Current subsystem configuration, used in PruIo::config().
Definition: pruio.h:197
uint32 Mask
The bit mask to manipulate.
Definition: pruio.h:202
uint8 Mode
The mode for pinmuxing.
Definition: pruio.h:204
uint8 Fe2
Future expansion.
Definition: pruio.h:207
uint8 Indx
The GPIO subsystem index.
Definition: pruio.h:205
gpioArr * Raw[PRUIO_AZ_GPIO+1]
Pointer to current raw subsystem data (IO), all 32 bits.
Definition: pruio.h:199
uint8 Fe1
Future expansion.
Definition: pruio.h:206
pruIo * Top
pointer to the calling PruIo instance
Definition: pruio.h:194
uint32 InitParA
Offset to read data block offset.
Definition: pruio.h:201
gpioSet * Init[PRUIO_AZ_GPIO+1]
Initial subsystem configuration, used in the destructor PruIo::~PruIo().
Definition: pruio.h:196
Wrapper structure for PruIo.
Definition: pruio.h:550
void * MOffs
Configuration offset for modules.
Definition: pruio.h:570
int16 ParOffs
The offset for the parameters of a module.
Definition: pruio.h:583
capMod * Cap
Pointer to eCAP module structure (in PWMSS subsystem).
Definition: pruio.h:558
uint32 PruNo
The PRU number to use (defaults to 1).
Definition: pruio.h:578
uint32 EAddr
The address of the external memory (PRUSS-DDR).
Definition: pruio.h:575
uint32 ESize
The size of the external memory (PRUSS-DDR).
Definition: pruio.h:576
char * MuxAcc
pathfile for dtbo pinmuxing
Definition: pruio.h:589
uint8 * BallInit
Pointer for original Ball configuration.
Definition: pruio.h:572
struct __pruss_intc_initdata * IntcInit
Interrupt settings (we also set default interrupts, so that the other PRUSS can be used in parallel).
Definition: pruio.h:594
char * Errr
Pointer for error messages.
Definition: pruio.h:551
uint32 PruIRam
The PRU instruction ram to load.
Definition: pruio.h:579
pwmMod * Pwm
Pointer to ePWM module structure (in PWMSS subsystem).
Definition: pruio.h:557
uint8 BallGpio[PRUIO_AZ_BALL+1]
List of GPIO numbers, corresponding to ball index.
Definition: pruio.h:592
uint8 * BallConf
Pointer to ball configuration (CPU pin muxing).
Definition: pruio.h:573
pwmssUdt * PwmSS
Pointer to PWMSS subsystem structure.
Definition: pruio.h:555
qepMod * Qep
pointer to eQEP module structure (in PWMSS subsystem)
Definition: pruio.h:559
uint32 * DRam
Pointer to access PRU DRam.
Definition: pruio.h:562
timerUdt * Tim
Pointer to the TimSS structure (for homogenous API).
Definition: pruio.h:560
int16 DevAct
Active subsystems.
Definition: pruio.h:584
uint32 PruDRam
The PRU data ram.
Definition: pruio.h:580
uint32 PruIntNo
The PRU interrupt number.
Definition: pruio.h:581
timerUdt * TimSS
Pointer to TIMER subsystem structure.
Definition: pruio.h:556
gpioUdt * Gpio
Pointer to GPIO subsystem structure.
Definition: pruio.h:554
ballSet * Conf
The subsystems register data used by libpruio (current local data).
Definition: pruio.h:565
uint32 BbType
Type of Beaglebone board (1 = Pocket-, 0 = others)
Definition: pruio.h:586
adcUdt * Adc
Pointer to ADC subsystem structure.
Definition: pruio.h:553
uint32 MuxFnr
FreeBASIC file number for LKM pinmuxing.
Definition: pruio.h:587
void * ERam
Pointer to read PRU external ram.
Definition: pruio.h:567
void * DConf
Pointer to block of subsystems configuration data.
Definition: pruio.h:569
ballSet * Init
The subsystems register data at start-up (to restore subsystems at the end).
Definition: pruio.h:564
void * DInit
Pointer to block of subsystems initial data.
Definition: pruio.h:568
uint32 DSize
The size of a data block (DInit or DConf).
Definition: pruio.h:577
Wrapper structure for PwmMod.
Definition: pruio.h:430
uint16 AqCtl[1+1][PRUIO_AZ_PWMSS+1][2+1]
Initializers for Action Qualifier for ePWM modules (see PWM).
Definition: pruio.h:435
uint16 ForceUpDown
< Switch to force up-down counter for ePWM modules.
Definition: pruio.h:434
char * E0
< Common error message.
Definition: pruio.h:438
char * E3
< Common error message.
Definition: pruio.h:441
pruIo * Top
pointer to the calling PruIo instance
Definition: pruio.h:431
char * E4
Common error message.
Definition: pruio.h:441
uint16 Cntrl[PRUIO_AZ_PWMSS+1]
< Initializers TBCTL register for ePWM modules (see PWM).
Definition: pruio.h:435
char * E2
< Common error message.
Definition: pruio.h:440
char * E1
< Common error message.
Definition: pruio.h:439
Wrapper structure for PwmssArr.
Definition: pruio.h:394
uint32 NPos
< New position latch (QEP).
Definition: pruio.h:403
uint32 C2
< Period time counter value (CAP).
Definition: pruio.h:401
uint32 PLat
New period timer latch (QEP).
Definition: pruio.h:404
uint32 C1
< On time counter value (CAP).
Definition: pruio.h:400
uint32 CMax
< Maximum counter value (CAP).
Definition: pruio.h:399
uint32 DeAd
Subsystem address.
Definition: pruio.h:396
uint32 QPos
< Current position counter (QEP).
Definition: pruio.h:402
uint32 OPos
< Old position latch (QEP).
Definition: pruio.h:404
Wrapper structure for PwmssSet.
Definition: pruio.h:290
uint16 QEPCTL
Control Register (chap. 15.4.3.14).
Definition: pruio.h:333
uint16 ETPS
Event-Trigger Pre-Scale Register.
Definition: pruio.h:379
uint16 DBRED
Dead-Band Generator Rising Edge Delay Count Register.
Definition: pruio.h:368
uint32 ClVa
Clock value.
Definition: pruio.h:294
uint16 CMPAHR
Extension for HRPWM Counter-Compare A Register.
Definition: pruio.h:358
uint16 AQCTLA
Action-Qualifier Control Register for Output A (EPWMxA).
Definition: pruio.h:362
uint16 DBFED
Dead-Band Generator Falling Edge Delay Count Register.
Definition: pruio.h:369
uint16 ETSEL
Event-Trigger Selection Register.
Definition: pruio.h:378
uint16 QCPRDLAT
Capture Period Latch Register (chap. 15.4.3.24).
Definition: pruio.h:344
uint32 DeAd
Subsystem address.
Definition: pruio.h:292
uint16 QDECCTL
Decoder Control Register (chap. 15.4.3.12).
Definition: pruio.h:332
uint16 TZSEL
Trip-Zone Select Register.
Definition: pruio.h:371
uint16 QCAPCTL
Capture Control Register (chap. 15.4.3.15).
Definition: pruio.h:334
uint16 QWDTMR
Watchdog Timer Register (chap. 15.4.3.10).
Definition: pruio.h:330
uint16 AQSFRC
Action-Qualifier Software Force Register.
Definition: pruio.h:364
uint16 AQCTLB
Action-Qualifier Control Register for Output B (EPWMxB).
Definition: pruio.h:363
uint32 QPOSILAT
Index Position Latch Register (chap. 15.4.3.5).
Definition: pruio.h:324
uint32 CAP2
Capture 2 Register (chap. 15.3.4.1.4).
Definition: pruio.h:306
uint32 CAP3
Capture 3 Register (chap. 15.3.4.1.5).
Definition: pruio.h:307
uint32 SYSCONFIG
System Configuration Register (chap. 15.1.3.2).
Definition: pruio.h:298
uint16 ETFLG
Event-Trigger Flag Register.
Definition: pruio.h:380
uint16 TZFRC
Trip-Zone Force Register.
Definition: pruio.h:376
uint16 empty
Adjust at uint32 border.
Definition: pruio.h:345
uint32 IDVER
IP Revision Register (chap. 15.1.3.1).
Definition: pruio.h:297
uint32 QPOSMAX
Maximum Position Count Register (chap. 15.4.3.3).
Definition: pruio.h:322
uint32 QUPRD
Unit Period Register (chap. 15.4.3.9).
Definition: pruio.h:328
uint32 QPOSLAT
Position Counter Latch Register (chap. 15.4.3.7).
Definition: pruio.h:326
uint32 QPOSCNT
Position Counter Register (chap. 15.4.3.1).
Definition: pruio.h:320
uint32 CTRPHS
Counter Phase Offset Value Register (chap. 15.3.4.1.2).
Definition: pruio.h:304
uint16 ECCTL2
Capture Control Register 2 (chap. 15.3.4.1.8).
Definition: pruio.h:311
uint32 ClAd
Clock address.
Definition: pruio.h:293
uint16 QWDPRD
Watchdog Period Register (chap. 15.4.3.11).
Definition: pruio.h:331
uint16 CMPA
Counter-Compare A Register.
Definition: pruio.h:359
uint16 QFRC
Interrupt Force Register (chap. 15.4.3.19).
Definition: pruio.h:339
uint16 QCTMRLAT
Capture Timer Latch Register (chap. 15.4.3.23).
Definition: pruio.h:343
uint16 QPOSCTL
Position-Compare Control Register (chap. 15.4.3.15).
Definition: pruio.h:335
uint16 CMPCTL
Counter-Compare Control Register.
Definition: pruio.h:357
uint16 CMPB
Counter-Compare B Register.
Definition: pruio.h:360
uint16 TBPHSHR
Extension for HRPWM Phase Register.
Definition: pruio.h:352
uint32 TSCTR
Time-Stamp Counter Register (chap. 15.3.4.1.1).
Definition: pruio.h:303
uint16 TZEINT
Trip-Zone Enable Interrupt Register.
Definition: pruio.h:373
uint32 QUTMR
Unit Timer Register (chap. 15.4.3.8).
Definition: pruio.h:327
uint16 PCCTL
PWM-Chopper Control Register.
Definition: pruio.h:384
uint16 ECFRC
Capture Interrupt Force Register (chap. 15.3.4.1.12).
Definition: pruio.h:315
uint16 TBCTL
Time-Base Control Register.
Definition: pruio.h:350
uint16 ECFLG
Capture Interrupt Flag Register (chap. 15.3.4.1.10).
Definition: pruio.h:313
uint16 QCTMR
Capture Timer Register (chap. 15.4.3.21).
Definition: pruio.h:341
uint16 DBCTL
Dead-Band Generator Control Register.
Definition: pruio.h:367
uint16 QEPSTS
Status Register (chap. 15.4.3.20).
Definition: pruio.h:340
uint16 HRCTL
HRPWM Control Register.
Definition: pruio.h:386
uint32 CAP1
Capture 1 Register (chap. 15.3.4.1.3).
Definition: pruio.h:305
uint16 QCLR
Interrupt Clear Register (chap. 15.4.3.18).
Definition: pruio.h:338
uint16 ETFRC
Event-Trigger Force Register.
Definition: pruio.h:382
uint16 ECCLR
Capture Interrupt Clear Register (chap. 15.3.4.1.11).
Definition: pruio.h:314
uint32 CAP_REV
Revision ID Register (chap. 15.3.4.1.13).
Definition: pruio.h:317
uint32 QPOSCMP
Position-Compare Register 2/1 (chap. 15.4.3.4).
Definition: pruio.h:323
uint16 TBSTS
Time-Base Status Register.
Definition: pruio.h:351
uint16 TZCLR
Trip-Zone Clear Register.
Definition: pruio.h:375
uint32 QPOSSLAT
Strobe Position Latch Register (chap. 15.4.3.6).
Definition: pruio.h:325
uint16 TBCNT
Time-Base Counter Register.
Definition: pruio.h:354
uint16 ECEINT
Capture Interrupt Enable Register (chap. 15.3.4.1.9).
Definition: pruio.h:312
uint32 QPOSINIT
Position Counter Initialization Register (chap. 15.4.3.2).
Definition: pruio.h:321
uint16 ETCLR
Event-Trigger Clear Register.
Definition: pruio.h:381
uint16 AQCSFRC
Action-Qualifier Continuous S/W Force Register Set.
Definition: pruio.h:365
uint16 QFLG
Interrupt Flag Register (chap. 15.4.3.17).
Definition: pruio.h:337
uint32 CAP4
Capture 4 Register (chap. 15.3.4.1.6).
Definition: pruio.h:308
uint16 TBPRD
Time-Base Period Register.
Definition: pruio.h:355
uint32 CLKSTATUS
Clock Status Register (chap. 15.1.3.4).
Definition: pruio.h:300
uint16 ECCTL1
Capture Control Register 1 (chap. 15.3.4.1.7).
Definition: pruio.h:310
uint16 QCPRD
Capture Period Register (chap. 15.4.3.22).
Definition: pruio.h:342
uint16 TBPHS
Time-Base Phase Register.
Definition: pruio.h:353
uint16 QEINT
Interrupt Enable Register (chap. 15.4.3.16).
Definition: pruio.h:336
uint32 QEP_REV
Revision ID (chap. 15.4.3.25).
Definition: pruio.h:347
uint16 TZCTL
Trip-Zone Control Register.
Definition: pruio.h:372
uint16 TZFLG
Trip-Zone Flag Register.
Definition: pruio.h:374
uint32 CLKCONFIG
Clock Configuration Register (chap. 15.1.3.3).
Definition: pruio.h:299
Wrapper structure for PwmssUdt.
Definition: pruio.h:412
pwmssSet * Conf[PRUIO_AZ_PWMSS+1]
Current subsystem configuration, used in PruIo::config().
Definition: pruio.h:416
pruIo * Top
pointer to the calling PruIo instance
Definition: pruio.h:413
const uint16 CapMod
Value for ECCTL2 in CAP mode (&b0011010110).
Definition: pruio.h:422
uint32 InitParA
Offset to read data block offset.
Definition: pruio.h:419
pwmssArr * Raw[PRUIO_AZ_PWMSS+1]
Pointer to current raw subsystem data (IO).
Definition: pruio.h:418
pwmssSet * Init[PRUIO_AZ_PWMSS+1]
Initial subsystem configuration, used in the destructor PruIo::~PruIo().
Definition: pruio.h:415
Wrapper structure for QepMod.
Definition: pruio.h:454
float_t FVh[PRUIO_AZ_PWMSS+1]
< Factor for high velocity measurement.
Definition: pruio.h:458
pruIo * Top
pointer to the calling PruIo instance
Definition: pruio.h:455
uint32 Prd[PRUIO_AZ_PWMSS+1]
Period value to switch velocity measurement.
Definition: pruio.h:460
char * E0
< Common error message.
Definition: pruio.h:463
char * E1
< Common error message.
Definition: pruio.h:464
char * E2
Common error message.
Definition: pruio.h:464
float_t FVl[PRUIO_AZ_PWMSS+1]
Factor for low velocity measurement.
Definition: pruio.h:458
Wrapper structure for TimerArr.
Definition: pruio.h:249
uint32 DeAd
Subsystem address.
Definition: pruio.h:251
uint32 CMax
< Maximum counter value.
Definition: pruio.h:255
uint32 TCAR2
Current value of TCRR register (IO, RB).
Definition: pruio.h:256
uint32 TCAR1
< Current value of TCAR2 register (IO, RB).
Definition: pruio.h:256
Wrapper structure for TimerSet.
Definition: pruio.h:218
uint32 IRQWAKEEN
< Timer IRQ Wakeup Enable Register (offset 34h, see ARM Reference Guide, chapter 20....
Definition: pruio.h:233
uint32 TCAR1
< Timer Capture Register (offset 50h, see ARM Reference Guide, chapter 20.1.5.15 ).
Definition: pruio.h:240
uint32 TTGR
< Timer Trigger Register (offset 44h, see ARM Reference Guide, chapter 20.1.5.12 ).
Definition: pruio.h:237
uint32 IRQENABLECLR
< Timer Interrupt Enable Clear Register (offset 30h, see ARM Reference Guide, chapter 20....
Definition: pruio.h:232
uint32 TMAR
< Timer Match Register (offset 4Ch, see ARM Reference Guide, chapter 20.1.5.14 ).
Definition: pruio.h:239
uint32 TWPS
< Timer Write Posting Bits Register (offset 48h, see ARM Reference Guide, chapter 20....
Definition: pruio.h:238
uint32 TCRR
< Timer Counter Register (offset 3Ch, see ARM Reference Guide, chapter 20.1.5.10 ).
Definition: pruio.h:235
uint32 IRQSTATUSRAW
< Timer Status Raw Register (offset 24h, see ARM Reference Guide, chapter 20.1.5.4 ).
Definition: pruio.h:229
uint32 TCLR
< Timer Control Register (offset 38h, see ARM Reference Guide, chapter 20.1.5.9 ).
Definition: pruio.h:234
uint32 TIOCPCFG
< Timer OCP Configuration Register (offset 10h, see ARM Reference Guide, chapter 20....
Definition: pruio.h:227
uint32 DeAd
Subsystem address.
Definition: pruio.h:220
uint32 TSICR
< Timer Synchronous Interface Control Register (offset 54h, see ARM Reference Guide,...
Definition: pruio.h:241
uint32 TLDR
< Timer Load Register (offset 40h, see ARM Reference Guide, chapter 20.1.5.11 ).
Definition: pruio.h:236
uint32 IRQENABLESET
< Timer Interrupt Enable Set Register (offset 2Ch, see ARM Reference Guide, chapter 20....
Definition: pruio.h:231
uint32 IRQEOI
< Timer IRQ End-of-Interrupt Register (offset 20h, see ARM Reference Guide, chapter 20....
Definition: pruio.h:228
uint32 TCAR2
Timer Capture Register (offset 58h, see ARM Reference Guide, chapter 20.1.5.17 ).
Definition: pruio.h:241
uint32 ClAd
Clock address.
Definition: pruio.h:221
uint32 IRQSTATUS
< Timer Status Register (offset 28h, see ARM Reference Guide, chapter 20.1.5.5 ).
Definition: pruio.h:230
uint32 ClVa
Clock value.
Definition: pruio.h:222
uint32 TIDR
< Register at offset 00h (see ARM Reference Guide, chapter 20.1.5.1 ).
Definition: pruio.h:226
Wrapper structure for TimerUdt.
Definition: pruio.h:264
timerSet * Conf[PRUIO_AZ_GPIO+1]
Current subsystem configuration, used in PruIo::config().
Definition: pruio.h:268
uint32 Tim_Low
< Control register for Timer low.
Definition: pruio.h:277
char * E0
< Common error message.
Definition: pruio.h:280
uint32 InitParA
< Offset to read data block offset.
Definition: pruio.h:273
uint32 TimHigh
< Control register for Timer high.
Definition: pruio.h:276
char E2
Common error message.
Definition: pruio.h:281
timerSet * Init[PRUIO_AZ_GPIO+1]
Initial subsystem configuration, used in the destructor PruIo::~PruIo().
Definition: pruio.h:267
uint32 CapMode
Control register for CAP input mode.
Definition: pruio.h:277
timerArr * Raw[PRUIO_AZ_GPIO+1]
Pointer to current raw subsystem data (IO), all 32 bits.
Definition: pruio.h:270
uint32 PwmMode
< Control register for PWM output mode.
Definition: pruio.h:274
char E1
< Common error message.
Definition: pruio.h:281
uint32 TimMode
< Control register for Timer mode.
Definition: pruio.h:275
pruIo * Top
Pointer to the calling PruIo instance.
Definition: pruio.h:265