29 #ifndef SCOM_PORT_C99_H
32 #define SCOM_PORT_C99_H
55 static inline void scom_write_le32(
char *
const p,
const uint32_t data)
58 *(p+1) = (data >> 8) & 0xFF;
59 *(p+2) = (data >> 16) & 0xFF;
60 *(p+3) = (data >> 24) & 0xFF;
64 static inline uint32_t scom_read_le32(
const char *
const p)
66 return ((*p) & 0xFF) | ((*(p+1) & 0xFF) << 8) |
67 ((*(p+2) & 0xFF)<< 16) | ((*(p+3) & 0xFF) << 24) ;
71 static inline void scom_write_le16(
char *
const p,
const uint16_t data)
74 *(p+1) = (data >> 8) & 0xFF;
78 static inline uint16_t scom_read_le16(
const char *
const p)
80 return ((*(p)) & 0xFF) | ((*(p+1) & 0xFF) << 8) ;
84 static inline float scom_read_le_float(
const char *
const p)
95 val.integer = scom_read_le32(p);
101 static inline void scom_write_le_float(
char *
const p,
float data)
114 scom_write_le32(p, val.integer);