summaryrefslogtreecommitdiffstats
path: root/README.mkd
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 14:40:15 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 14:40:15 -0500
commit0ba19fae04ee48392872a9647a3b711b9115f147 (patch)
tree4ba55a5925abe773531bf65256e8cbca5f03d28d /README.mkd
parent3a6af99be9a10f795b84a5783939b86d7102fb63 (diff)
Add get_byte and get_nibble to 8byte function set.
Diffstat (limited to 'README.mkd')
-rw-r--r--README.mkd16
1 files changed, 12 insertions, 4 deletions
diff --git a/README.mkd b/README.mkd
index 836b151e..0ec51263 100644
--- a/README.mkd
+++ b/README.mkd
@@ -12,8 +12,13 @@ started, here are examples using the API:
uint8_t data[4] = {0x12, 0x34, 0x56, 0x78};
uint8_t result = get_byte(data, sizeof(data), 0);
- uint8_t result = get_nibble(data, sizeof(data), 0);
- fail_unless(copy_bits_right_aligned(data, 4, 4, 12, result, 4));
+ // result = 0x12;
+ result = get_nibble(data, sizeof(data), 0);
+ // result = 0x1;
+ bool success = copy_bits_right_aligned(data, 4, 4, 12, result, 4)
+ // success == true
+ // result[0] == 0x2
+ // result[1] == 0x34
## 8 Byte Bitfield Decoding
@@ -26,12 +31,15 @@ started, here are examples using the API:
// result = 0x574d555a;
data = 0x00000000F34DFCFF;
- result = nth_byte(data, 0);
+ result = eightbyte_get_byte(data, 0, false);
//result = 0x0
- result = nth_byte(data, 4);
+ result = eightbyte_get_byte(data, 4, false);
//result = 0xF3
+ result = eightbyte_get_nibble(data, 10, false);
+ //result = 0x4;
+
## 8 Byte Bitfield Encoding
uint64_t data = 0;