please can some one explain to me how this dt works i don't understand he didn't assigned any value to dt and he compares it and used & please can some one explain to me how this Bitwise and & operator works
void LCD_WriteData(uint8_t dt)
{
if(((dt >> 3)&0x01)==1) {d7_set();} else {d7_reset();}
if(((dt >> 2)&0x01)==1) {d6_set();} else {d6_reset();}
if(((dt >> 1)&0x01)==1) {d5_set();} else {d5_reset();}
if((dt&0x01)==1) {d4_set();} else {d4_reset();}
}
source: narodstream.ru/.../ thanks in advance
Maybe start by learning C, then how bits are represented within a byte.
dt is an input parameter to the function, the value will match what is sent into the function ie LCD_WriteData(0x0E); where upon entry dt = 0x0E
The routine processes the byte, looking at the state of specific bits and reflecting that at and out via dX_set() or dX_reset() functions.
Please read and follow the instructions for posting source code; they are not hard, and are clearly stated immediately above where you type your message.
See this picture: www.danlhenry.com/.../keil_code.png
The bitwise operators are a standard part of the 'C' programming language - they are not specific to Keil or ARM - so any standard 'C' textbook should help you.
Here are some 'C' learning & reference materials for you - inlcuding a free online 'C' textbook:
blog.antronics.co.uk/.../
thanks for reply but my question was he didn't put any value for dt so what is its value and how he makes & to it can you make an example