URI friendly Pmod Interface Library

Dependents:   MBD2PMD_WebServer ARD2PMD_WebServer

Embed: (wiki syntax)

« Back to documentation index

PmodInterface Class Reference

PmodInterface Class Reference

RAPC Library, Provides utilities for remotely accessing peripherals. More...

#include <PmodInterface.h>

Public Types

enum  PINTdioBits {
  DB_OUT = 0x01, DB_OWD = 0x02, DB_DIR = 0x04, DB_DWE = 0x08,
  DB_PU = 0x10, DB_PWE = 0x20
}
 

Name the DIO bits.

More...
enum  PINTi2cArgs { IA_CNT = 0, IA_ADD, IA_DATA, IA_RDDA }
 

Name the I2C arguments.

More...

Public Member Functions

 PmodInterface ()
 Create a PmodInterface interface.
void init (DigitalInOut *dio[], I2C *i2c, MAX14661 *mux, const int *mux_a, const int *mux_p)
 Initialize the digital pins and PWM.
void call (char *input, char *output)
 Process Remote Arduino Peripheral Module Command.

Detailed Description

RAPC Library, Provides utilities for remotely accessing peripherals.

Example:

 // Configure board to pass UART signals to peripheral connector.

 #include "PmodInterface.h"

 PmodInterface pInt(PTD0, PTD2, PTD3, PTD1,
          PTA4, PTA5, PTC8, PTC9,
          PTA12, PTE0, PTE1
          );

 int main() {
    char ibuf[256];
    char obuf[256];
    pInt.init();
    while(1) {
        scanf("%s", ibuf);
        pInt.call(ibuf, obuf);
        printf("%s=", ibuf);
        printf("%s\n", obuf);
 }

Definition at line 36 of file PmodInterface.h.


Member Enumeration Documentation

Name the DIO bits.

Enumerator:
DB_OUT 

Pin Output State Bit.

DB_OWD 

Output Write Disable, set to block writing the output state.

DB_DIR 

Pin Direction, 0 = Input, 1 = Output.

DB_DWE 

Direction Write Enable, set this bit to write the direction.

DB_PU 

Pull Up State, 0 = PullNone, 1 = PullUp.

DB_PWE 

Pull Up Write Enable, set this bit to write the pull up state.

Definition at line 49 of file PmodInterface.h.

Name the I2C arguments.

Enumerator:
IA_CNT 

Argument Count.

IA_ADD 

Device Address.

IA_DATA 

Data, Read = # bytes to read, Write = first data byte.

IA_RDDA 

Read Data, data to write prior to read.

Definition at line 60 of file PmodInterface.h.


Constructor & Destructor Documentation

Create a PmodInterface interface.

Definition at line 8 of file PmodInterface.cpp.


Member Function Documentation

void call ( char *  input,
char *  output 
)

Process Remote Arduino Peripheral Module Command.

Parameters:
inputa pointer to the string containing the command
outputa pointer to the string to write the result

Definition at line 223 of file PmodInterface.cpp.

void init ( DigitalInOut *  dio[],
I2C *  i2c,
MAX14661 *  mux,
const int *  mux_a,
const int *  mux_p 
)

Initialize the digital pins and PWM.