Utility to convert hex formatted ascii to binary system types.
Dependents: Nucleo_read_hyperterminale
Helper for parsing ASCII communications
Example
#include "mbed.h" #include "atoh.h" int main() { uint64_t result = atoh <uint64_t> ("0123456789abcdef" ); uint32_t lo = result & 0x00000000ffffffff; uint32_t hi = (result >> 32); printf( "0x%08X%08X\n", hi, lo ); printf( "0x%08X\n", atoh <uint32_t> ( "12345678" ) ); printf( "0x%04X\n", atoh <uint16_t> ( "1234" ) ); printf( "0x%02X\n", atoh <uint8_t> ( "12" ) ); }
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
1:c590c304b2fa | 2013-03-27 | sam_grove | Updated some documentation |
0:fbac423fa3d4 | 2013-03-07 | sam_grove | Cleaned up documentation and updated example |