(8.D.2.2 ) GPIO
Overview
Perform GPIO on target
Discussion
This module performs GPIO operations on the target hardware by calling the user implemented functions 'awe_pltGPIOGetPin' or 'awe_pltGPIOSetPin'. The target AWECore must be built to enable this GPIO feature. Contact DSP Concepts for questions.
Type Definition
typedef struct _ModuleGPIO
{
ModuleInstanceDescriptor instance; // Common Audio Weaver module instance structure
INT32 nPins; // Number of pins
INT32 nPinDir; // I/O direction 0 - input, 1 - output
INT32 errorCode; // Internal Error Number
INT32* nPinIndex; // Specifies which physical GPIO pins to use.
INT32* nLastOutValue; // Holds the last output value.
} ModuleGPIOClass;
Variables
Properties
Name | Type | Usage | isHidden | Default value | Range | Units |
nPins | int | const | 0 | 1 | Unrestricted | Â |
nPinDir | int | const | 0 | 0 | Unrestricted | Â |
errorCode | int | state | 0 | 0 | Unrestricted | Â |
nPinIndex | int* | parameter | 0 | [1 x 1] | Unrestricted | Â |
nLastOutValue | int* | parameter | 0 | [1 x 1] | Unrestricted | Â |
Pins
Output Pins
Name: out1
Description: Output signal
Data type: int
MATLAB Usage
File Name: GPIO_module.m
M = GPIO_module(NAME, NUMBER_PINS, PIN_DIR, SR)
Depending on PIN_DIR this block inputs or outputs a logical value from/to each
specified GPIO pin on the target hardware. For a given instance of this block
pins must be either all input or all output. If you need some pins to be input
and some pins to be output create two separate blocks; one for all the input
pins and one for all the output pins. Consult Audio Weaver documentation
to determine how the numbered pins are mapped to actual target hardware
pins. The user must select which of these pins to use.
NAME - name of the module.
NUMBER_PINS - Number of pins
PIN_DIR - 0 = Input Pin. 1 = Output Pin.
SR - optional sample rate for input pins (1000 Hz by default)
Â