/* Reads the firmware revision of the IO expander.  */
uint32_t BOARD_picGetFwRevision(uint8_t *major, uint8_t *minor, uint8_t *patch)
/* Reads the firmware revision of the IO expander.  */
uint32_t BOARD_picGetFwRevision(uint8_t *major, uint8_t *minor, uint8_t *patch)
{
   uint32_t status;
   *major = 0;
   *minor = 0;
   *patch = 0;
   GPIO_IntDisable( 1 << BOARD_PIC_INT_WAKE_PIN );
   GPIO_PinOutClear( BOARD_PIC_INT_WAKE_PORT, BOARD_PIC_INT_WAKE_PIN );
   status = picReadReg( BOARD_PIC_REG_VERSION_MAJOR, major );
   if( status != BOARD_OK ) {
      goto cleanup;
   }
   status = picReadReg( BOARD_PIC_REG_VERSION_MINOR, minor );
   if( status != BOARD_OK ) {
      goto cleanup;
   }
   status = picReadReg( BOARD_PIC_REG_VERSION_PATCH, patch );
cleanup:
   GPIO_IntClear( 1 << BOARD_PIC_INT_WAKE_PIN );
   GPIO_IntEnable( 1 << BOARD_PIC_INT_WAKE_PIN );
   GPIO_PinOutSet( BOARD_PIC_INT_WAKE_PORT, BOARD_PIC_INT_WAKE_PIN );
   return status;
}