Compound III-V semiconductor avalanche photodiodes for X-ray spectroscopy