/*****************************************************************************
FileName : flip.c
Function :
Author : mike
Email : [email protected]
Version : V1.0
Date : 2019-07-12
Note : 1 byte , BIT(0) BIT(7), 11100000, 00000111
*****************************************************************************/
#define u8 unsigned char
IAR_CONST u8 flip_tab[16]={0x00,0x08,0x04,0x0c,0x02,0x0a,0x06,0x0e,
0x01,0x09,0x05,0x0d,0x03,0x0b,0x07,0x0f};
u8 flip_bit(u8 dat) //keil 26
{
dat = flip_tab[(dat & 0xf0)>>4] | (flip_tab[dat & 0x0f]<<4);
return dat;
}