CCDs as low-energy X-ray detectors: I. General description