Welcome to HCM
After going through your history it is possible that a complication autonomic neuropathy or vasculopathy,which depends on duration of diabetes
and how you control your blood sugar level.
You should control your diabetes with adequate dose of insulin
and monitor with FBS,PPBS and HbA1c level.
You should consult a Endocrinologist
and after detail physical examination Nerve conduction study
,test for autonomic neuropathy and a penile Doppler study will give cause for your problem.
Also check your cardiac status by ECG,Echocardiography
There are many drugs for ED which can be given in required dose.
Please do not take these drugs without proper advise and do not increase dose yourself.