Use new HAL API

Fixes #11