Prepare NEWS file for next release
[libmodbus.git] / docs / modbus_get_byte_from_bits.md
blobd68a5bb2d5d194480332980f601949dd80680cf2
1 # modbus_get_byte_from_bits
3 ## Name
5 modbus_get_byte_from_bits - get the value from many bits
7 ## Synopsis
9 ```c
10 uint8_t modbus_get_byte_from_bits(const uint8_t *src, int index, unsigned int nb_bits);
11 ```
13 ## Description
15 The *modbus_get_byte_from_bits()* function shall extract a value from many
16 bits. All `nb_bits` bits from `src` at position `index` will be read as a
17 single value. To obtain a full byte, set `nb_bits` to 8.
19 ## Return value
21 The function shall return a byte containing the bits read.
23 ## See also
25 - [modbus_set_bits_from_byte](modbus_set_bits_from_byte.md)
26 - [modbus_set_bits_from_bytes](modbus_set_bits_from_bytes.md)