Is there a way to pass a bit from a PIC's register as a function parameter?
Taking, for example, the PIC16F887, its registers (SFRs) and individual bits are defined as fallows in the corresponding header file (...\HI-TECH Software\PICC\9.80\include\pic16f887.h
):
volatile unsigned char PORTB @ 0x006;
volatile bit RB3 @ ((unsigned)&PORTB*8)+3;
How can I pass the RB3 bit as a parameter in a function so that it will allow me to call the function in this way:
setBitHigh (RB3);
What would be the function's prototype?
I'm using the HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80.
EDIT: The setBitHigh function is just a simplified example. I actually want to pass bits as parameters to more complex functions and to be able to choose at runtime which bits should the function use.