PWM Reader

Guys, I've got a real world problem to solve. In a nutshell I am trying to build a PWM reader to read the output of a pressure sensor. attachment shows what output of the sensor looks like.

First 12 bits represent the pressure and the next 3 bits are not used and the final bit is error flag.

Low pulse of 40us = 0; while low pulse of 80us = 1.

Can you please guide me in the right direction.

Thanks.

Attached image shown.

read input
if low
  start timing
  read input and wait for input to go high using while loop
  measure time
back to begin

What pressure sensor is it (part# or link or datasheet)?