pintools

Manipulate pins (level, mode) by variable settings.

Author Sebastien Lelong, Copyright © 2009, all rights reserved.
Adapted-by Rob Hamerling
Compiler 2.4q3

Description

This library provides a set of functions and procedures
to help users manipulating pins. For instance, you can dynamically access pins
using a specific mapping (RA0 is #0, RB1 is #2, etc...) and act on levels and
directions.
.
Using this library requires that an array "pintools_map" is defined before
including the library. This byte array is populated by pairs of elements:
 * the first element of a pair corresponds to the port letter ("A", "B", ...)
 * the second element of a pair is the pin number in this port (0, 1, 2, ...)
Pins can then be accessed with their index in this array.
Example: const byte pintools_map[] = { "A",1, "B",1, "D",3 }
This 6 elements array (of 3 pairs) specifies that:
 * pin #0 refers to pin_A1
 * pin #1 refers to pin_B1
 * pin #2 refers to pin_D3
Example of use:
 * To obtain the current level of pin_B1:
     pin_level = pintools_level[1]
 * To set the direction of pin_D3 to output:
     pintools_direction[2] = OUTPUT


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f88616f886_pintools.jal
18f455018f4550_pintools.jal