Could shortage of oxygen cause yawning?

Yawning. Is present in most mammals and it's a defense mechanism in these species against a process called atelectasis, which is a collapse of some alveoli due to shallow breathing and weight of the lungs.