As others have said, yes both can cause issues. If it is medication related, sometimes it can change if medication is switched.
Often, neuros don't want to do this if you have good seizure control and won't know what to look for with regard to any signs that meds may be causing this as a side effect (due to hormonal changes, etc.).
My recommendation for any man with E that is taking meds is to get a full hormonal lab workup done. Ideally, this would be done when you were functioning normally in order to establish a good baseline from which you could compare any future changes in performance against. But, in your case, it would be good to know just the same.
Your neuro likely wont do this, so you would need to seek out an internist, endo, or uro who is sympathetic and willing to do this tests even if there is nothing for them to treat. Many don't want to do it strictly to look or monitor the situation, but you can usually find someone to do it at least once.
By a full workup, I mean more than testosterone. You want testosterone and free testosterone, estradiol, LH, FSH, DHEA, DHT, Prolactin, etc. Meds can increase or decrease many of these and they can cause issues. However, if you come back in normal ranges, perhaps it simply the E itself or just the medication shutting you down in that department by the way it acts on your brain.
Often this is a nebulous area and difficult to see exactly what the cause is, but some baseline labwork is a good place to start with physicians and neuros you trust and who understand your goals (in terms of outcomes you want to see occur).
Finally, don't be afraid to consider something like Viagra if need be. If you have good seizure control, but feel like the AED is causing decreased sexual performance and drive, and you and your neuro don't want to change seizure meds right away, then at least checking if something like Viagra may benefit you may be worth it. It is not ideal, but if it works, it might be a good stopgap until you figure out what is going on. It can also let you know if the vascular component is still functioning and at least remove that as a possible issue from the equation.
You will need to be your own advocate here, but finding the right doc is good start.
Best of luck to you.