Guys,
I have a question on defining port, please correct me if I'm wrong...
#define VS1003B_PORT PORTF #define VS1003B_DDR DDRF #define VS1003B_PIN PINF #define VS1003B_XCS 7 #define VS1003B_XRESET 6 #define VS1003B_DREQ 5 #define VS1003B_XDCS 4 #define PORT_INI() VS1003B_DDR = (1<<VS1003B_XCS) | (1<<VS1003B_XRESET) |(1<<VS1003B_XDCS) | (0<<VS1003B_DREQ) loop_until_bit_is_set(VS1003B_PIN,VS1003B_DREQ);
I want VS1003B_XCS,VS1003B_XRESET,VS1003B_XDCS = output
and VS1003B_DREQ = input,
am I right defining like this :
#define PORT_INI() VS1003B_DDR = (1<<VS1003B_XCS) | (1<<VS1003B_XRESET) |(1<<VS1003B_XDCS) | (0<<VS1003B_DREQ)
or
#define PORT_INI() VS1003B_DDR = 0xDF
is better ?
I tried to check
loop_until_bit_is_set(VS1003B_PIN,VS1003B_DREQ);
but never work, even I put 5V on pin 5 as a test for H condition, do I miss something here ?
thanks