Creating a Swift type for button input on nRF52 - Part 1

Introduction In my previous post, Controlling an LED using Embedded Swift on nRF52 , we created a Swift struct to encapsulate the C code required to control an LED. In this post, we&rsquo;ll do the same for a button. If you want to follow along, the code is available on GitHub with each step having its own commit. Starting from working code As a starting point, we will write the whole code in C.…