summaryrefslogtreecommitdiffhomepage
path: root/digital/avr/modules/utils/utils.txt
diff options
context:
space:
mode:
authorNicolas Schodet2008-06-17 22:57:36 +0200
committerNicolas Schodet2008-06-17 22:57:36 +0200
commitb56dcf06e561729f87670d32f3b75c4aeddfee29 (patch)
treead27af7f888088605ed2f15671cbc31ed45fd84f /digital/avr/modules/utils/utils.txt
parent6d80ec02ad6e02058b80e8cb3072d66350e82681 (diff)
* digital/avr/modules/utils:
- updated doc.
Diffstat (limited to 'digital/avr/modules/utils/utils.txt')
-rw-r--r--digital/avr/modules/utils/utils.txt32
1 files changed, 28 insertions, 4 deletions
diff --git a/digital/avr/modules/utils/utils.txt b/digital/avr/modules/utils/utils.txt
index 4aa9a571..23c92a5c 100644
--- a/digital/avr/modules/utils/utils.txt
+++ b/digital/avr/modules/utils/utils.txt
@@ -1,6 +1,30 @@
-*Title: Module AVR Utilitaires
-*Author: Ni
+==================
+ Utils AVR module
+==================
+:Author: Nicolas Schodet
-* Doc
+Introduction
+============
-*File: utils.exd
+This module provides general purpose utilities.
+
+Byte packing/unpacking
+======================
+
+Theses functions are here to override bad code production with avr-gcc with the
+classic shift idiom.
+
+Functions which unpack from a large type to a smaller type take a ``pos``
+parameter which is the position of the byte or word to extract from the large
+type. Small values are for LSB. For example, ``v32_to_v8 (a, 0)`` will
+extract the least significant byte from ``a``.
+
+Functions which pack from a small type to a larger type take as many small
+type values as needed to fill the large type number. The first argument is
+the MSB. For example, ``v8_to_v32 (0x12, 0x34, 0x56, 0x78)`` will return
+``0x12345678``.
+
+API
+===
+
+.. include:: utils.exd