How can I read this digital pin for Nano by using AVR's Atmel Studo? How can I read digital pin 6 in AVR?

I set the pin as input as follows:

DDRD = B0100000; //this will set pin 6 as input

But how can I now digital read this pin?:

Another way of putting it: how can I convert this Arduino code to be used in Atmel Studio?:

digitalRead(DATA_PIN); 

Edit:

while (1) {      

        unsigned long data = 0;//32 bit variable to store encoder data

        for (int i=0; i&lt;25; i++) {//25 bit encoder data, first 12 bit is CCW count data and the rest 13 bit is the position angle data
        data &lt;&lt;= 1;//shift all read data left one bit   
        PORTD &amp;= ~(1 &lt;&lt; 5);//clock pin goes low    
        _delay_us(2);    
        PORTD |= (1 &lt;&lt; 5);//clock pin goes high   
        _delay_us(2);   

        data |= digitalRead(DATA_PIN);//cat the new read bit to the whole read data  
        }


I want to use usual C code for AVR instead of using digitalRead above. data is an 32 bit array storing 25 bit encoder data. It is bit by bit filled by digitalRaed.

I think I found it:

while (1) {      

        unsigned long data = 0;//32 bit variable to store encoder data
        uint8_t val;

        for (int i=0; i&lt;25; i++) {//25 bit encoder data, first 12 bit is CCW count data and the rest 13 bit is the position angle data
        data &lt;&lt;= 1;//shift all read data left one bit   
        PORTD &amp;= ~(1 &lt;&lt; 5);//clock pin goes low    
        _delay_us(2);    
        PORTD |= (1 &lt;&lt; 5);//clock pin goes high   
        _delay_us(2);   




        if ( (PIND &amp; (1 &lt;&lt; PIND6)) == (1 &lt;&lt; PIND6) ) {
            val = 1;
            } else {
            val = 0;
        }


        data |= val;//cat the new read bit to the whole read data    
        }
Read the port state with PIND
Isolate the bit you want with &amp;
Profit


if (PIND &amp; 0b0100000) {
    val |= 1;
}


Or, as a ternary:

val |= ((PIND &amp; 0b01000000) ? 1 : 0);