:: Home :: Code Snippets :: Drivers :: Projects :: About ::
 Main Menu
  Home
  Code Snippets
  About

 Open Drivers
 PIC32 mcompat - PIC32 mcompat
 _build - Embedded build information
 qTask - Queued Task Manager
 EA-DOGM - LCD Display Driver

 Open Projects
 oLogic - Oscilloscope Logic Viewer
 oLogic 1.4 - NEW Logic Viewer
 SSX32 - Serial Servo Driver



 Sources
Prototyping
  PicStuff
  Sparkfun

Equipment
  Saelig
  Tequipment

Supply House
  Jameco
  Mouser
  Digikey
  Allied Electronics
  Clearwater Technologies

Miscellaneous
  BCM
  N34D Blog

vPort - 8bit virtual port.

For use when you dont have a full 8bits on a port, such as A, B, C...

 Code Snippet
/vhost/mculabs/snippet_db/vport/vport.c
    1 
    2 // this is a virtual port when we dont have a single 8bit output port
    3 
    4 #define VPORT_0 PIN_A1
    5 #define VPORT_1 PIN_A2
    6 #define VPORT_2 PIN_A3
    7 #define VPORT_3 PIN_A4
    8 #define VPORT_4 PIN_B0
    9 #define VPORT_5 PIN_B1
   10 #define VPORT_6 PIN_B2
   11 #define VPORT_7 PIN_B3
   12 
   13 
   14 void virtPortWrite(int d)
   15 {
   16    output_bit(VPORT_0,bit_test(d,0));
   17    output_bit(VPORT_1,bit_test(d,1));
   18    output_bit(VPORT_2,bit_test(d,2));
   19    output_bit(VPORT_3,bit_test(d,3));
   20    output_bit(VPORT_4,bit_test(d,4));
   21    output_bit(VPORT_5,bit_test(d,5));
   22    output_bit(VPORT_6,bit_test(d,6));
   23    output_bit(VPORT_7,bit_test(d,7));
   24 }
   25 






:: Home :: Resources :: PIC Microcontrollers ::
:: 10F :: 12F :: 16F :: 18F :: 24F :: 24H :: 30F :: 33F ::
(C) Copyright 2009 mculabs.com - contact: info@mculabs.com
0.038504838943481