pic24_dspic33::digital_io Class Reference

This class provides basic digital I/O for the PIC. More...

List of all members.

Public Member Functions

def __init__
 Configures a pin for digital operation.
def set
 Set a pin's output to be high or low (True or False).
def get
 Read a pin's value.
def getPin
 Read the current digital voltage (high or low / True or False) on a pin.
def getLatch
 Read the last value written to this pin (that is, the value stored in the pin's latch).


Detailed Description

This class provides basic digital I/O for the PIC.

Configuring a given pin overrides any previous configuration (as an analog input, other digitial I/O, peripheral such as UART, SPI, etc.)

Definition at line 26 of file pic24_dspic33.py.


Member Function Documentation

def pic24_dspic33::digital_io::__init__ (   self,
  port,
  pin,
  isInput,
  isOpenDrain = False,
  pullDir = 0 
)

Configures a pin for digital operation.

Parameters:

Parameters:
port The port, specified as a one-letter string, which must be from "A" to "G".
pin The pin of the port to configure. Must be a number between 0 and 15.
isInput True to configure the pin as an input, false to configure the pin as an output.
isOpenDrain True to configure the pin's output drivers to be open drain, false to configure the pin's output drivers as a standrard push-pull output. IMPORTANT: Not all pins have open-drain ability; therefore, the only valid selection for this parameter may be false. All pins have standard, push-pull drivers.
pullDir A value > 0 to enable a pull-up resistor on the pin, a value < 0 to enable a pull-down resistor on the pin, or 0 to disable both. IMPORTANT: Not all pins have pull-up or pull-down capability. Valid values for some pins are 0 (neither pull-up nor pull-down resistors are available), or >=0 (only pull-up resistors are available).
__NATIVE__
return configDigitalPinPy(ppframe);

Definition at line 54 of file pic24_dspic33.py.

def pic24_dspic33::digital_io::get (   self  ) 

Read a pin's value.

If the pin is an input, read the pin; if it's an output, read the last value written.

__NATIVE__
return readDigitalValuePy(ppframe);

Definition at line 71 of file pic24_dspic33.py.

def pic24_dspic33::digital_io::getLatch (   self  ) 

Read the last value written to this pin (that is, the value stored in the pin's latch).

__NATIVE__
return readDigitalLatchPy(ppframe);

Definition at line 87 of file pic24_dspic33.py.

def pic24_dspic33::digital_io::getPin (   self  ) 

Read the current digital voltage (high or low / True or False) on a pin.

__NATIVE__
return readDigitalPinPy(ppframe);

Definition at line 79 of file pic24_dspic33.py.

def pic24_dspic33::digital_io::set (   self,
  isHigh 
)

Set a pin's output to be high or low (True or False).

The pin must be configured as an output for this value to appear on the pin.

Parameters:
isHigh True to set the pin high, False to set it low.
__NATIVE__
return setDigitalPinPy(ppframe);

Definition at line 63 of file pic24_dspic33.py.


The documentation for this class was generated from the following file:

Generated on Mon Oct 18 07:40:50 2010 for Python-on-a-chip by  doxygen 1.5.9