(a) A defendant planning to offer evidence of the insanity defense must file with the court a notice of the defendant’s intention to offer that evidence.
(b) The notice must:
(1) contain a certification that a copy of the notice has been served on the attorney representing the state; and
(2) be filed at least 20 days before the date the case is set for trial, except as described by Subsection (c).
(c) If before the 20-day period the court sets a pretrial hearing, the defendant shall give notice at the hearing.