Is there any API available to access the compass hardware in WP7 (Mango)?
Yes, you can use the Compass class. You can get sample code showing how to read the compass in the Raw Sensor Data Sample or this 'How To'.