p-n buried heterostructure