libpruio  0.6.8
Fast and easy Digital/Analog Input/Output for Beaglebones
analyse.bas File Reference

Example: analyse the subsystems configurations. More...

#include "BBB/pruio.bi"
#include "BBB/pruio_boardpins.bi"
Include dependency graph for analyse.bas:

Go to the source code of this file.

Macros

#define OUT_TYPE   /* Init ' alternative: Conf */
 The type of the output (either Init or Conf).
 
#define REG(_R_)   /* RIGHT(" " & #_R_, 17) & ": " & HEX(.##_R_, SIZEOF(.##_R_) * 2) */
 Output the context of a single register.
 
#define DEV(_N_)
 Output the start of a set. More...
 
#define BALL_OUT(OUT_TYPE)
 Output the CPU ball configuration. More...
 
#define GPIO_OUT(OUT_TYPE)
 Output the configuration of all GPIO subsystems.
 
#define TIMER_OUT(OUT_TYPE)
 Output the configuration of all TIMER subsystems. More...
 
#define PWMSS_OUT(OUT_TYPE)
 Output the configuration of all PWMSS subsystems.
 
#define ADC_OUT(OUT_TYPE)
 Output the configuration of the ADC subsystem.
 

Functions

int main ()
 

Variables

VAR io = NEW PruIo
 Create a PruIo structure, wakeup subsystems.
 
VAR typ = ""
 Board type.
 
VAR pins = ""
 Array of board specific ball numbers.
 

Detailed Description

Example: analyse the subsystems configurations.

This file contains an example on how to use libpruio to read the configurations of the subsystems (initial and corrent). It creates a PruIo structure containing the data and then prints out in a human-readable form. You may 'borrow' some code for debugging purposes in your code. Find a functional description in section analyse.

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

Compile by: fbc -w all analyse.bas

Since
0.0

Definition in file analyse.bas.

Macro Definition Documentation

◆ BALL_OUT

#define BALL_OUT (   OUT_TYPE)
Value:
/* (multi line FreeBASIC #MACRO)
?!"\nControl Module (DeAd: " & HEX(.OUT_TYPE->DeAd, 8) & ")"
FOR i AS INTEGER = 0 TO UBOUND(.OUT_TYPE->Value)
?" " & *.get_config(i)
NEXT
#ENDMACRO */

Output the CPU ball configuration.

Definition at line 35 of file analyse.bas.

◆ DEV

#define DEV (   _N_)
Value:
/* !"\n" & _N_ & _
" (DeAd: " & HEX(.DeAd, 8) & _
", ClAd: " & HEX(.ClAd, 8) & _
", ClVa: " & HEX(.ClVa, 8) & ")" */

Output the start of a set.

Definition at line 32 of file analyse.bas.

◆ TIMER_OUT

#define TIMER_OUT (   OUT_TYPE)
Value:
/* (multi line FreeBASIC #MACRO)
FOR n AS INTEGER = 0 TO UBOUND(.TimSS->OUT_TYPE)
WITH *.TimSS->OUT_TYPE(n)
?DEV("TIMER-" & 4 + n)
?REG(TIDR)
IF 0 = .ClAd THEN ?" --> subsystem not handled " & *IIF(.TIDR, @"(is up)", @"(is down)") : CONTINUE FOR
IF 0 = .TIDR THEN ?" --> wake up failed" : CONTINUE FOR
?REG(TIOCP_CFG)
?REG(IRQ_EOI)
?REG(IRQSTATUS_RAW)
?REG(IRQSTATUS)
?REG(IRQENABLE_SET)
?REG(IRQENABLE_CLR)
?REG(IRQWAKEEN)
?REG(TCLR)
?REG(TCRR)
?REG(TLDR)
?REG(TTGR)
?REG(TWPS)
?REG(TMAR)
?REG(TCAR1)
?REG(TSICR)
?REG(TCAR2)
END WITH
NEXT
#ENDMACRO */

Output the configuration of all TIMER subsystems.

Definition at line 41 of file analyse.bas.

Function Documentation

◆ main()

int main ( )

The main function.

Definition at line 85 of file analyse.bas.

Here is the call graph for this function: