ocaml-attic / ocaml-cstruct

Map OCaml arrays onto C-like structs via a syntax extension, and generate functions to convert to-and-from native OCaml values.
http://www.openmirage.org/
10 stars 2 forks source link

Bitfields #15

Open chambart opened 11 years ago

chambart commented 11 years ago

A simple way to acces fields of a bitfield would be usefull.

cstruct some_struct {
  uint2_t  field1;
  uint6_t  field2;
  uint8_t  some_byte;
  uint16_t rest
} as little_endian
avsm commented 11 years ago

This is turning into a full C implementation very rapidly ;-)

On 22 Oct 2013, at 16:38, Pierre Chambart notifications@github.com wrote:

A simple way to acces fields of a bitfield would be usefull.

cstruct some_struct { uint2_t field1; uint6_t field2; uint8_t some_byte; uint16_t rest } as little_endian — Reply to this email directly or view it on GitHub.