An NHS trust has been awarded £2.59 million by the government to install solar panels at three hospitals in West Sussex.