###
Explicit bit fields

This very handy feature allows to use any bit slice of a 8 bit variable in an expression. For this purpose, `cpik` provides the non-standard syntax

     var.OFFSET:SIZE

which corresponds to a slice of `SIZE` bits starting at bit number `OFFSET` of `var`.

Notice that :

1. The above syntax is not the invocation of an operator, it just a way to define a temporary sub-variable corresponding to a bit slice. As a consequence, `var` must be an existing variable identifier and cannot be an expression.
2. `OFFSET` and `SIZE` must be integer constants, or integer constant expressions. ( `OFFSET` can range from `0` to `7` and `SIZE` can range from `1` to `8`).
3. Obviously, `OFFSET+SIZE` cannot be higher than 8 because a bit field cannot cross a byte boundary.
4. A bit field that is 8 bit wide is not rejected, but is viewed as a plain byte by the compiler.

As an example, suppose we need to copy `PORTB<0-3>` (configured as input) to `PORTB<7-4>` (configured as output).

- Without using bit fields (`cpik` ) , you will probably have to write something like:

      uint8_t  x ;
      x = PORTB << 4 ;
      PORTB &= 0x0F ; // clear dest bits
      PORTB |= x ;

- Another alternative is to define a structure, and to map it to PORTB's address :

      struct
      {
        unsigned low:4,
                 hi:4 ;
      }
      my_portb@0xF81 ;

      my_portb.hi = my_portb.low ;

  Of course, this code supposes that `PORTB` is at address `0xF81`, and will fail if it is not the case anymore.

- The third solution is to use explicit bit fields: the corresponding code is really straightforward:

      PORTB.4:4 = PORTB.0:4 ;

  Of course, if you need your code to be easily reconfigurable, a couple of macro will do the job:

      #define LNIBBLE    0:4
      #define HNIBBLE    4:4

      PORTB.HNIBBLE = PORTB.LNIBBLE ;

Note that explicit bit fields are always unsigned.

cpik is now released with header files which allow to handle device registers as structures or explicit bit fields. Please see section 13.1 for details.