Analysis and Design of Event-triggered Control Algorithms using Hybrid Systems Tools