Main Page | Modules | Data Structures | File List | Data Fields | Globals

bbit.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define bitmclr(var, bitm)
#define bitmset(var, bitm)

Functions

__inline__ void bitnclr (uchar *addr, uchar bitn)
 Clears bit @ addr (bit is 0..7).

__inline__ void bitnset (uchar *addr, uchar bitn)
 Sets bit @ addr (bit is 0..7).

__inline__ bool bitncheck (uchar *addr, uchar bitn)
 Checks bit @ addr (bit is 0..7).


Define Documentation

#define bitmclr var,
bitm   ) 
 

Value:

do { \
    __asm__ __volatile__ ( \
        "bclr %0, %1" \
        :                           /* Output */ \
        : "p" (&var), "n" (bitm)    /* Input */ \
        : "%ccr"                    /* Clobbered */ \
    ); \
 \
} while (0);

Definition at line 8 of file bbit.h.

#define bitmset var,
bitm   ) 
 

Value:

do { \
    __asm__ __volatile__ ( \
        "bset %0, %1" \
        :                           /* Output */ \
        : "p" (&var), "n" (bitm)    /* Input */ \
        : "%ccr"                    /* Clobbered */ \
    ); \
 \
} while (0);

Definition at line 19 of file bbit.h.


Function Documentation

__inline__ bool bitncheck uchar addr,
uchar  bitn
 

Checks bit @ addr (bit is 0..7).

Parameters:
addr char pointer to byte being tested
bitn char value (0..7) representing bit to check.
Return values:
bool Matches the state of bit @ addr

Definition at line 61 of file bbit.c.

References uchar.

Referenced by btnscan_chk().

00063 {
00064     if ((*addr & (0x01<<bitn)) != '\0') return true;
00065         else return false;
00066 }

__inline__ void bitnclr uchar addr,
uchar  bitn
 

Clears bit @ addr (bit is 0..7).

Parameters:
addr char pointer to byte being manipulated
bitn char value (0..7) representing bit to clear.

Definition at line 32 of file bbit.c.

References uchar.

00034 {
00035     *addr &= ~(0x01<<bitn);
00036 
00037     return;
00038 }

__inline__ void bitnset uchar addr,
uchar  bitn
 

Sets bit @ addr (bit is 0..7).

Parameters:
addr char pointer to byte being manipulated
bitn char value (0..7) representing bit to set.

Definition at line 46 of file bbit.c.

References uchar.

00048 {
00049     *addr |= 0x01<<bitn;
00050     
00051     return;
00052 }


Generated on Sat Apr 10 17:08:04 2004 for BeeOS by doxygen 1.3.6-20040222