|
nrfxlib API 2.8.99
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
7#ifndef __OSAL_PACKED_H__
8#define __OSAL_PACKED_H__
12#define READ_LE_8(_x) (((uint8_t )(((uint8_t *)(_x))[0] << 0x00)))
13#define READ_LE_16(_x) (((uint16_t)(((uint8_t *)(_x))[0] << 0x00)) | \
14 ((uint16_t)(((uint8_t *)(_x))[1] << 0x08)))
15#define READ_LE_32(_x) (((uint32_t)(((uint8_t *)(_x))[0] << 0x00)) | \
16 ((uint32_t)(((uint8_t *)(_x))[1] << 0x08)) | \
17 ((uint32_t)(((uint8_t *)(_x))[2] << 0x10)) | \
18 ((uint32_t)(((uint8_t *)(_x))[3] << 0x18)))
19#define READ_LE_64(_x) (((uint64_t)(((uint8_t *)(_x))[0] << 0x00)) | \
20 ((uint64_t)(((uint8_t *)(_x))[1] << 0x08)) | \
21 ((uint64_t)(((uint8_t *)(_x))[2] << 0x10)) | \
22 ((uint64_t)(((uint8_t *)(_x))[3] << 0x18)) | \
23 ((uint64_t)(((uint8_t *)(_x))[4] << 0x20)) | \
24 ((uint64_t)(((uint8_t *)(_x))[5] << 0x28)) | \
25 ((uint64_t)(((uint8_t *)(_x))[6] << 0x30)) | \
26 ((uint64_t)(((uint8_t *)(_x))[7] << 0x38)))
28#define WRITE_LE_8(_x, _y) do { \
29 ((uint8_t *)(_x))[0] = (((uint8_t )(_y)) >> 0x00) & 0xFF; \
31#define WRITE_LE_16(_x, _y) do { \
32 ((uint8_t *)(_x))[0] = (((uint16_t)(_y)) >> 0x00) & 0xFF; \
33 ((uint8_t *)(_x))[1] = (((uint16_t)(_y)) >> 0x08) & 0xFF; \
35#define WRITE_LE_32(_x, _y) do { \
36 ((uint8_t *)(_x))[0] = (((uint32_t)(_y)) >> 0x00) & 0xFF; \
37 ((uint8_t *)(_x))[1] = (((uint32_t)(_y)) >> 0x08) & 0xFF; \
38 ((uint8_t *)(_x))[2] = (((uint32_t)(_y)) >> 0x10) & 0xFF; \
39 ((uint8_t *)(_x))[3] = (((uint32_t)(_y)) >> 0x18) & 0xFF; \
41#define WRITE_LE_64(_x, _y) do { \
42 ((uint8_t *)(_x))[0] = (((uint32_t)(_y)) >> 0x00) & 0xFF; \
43 ((uint8_t *)(_x))[1] = (((uint32_t)(_y)) >> 0x08) & 0xFF; \
44 ((uint8_t *)(_x))[2] = (((uint32_t)(_y)) >> 0x10) & 0xFF; \
45 ((uint8_t *)(_x))[3] = (((uint32_t)(_y)) >> 0x18) & 0xFF; \
46 ((uint8_t *)(_x))[4] = (((uint32_t)(_y)) >> 0x20) & 0xFF; \
47 ((uint8_t *)(_x))[5] = (((uint32_t)(_y)) >> 0x28) & 0xFF; \
48 ((uint8_t *)(_x))[6] = (((uint32_t)(_y)) >> 0x30) & 0xFF; \
49 ((uint8_t *)(_x))[7] = (((uint32_t)(_y)) >> 0x38) & 0xFF; \