https://developer.mbed.org/users/shorie/code/amakusa/#c2a4ebafb868