Int16 EVMOMAPL137_GPIO_setDirection( Uint16 number, Uint8 direction )
{
Uint32 bank_id = ( number >> 5 );//???
Uint32 pin_id = ( 1 << ( number & 0x1F ) );
/**/
Uint32* gpio_dir = ( Uint32* )( GPIO_BASE + GPIO_DIR_BASE + ( bank_id * GPIO_BASE_OFFSET ) );
if ( ( direction & 1 ) == GPIO_OUT )
*gpio_dir &= ~( pin_id ); // Set to OUTPUT
else
*gpio_dir |= ( pin_id ); // Set to INPUT
return 0;
}
这一段里的Uint32 bank_id = ( number >> 5 ),这个5的含义是什么? |