user defined type (class) for the driver structure More...
#include "pruio_c_wrapper.h"
Public Member Functions | |
PruIo (BYVAL_AS_uint8, BYVAL_AS_uint32, BYVAL_AS_uint8, BYVAL_AS_uint8) | |
Constructor, initialize devices, create default configuration. More... | |
~PruIo () | |
Destructor to restore configurations and clear memory. More... | |
FUNCTION_CDECL_AS_ZSTRING_PTR | config (BYVAL_AS_uint32, BYVAL_AS_uint32, BYVAL_AS_uint32, BYVAL_AS_uint16, BYVAL_AS_uint16) |
Load configuration from host (ARM) to driver (PRU). More... | |
FUNCTION_CDECL_AS_ZSTRING_PTR | adc_step (BYVAL_AS_uint8, BYVAL_AS_uint8, BYVAL_AS_uint8, BYVAL_AS_uint8, BYVAL_AS_uint32) |
Customize a single configuration step. More... | |
FUNCTION_CDECL_AS_uint32 | gpio_get (BYVAL_AS_uint8) |
Get the state of a GPIO. More... | |
FUNCTION_CDECL_AS_ZSTRING_PTR | gpio_set (BYVAL_AS_uint8, BYVAL_AS_uint8, BYVAL_AS_uint8) |
Set the configuration of a GPIO. More... | |
FUNCTION_CDECL_AS_ZSTRING_PTR | gpio_out (BYVAL_AS_uint8, BYVAL_AS_uint8) |
Set the state of a GPIO. More... | |
FUNCTION_CDECL_AS_ZSTRING_PTR | gpio_get_config (BYVAL_AS_uint8) |
Create a text description for a pin configuration. More... | |
FUNCTION_CDECL_AS_uint32 | mm_trg_pin (BYVAL_AS_uint8, BYVAL_AS_uint8, BYVAL_AS_uint16) |
Create a trigger configuration for a digital trigger (GPIO). More... | |
FUNCTION_CDECL_AS_uint32 | mm_trg_ain (BYVAL_AS_uint8, BYVAL_AS_int32, BYVAL_AS_uint8, BYVAL_AS_uint16) |
Create a trigger configuration for an analog input trigger. More... | |
FUNCTION_CDECL_AS_uint32 | mm_trg_pre (BYVAL_AS_uint8, BYVAL_AS_int32, BYVAL_AS_uint16, BYVAL_AS_uint8) |
Create a trigger configuration for an analog input trigger. More... | |
FUNCTION_CDECL_AS_ZSTRING_PTR | mm_start (BYVAL_AS_uint32, BYVAL_AS_uint32, BYVAL_AS_uint32, BYVAL_AS_uint32) |
Start a measurement in MM. More... | |
Public Attributes | |
uint32 | Samples |
number of samples More... | |
uint32 | TimerVal |
timer value in [ns] More... | |
uint32 | StepMask |
mask to specify active channels More... | |
uint16 | LslMode |
bit shift modus (0 to 4) More... | |
uint16 | ClockDiv |
divisor for ADC input clock (register 0x4C) More... | |
uint32 | AdcReg24 = 0 |
< ADC register IRQ_STATUS_RAW More... | |
uint32 | AdcReg28 = 0 |
< ADC register IRQ_STATUS More... | |
uint32 | AdcReg2C = 0 |
< ADC register IRQENABLE_SET More... | |
uint32 | AdcReg30 = 0 |
< ADC register IRQENABLE_CLR More... | |
uint32 | AdcReg34 = 0 |
< ADC register IRQWAKEUP More... | |
uint32 | AdcReg38 = 0 |
< ADC register DMAENABLE_SET More... | |
uint32 | AdcReg3C = 0 |
< ADC register DMAENABLE_CLR More... | |
uint32 | AdcReg40 = 0 |
ADC register CRTL (bits 0, 1 and 2 gets set by driver) More... | |
struct AdcSteps | St_p [17+1] |
step configuration (charge step + 16 steps + idle step, by default steps 1 to 8 are used for AIN0 to AIN7) More... | |
uint32 * | DRam |
pointer to access PRU DRam More... | |
void * | ERam |
pointer to read PRU external ram More... | |
void * | BallOrg |
buffer pointer for original Ball configuration More... | |
uint32 * | AdcOrg |
buffer pointer for original ADC configuration (= 0 in case of ADC down at startup) More... | |
uint32 * | GpioOrg |
buffer pointer for original GPIO configuration More... | |
uint16 * | Value |
pointer to read sampled ADC input data More... | |
uint8 * | BallRef |
pointer to ball reference (GPIO# for CPU pins or lock) More... | |
uint8 * | BallConf |
pointer to ball configuration (CPU pin muxing) More... | |
char * | Errr |
pointer for error messages More... | |
uint32 | EOffs |
the offset of the external PRUSS-DDR More... | |
uint32 | ESize |
the size of the external PRUSS-DDR More... | |
uint32 | CSize |
the size of the original configuration block More... | |
uint32 | PruNo |
the PRU number to use More... | |
uint32 | PruEvtout |
the interrupt channel to send commands to PRU More... | |
uint32 | PruIRam |
the PRU instruction ram to load More... | |
uint32 | PruDRam |
the PRU data ram More... | |
int16 | ArmPruInt |
the interrupt to send More... | |
int16 | ChAz |
number of active channels More... | |
struct __pruss_intc_initdata | IntcInit |
interrupt settings (we also set default interrupts, so that the other PRUSS can be used in parallel) More... | |
struct GpioSet * | Gpio |
pointer to GPIO structure (current values) More... | |
struct GpioSet | GpioInit [PRUIO_GPIO_AZ+1] |
initial GPIO definitions More... | |
uint8 | BallGpio [PRUIO_BALL_AZ+1] |
list of GPIO numbers, corresponding to ball index More... | |
AdcSteps | St_p [17+1] |
step configuration (charge step + 16 steps + idle step, by default steps 1 to 8 are used for AIN0 to AIN7) More... | |
uint32_PTR | DRam |
pointer to access PRU DRam More... | |
ANY_PTR | ERam |
pointer to read PRU external ram More... | |
ANY_PTR | BallOrg |
buffer pointer for original Ball configuration More... | |
uint32_PTR | AdcOrg |
buffer pointer for original ADC configuration (= 0 in case of ADC down at startup) More... | |
uint32_PTR | GpioOrg |
buffer pointer for original GPIO configuration More... | |
uint16_PTR | Value |
pointer to read sampled ADC input data More... | |
uint8_PTR | BallRef |
pointer to ball reference (GPIO# for CPU pins or lock) More... | |
uint8_PTR | BallConf |
pointer to ball configuration (CPU pin muxing) More... | |
ZSTRING_PTR | Errr = 0 |
pointer for error messages More... | |
tpruss_intc_initdata | IntcInit |
interrupt settings (we also set default interrupts, so that the other PRUSS can be used in parallel) More... | |
GpioSet_PTR | Gpio |
GpioSet | GpioInit [PRUIO_GPIO_AZ+1] |
initial GPIO definitions More... | |
user defined type (class) for the driver structure
Definition at line 134 of file pruio_c_wrapper.h.
PruIo::PruIo | ( | BYVAL_AS_uint8 | Av = PRUIO_DEF_AVRAGE , |
BYVAL_AS_uint32 | OpD = PRUIO_DEF_ODELAY , |
||
BYVAL_AS_uint8 | SaD = PRUIO_DEF_SDELAY , |
||
BYVAL_AS_uint8 | Pru = PRUIO_DEF_PRUSS |
||
) |
Constructor, initialize devices, create default configuration.
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) |
The constructor tries to open the PRUSS interrupt and reports an error in case of a failure (the structure should be freed in that case and in case of any other error).
Otherwise the constructor generates valid steps configuration data for all channels (AIN0 to AIN 7 in steps 1 to 8). For these steps, the default values can get customized using the (optional) parameter list:
See ARM Reference Guide, chapter 12 for details on step configuration.
Also, and after executing the constructor, the step configuration can get customized by function PruIo::adc_step().
PruIo::~PruIo | ( | ) |
Destructor to restore configurations and clear memory.
The destructor copies the original configuration to DRam (if any), loads new instructions to the PRU and start them. This PRU code restores the devices GPIOs, Control Module and ADC to their original configurations. Finaly the PRU gets powered off and the memory of the PruIo instance get freed.
The destructor cannot report error messages in member variable PruIo::Errr. Messages (if any) get sent directly to the ERROUT pipe of the operating system instead.
FUNCTION_CDECL_AS_ZSTRING_PTR PruIo::config | ( | BYVAL_AS_uint32 | Samp = PRUIO_DEF_SAMPLS , |
BYVAL_AS_uint32 | Mask = PRUIO_DEF_STPMSK , |
||
BYVAL_AS_uint32 | Tmr = PRUIO_DEF_TIMERV , |
||
BYVAL_AS_uint16 | Mds = PRUIO_DEF_LSLMOD , |
||
BYVAL_AS_uint16 | ClDv = PRUIO_DEF_CLKDIV |
||
) |
Load configuration from host (ARM) to driver (PRU).
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 is used to download the configuration from the host (ARM) to the driver (PRU). The PRU gets stopped (if running) and the new configurations get loaded. Also the PRU instructions get re-initialized.
In case of an error the PRU will be disabled after this call. Otherwise it's running and
The Samp parameter specifies the number of samples to convert for each channel. In single mode (Samp <= 1 = default) sampling starts immediately and the index in the array PruIo::Value[] is equal to the step number. Inactive steps return 0 (zero) in this case.
field | result of | defaults to |
---|---|---|
Value[0] | charge step | allways zero |
Value[1] | step 1 | AIN0 |
Value[2] | step 2 | AIN1 |
... | ... | ... |
In MM (Samp > 1) the array PruIo::Value[] contains no zero values. Instead only values from active steps get collected. The charge step (step 0) returns no value. So when 3 steps are active in the Mask and Samp is set to 5, a total of 3 times 5 = 15 values get available in the array PruIo::Value[] (after the call of the function PruIo::mm_start() ). The array contains the active steps, so when ie. steps 3, 6 and 7 are active in the Mask, the array contains:
field | Mask = &b110010000 |
---|---|
Value[0] | 1. sample AIN3 |
Value[1] | 1. sample AIN6 |
Value[2] | 1. sample AIN7 |
Value[3] | 2. sample AIN3 |
Value[4] | 2. sample AIN6 |
Value[5] | 2. sample AIN7 |
Value[6] | 3. sample AIN3 |
Value[7] | 3. sample AIN6 |
Value[8] | ... |
Currently the number of samples is limited by the external memory allocated by the kernel PRUSS driver. This 256 kByte by default, see Memory Organisation for further informations.
active Steps | max. Samples |
---|---|
1 | 131072 |
2 | 65536 |
3 | 43690 |
4 | 32768 |
5 | 26214 |
6 | 21845 |
7 | 18724 |
8 | 16384 |
... | ... |
The Mask parameter specifies the active steps. Setting a bit in the Mask activates a step defined by the step configuration (by default bits 1 = AIN0, 2 = AIN1, ... up to 8 = AIN7 are set, use function PruIo::adc_step() to customize steps).
The highest bit 31 has a special meaning for customizing the idle step. By default the idle configuration is set like the configuration of the first active step, so that (in MM) the open delay can get reduced to a minimum for that step (if there's enough time left before restart the ADC). By setting bit 31 the configuration from PruIo::St_p is used instead.
The Tmr parameter specifies the sampling rate. It's the number of nano seconds between the starts of the ADC sampling process. The IEP timer gets used. It is configured to increase by steps of 5 (it counts in GHz, but runs at 200 MHz), so values like 22676 or 22679 results to the same frequency. Some examples
Tmr [ns] | Sampling rate [Hz] |
---|---|
1e9 | 1 |
1e6 | 1000 |
22675 | ~44100 |
The Mds parameter specifies the range of the samples. By default (Mds = 4) the 12 bit samples from the ADC get left shifted by 4, so that they actually are 16 bit values and can get compared with samples from other ADC devices (like 16 bit audio data). Examples
Mds | samples |
---|---|
0 | 12 bit |
1 | 13 bit |
2 | 14 bit |
3 | 15 bit |
4 | 16 bit |
>4 | 16 bit |
The ClDv parameter gets transfered to the ADC clock divider register ADC_CLKDIV (&h4C). The default value (0 = zero) lets the analog front end (AFE) running at full speed (2.4 MHz). Otherwise the clock frequency gets divided by this value + 1. Some examples
ClDv | AFE [MHz] |
---|---|
0 | 2.4 |
1 | 1.2 |
5 | 0.4 |
Furthermore the registers PruIo::AdcReg24 to PruIo::AdcReg40 (ie. IRQ and DMA settings) get transfered to the ADC device, but bits 0 to 2 from PruIo::AdcReg40 are controled by the driver software. See ARM Reference Guide, chapter 12 for details on ADC configurations.
FUNCTION_CDECL_AS_ZSTRING_PTR PruIo::adc_step | ( | BYVAL_AS_uint8 | Stp, |
BYVAL_AS_uint8 | ChN, | ||
BYVAL_AS_uint8 | Av = PRUIO_DEF_AVRAGE , |
||
BYVAL_AS_uint8 | SaD = PRUIO_DEF_SDELAY , |
||
BYVAL_AS_uint32 | OpD = PRUIO_DEF_ODELAY |
||
) |
Customize a single configuration step.
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 is used to adapt a step configuration. In the constructor, steps 1 to 8 get configured for AIN0 to AIN7 (other steps stay un-configured). By this function you can customize the default settings and / or configure further steps (input channel number, avaraging and delay values).
Stp | Description |
---|---|
0 | charge step |
1 | step 1 |
2 | step 2 |
... | ... |
17 | idle step |
It's also possible to directly write to the step configuration in member variables PruIo::St_p (i).Confg and PruIo::St_p (i).Delay. See ARM Reference Guide, chapter 12 for details on ADC configurations.
FUNCTION_CDECL_AS_uint32 PruIo::gpio_get | ( | BYVAL_AS_uint8 | Ball) |
Get the state of a GPIO.
Ball | the CPU ball number to test |
This function is used to get the state of a digital pin (GPIO). Use the macros defined in pruio.bi to specify the pin number for a pin on the Beaglebone headers (ie P8_03 selects pin 3 on header P8).
It's also possible to get the state of a CPU ball (not connected to a header). In this case you need to find the matching CPU ball number and pass it in as the parameter Ball.
The function returns the state of input and output pins (locked or unlocked). Return values are
Value | Description |
---|---|
1 | GPIO is in high state |
0 | GPIO is in low state |
-1 | error (undefined ball number) |
An alternative (and faster) way to get a pin (or ball) state is reading the corresponding bit in member variable PruIo::Gpio[i].Stat.
FUNCTION_CDECL_AS_ZSTRING_PTR PruIo::gpio_set | ( | BYVAL_AS_uint8 | Ball, |
BYVAL_AS_uint8 | Modus = PRUIO_IN_0 , |
||
BYVAL_AS_uint8 | Lokk = PRUIO_LOCK_CHECK |
||
) |
Set the configuration of a GPIO.
Ball | the CPU ball number to set |
Modus | the mode for the GPIO |
Lokk | the locking specification |
This function is used to configure a digital pin. Use the macros defined in pruio.bi to specify the pin number for a pin on the Beaglebone headers (ie P8_03 selects pin 3 on header P8).
Its also possible to get the state of a CPU ball (not connected to a header). In this case you need to find the matching CPU ball number and pass it in as the parameter Ball.
Parameter Modus specifies the pinmux mode for the ARM control module (see ARM Reference Guide, chapter 9). By default the pin gets configured as input pin with pullup resistor, so you can connect a button between the pin and ground to use it as a on/off switch. Other configurations are prepared as macros:
macro name | Description |
---|---|
PRUIO_IN | open input pin (no resistor) |
PRUIO_IN_0 | low input pin (with pulldown resistor) |
PRUIO_IN_1 | high input pin (with pullup resistor) |
PRUIO_OUT0 | output pin set to low (no resistor) |
PRUIO_OUT1 | output pin set to high (no resistor) |
PRUIO_PIN_RESET | reset pin configuration to initial state |
By default only unlocked pins can get changed. These are header pins on P8 or P9 headers that were in mode 7 (GPIO) at start-up. All other pins are locked. That are internal pins not connected to a header and pins in a different mode (ie HDMI or EMMC2 pins).
Parameter Lokk can be specified to change the locking mode of a pin. Use the enumerator from PRUIO_PIN_LOCKING to specify the new mode (the latest is the default value):
enumerator name | Description |
---|---|
PRUIO_UNLOCK_CURR | unlock a pin, don't change the configuration |
PRUIO_UNLOCK_ORIG | unlock a pin, change to original (initial) configuration |
PRUIO_UNLOCK_NEW | unlock a pin, change to parameter configuration |
PRUIO_LOCK_CURR | lock a pin, don't change the configuration |
PRUIO_LOCK_ORIG | lock a pin, change to original (initial) configuration |
PRUIO_LOCK_NEW | lock a pin, change to parameter configuration |
PRUIO_LOCK_CHECK | don't change pin locking, skip operation if pin is locked |
FUNCTION_CDECL_AS_ZSTRING_PTR PruIo::gpio_out | ( | BYVAL_AS_uint8 | Ball, |
BYVAL_AS_uint8 | Modus = 0 |
||
) |
Set the state of a GPIO.
Ball | the CPU ball number to test |
Modus | the state to set (0 = low, high otherwise) |
This function is used to set the state of an output GPIO. Use the macros defined in pruio.bi to specify the pin number for a pin on the Beaglebone headers (ie P8_03 selects pin 3 on header P8).
Its also possible to set the state of a CPU ball (not connected to a header). In this case you need to find the matching CPU ball number and pass it in as the parameter Ball.
This function only works on unlocked output pins. Selecting an input pin or a locked pin generates an error message.
An alternative (and faster) way to set a pin (or ball) state is writing to the corresponding bit in member variables PruIo::Gpio[i].SetM or PruIo::Gpio[i].ClrM. (No locking in this case, mind what you're doing.)
Definition at line 800 of file pruio.bas.
FUNCTION_CDECL_AS_ZSTRING_PTR PruIo::gpio_get_config | ( | BYVAL_AS_uint8 | Ball) |
Create a text description for a pin configuration.
Ball | the CPU ball number to describe |
This function is used to create a text description for the current state of a CPU ball, that is called a pin when it's connected to one of the Beaglebone headers P8 or P9.
The description contains the pin name and its mode. Header pin names start with a capital 'P', CPU ball names start with a lower case 'b'. The detailed pinmux setting is only described for pins in mode 7 (GPIO mode). Otherwise only the mode number gets shown. Finally locked pins get marked by the text '(locked)'.
The returned string pointer points to an internal string. Never free it. The string gets overwritten on further calls to this function, so make local copies if you need several descriptions at a time. The string may contain an error message if the ball number is too big.
FUNCTION_CDECL_AS_uint32 PruIo::mm_trg_pin | ( | BYVAL_AS_uint8 | Ball, |
BYVAL_AS_uint8 | GpioV = 0 , |
||
BYVAL_AS_uint16 | Skip = 0 |
||
) |
Create a trigger configuration for a digital trigger (GPIO).
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 is used to create a configuration for a digital (= GPIO) trigger. Pass the returned value as parameter to function PruIo::mm_start(). The measurement (or the next trigger) will start when the specified GPIO gets in to the declared state.
The parameter Skip can be used to hold up the start for a certain time (previously defined by the Tmr parameter in the last call to function PruIo::config).
This trigger is a fast trigger. The ADC device is waiting in idle mode while the GPIO gets checked.
FUNCTION_CDECL_AS_uint32 PruIo::mm_trg_ain | ( | BYVAL_AS_uint8 | Stp, |
BYVAL_AS_int32 | AdcV, | ||
BYVAL_AS_uint8 | Rela = 0 , |
||
BYVAL_AS_uint16 | Skip = 0 |
||
) |
Create a trigger configuration for an analog input trigger.
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 is used to create a configuration for an analog (= AIN) trigger. Pass the returned value as parameter to function PruIo::mm_start(). The measurement (or the next trigger) will start when the specified analog input (AIN) gets in to the declared state.
The parameter AdcV specifies the value to compare with. A positive value starts when the input is greater than AdcV. A negative value starts when the input is less than AdcV.
AdcV is scalled like the samples, so when the previuos call to function PruIo::config() requires 16 bit samples (Mds = 4), AdcV has to be specified as 16 bit value as well.
AdcV can either be an absolute value or a relative value. For the later case set parameter Rela to any value <> zero. The driver will fetch the current analog input value when the trigger gets active and adds AdcV to calculate the absolute trigger value.
This trigger value gets auto-limited to a certain range (ie &hF0 to &hFF00, in case of default 16 bit setting), to avoid trigger values that never can be reached.
The parameter Skip can be used to hold up the start for a certain time (previously defined by the Tmr parameter in the last call to function PruIo::config). Example:
This trigger is a fast trigger. Only the specified step is active while waiting for the event. The trigger step can be inactive in the Mask of the previous call to function PruIo::config() and only be used for trigger purposes. (Ie. a short open delay can get specified for the trigger step since there is no channel muxing.)
FUNCTION_CDECL_AS_uint32 PruIo::mm_trg_pre | ( | BYVAL_AS_uint8 | Stp, |
BYVAL_AS_int32 | AdcV, | ||
BYVAL_AS_uint16 | Samp = 0 , |
||
BYVAL_AS_uint8 | Rela = 0 |
||
) |
Create a trigger configuration for an analog input trigger.
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 is used to create a configuration for an analog (= AIN) pre-trigger. Pass the returned value as parameter to function PruIo::mm_start(). The measurement on all active steps will start immediately and collect the input values in a ring buffer. Normal measurement starts when the specified analog input (AIN) gets in to the declared state.
Either a certain step (that must be activated in the previous call to function PruIo::config() ) can be checked. Or all active inputs get checked against the specified AdcV. In the later case AdcV is allways an absolute value (parameter Rela gets ignored).
The parameter AdcV specifies the value to compare with. A positive value starts when the input is greater than AdcV. A negative value starts when the input is less than AdcV.
AdcV is scalled like the samples, so when the previuos call to function PruIo::config() requires 16 bit samples (Mds = 4), AdcV has to be specified as 16 bit value as well.
AdcV can either be an absolute value or a relative value. For the later case set parameter Rela to any value <> zero. The driver will fetch the current analog input value when the trigger gets active and add AdcV to calculate the absolute trigger value.
The trigger value gets auto-limited to a certain range (ie &hF0 to &hFF00, in case of default 16 bit setting), to avoid trigger values that never can be reached.
Parameter Samp is used to specify the number of samples to fetch before the trigger event occurs. It specifies the number of sampling sets for all active channels. Its maximum value is limited to 1023 and also by the amount of memory available (approx. 7000 samples in DRam0 and DRam1) to sort the ring buffer.
The pre-trigger is a slow trigger. The ADC device goes through all activated steps while waiting for the trigger event.
FUNCTION_CDECL_AS_ZSTRING_PTR PruIo::mm_start | ( | BYVAL_AS_uint32 | Trg1 = 0 , |
BYVAL_AS_uint32 | Trg2 = 0 , |
||
BYVAL_AS_uint32 | Trg3 = 0 , |
||
BYVAL_AS_uint32 | Trg4 = 0 |
||
) |
Start a measurement in MM.
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 starts a measurement in MM mode. The ADC configuration from the previous call to function PruIo::config() are used. The measurement either starts immediately or the start gets controlled by one (or up to four) trigger event(s).
Function are available to create trigger specifications:
uint32 PruIo::Samples |
number of samples
Definition at line 137 of file pruio_c_wrapper.h.
uint32 PruIo::TimerVal |
timer value in [ns]
Definition at line 137 of file pruio_c_wrapper.h.
uint32 PruIo::StepMask |
mask to specify active channels
Definition at line 137 of file pruio_c_wrapper.h.
uint16 PruIo::LslMode |
bit shift modus (0 to 4)
Definition at line 141 of file pruio_c_wrapper.h.
uint16 PruIo::ClockDiv |
divisor for ADC input clock (register 0x4C)
Definition at line 141 of file pruio_c_wrapper.h.
uint32 PruIo::AdcReg24 = 0 |
< ADC register IRQ_STATUS_RAW
ADC register IRQ_STATUS_RAW.
Definition at line 146 of file pruio_c_wrapper.h.
uint32 PruIo::AdcReg28 = 0 |
< ADC register IRQ_STATUS
ADC register IRQ_STATUS.
Definition at line 146 of file pruio_c_wrapper.h.
uint32 PruIo::AdcReg2C = 0 |
< ADC register IRQENABLE_SET
ADC register IRQENABLE_SET.
Definition at line 146 of file pruio_c_wrapper.h.
uint32 PruIo::AdcReg30 = 0 |
< ADC register IRQENABLE_CLR
ADC register IRQENABLE_CLR.
Definition at line 146 of file pruio_c_wrapper.h.
uint32 PruIo::AdcReg34 = 0 |
uint32 PruIo::AdcReg38 = 0 |
< ADC register DMAENABLE_SET
ADC register DMAENABLE_SET.
Definition at line 146 of file pruio_c_wrapper.h.
uint32 PruIo::AdcReg3C = 0 |
< ADC register DMAENABLE_CLR
ADC register DMAENABLE_CLR.
Definition at line 146 of file pruio_c_wrapper.h.
uint32 PruIo::AdcReg40 = 0 |
ADC register CRTL (bits 0, 1 and 2 gets set by driver)
Definition at line 146 of file pruio_c_wrapper.h.
struct AdcSteps PruIo::St_p[17+1] |
step configuration (charge step + 16 steps + idle step, by default steps 1 to 8 are used for AIN0 to AIN7)
Definition at line 155 of file pruio_c_wrapper.h.
uint32* PruIo::DRam |
pointer to access PRU DRam
Definition at line 157 of file pruio_c_wrapper.h.
void* PruIo::ERam |
pointer to read PRU external ram
Definition at line 158 of file pruio_c_wrapper.h.
void * PruIo::BallOrg |
buffer pointer for original Ball configuration
Definition at line 158 of file pruio_c_wrapper.h.
uint32* PruIo::AdcOrg |
buffer pointer for original ADC configuration (= 0 in case of ADC down at startup)
Definition at line 160 of file pruio_c_wrapper.h.
uint32 * PruIo::GpioOrg |
buffer pointer for original GPIO configuration
Definition at line 160 of file pruio_c_wrapper.h.
uint16* PruIo::Value |
pointer to read sampled ADC input data
Definition at line 162 of file pruio_c_wrapper.h.
uint8* PruIo::BallRef |
pointer to ball reference (GPIO# for CPU pins or lock)
Definition at line 163 of file pruio_c_wrapper.h.
uint8 * PruIo::BallConf |
pointer to ball configuration (CPU pin muxing)
Definition at line 163 of file pruio_c_wrapper.h.
char* PruIo::Errr |
pointer for error messages
Definition at line 165 of file pruio_c_wrapper.h.
uint32 PruIo::EOffs |
the offset of the external PRUSS-DDR
the offset of the external memory (PRUSS-DDR)
Definition at line 167 of file pruio_c_wrapper.h.
uint32 PruIo::ESize |
the size of the external PRUSS-DDR
the size of the external memory (PRUSS-DDR)
Definition at line 167 of file pruio_c_wrapper.h.
uint32 PruIo::CSize |
the size of the original configuration block
Definition at line 167 of file pruio_c_wrapper.h.
uint32 PruIo::PruNo |
the PRU number to use
the PRU number to use (defaults to 1)
Definition at line 167 of file pruio_c_wrapper.h.
uint32 PruIo::PruEvtout |
the interrupt channel to send commands to PRU
Definition at line 167 of file pruio_c_wrapper.h.
uint32 PruIo::PruIRam |
the PRU instruction ram to load
Definition at line 167 of file pruio_c_wrapper.h.
uint32 PruIo::PruDRam |
the PRU data ram
Definition at line 167 of file pruio_c_wrapper.h.
int16 PruIo::ArmPruInt |
the interrupt to send
Definition at line 175 of file pruio_c_wrapper.h.
int16 PruIo::ChAz |
number of active channels
Definition at line 175 of file pruio_c_wrapper.h.
struct __pruss_intc_initdata PruIo::IntcInit |
interrupt settings (we also set default interrupts, so that the other PRUSS can be used in parallel)
Definition at line 179 of file pruio_c_wrapper.h.
struct GpioSet* PruIo::Gpio |
pointer to GPIO structure (current values)
Definition at line 180 of file pruio_c_wrapper.h.
struct GpioSet PruIo::GpioInit[PRUIO_GPIO_AZ+1] |
initial GPIO definitions
Definition at line 181 of file pruio_c_wrapper.h.
uint8 PruIo::BallGpio |
list of GPIO numbers, corresponding to ball index
Definition at line 182 of file pruio_c_wrapper.h.
AdcSteps PruIo::St_p[17+1] |
ANY_PTR PruIo::BallOrg |
uint32_PTR PruIo::AdcOrg |
uint32_PTR PruIo::GpioOrg |
uint16_PTR PruIo::Value |
uint8_PTR PruIo::BallRef |
uint8_PTR PruIo::BallConf |
tpruss_intc_initdata PruIo::IntcInit |
interrupt settings (we also set default interrupts, so that the other PRUSS can be used in parallel)
GpioSet_PTR PruIo::Gpio |
GpioSet PruIo::GpioInit[PRUIO_GPIO_AZ+1] |
initial GPIO definitions