docs: start a document to describe D-Bus usage
[qemu/ar7.git] / include / qemu / bcd.h
blobdfebacf1fc38a82d8375632a66494636e2288287
1 #ifndef QEMU_BCD_H
2 #define QEMU_BCD_H
4 /* Convert a byte between binary and BCD. */
5 static inline uint8_t to_bcd(uint8_t val)
7 return ((val / 10) << 4) | (val % 10);
10 static inline uint8_t from_bcd(uint8_t val)
12 return ((val >> 4) * 10) + (val & 0x0f);
15 #endif