aboutsummaryrefslogtreecommitdiffstats
path: root/README.mkd
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 12:14:29 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-29 12:14:29 -0500
commit50715d3d8783dd081a403c1e580b34177ffa57bf (patch)
tree6cd32bcc3bb0738c1e7d6d8a19ae442305307da1 /README.mkd
parentf29f8a4cefbdc798c4a9aba495da7d2c0a81774c (diff)
Test parsing boolean.
Diffstat (limited to 'README.mkd')
-rw-r--r--README.mkd23
1 files changed, 23 insertions, 0 deletions
diff --git a/README.mkd b/README.mkd
index 0d8efb7..8f6ac5f 100644
--- a/README.mkd
+++ b/README.mkd
@@ -1,6 +1,29 @@
CAN Message Utilities for C
============
+## Bitfield Manipulation
+
+## CAN Signal Encoding
+
+## CAN Signal Decoding
+
+The library supports parsing floating point CAN signals as well as booleans.
+
+ uint64_t payload = 0xeb00000000000000;
+ float result = bitfield_parse_float(payload,
+ 2, // starting bit
+ 4, // width of the signal's field
+ 1001.0, // transformation factor for the signal value
+ -30000.0); // transformation offset for the signal value
+ // result == -19990.0
+
+ bool result = bitfield_parse_bool(payload,
+ 0, // starting bit
+ 1, // width of the signal's field
+ 1.0, // transformation factor for the signal value
+ 0); // transformation offset for the signal value
+ // result == true
+
## Testing
The library includes a test suite that uses the `check` C unit test library.