Intrusion Detection on Resource-Constrained IoT Devices with Hardware-Aware ML and DL