16 template<
size_t Bits,
typename T>
inline T
sign_extend(
const T &v) noexcept {
17 using S =
struct {
signed Val : Bits; };
18 return reinterpret_cast<const S *
>(&v)->Val;
41 this->
read_register16(a_register, reinterpret_cast<uint8_t *>(&in),
sizeof(in));
47 this->
read_register16(a_register, reinterpret_cast<uint8_t *>(&in),
sizeof(in));
54 this->
read_register16(a_register, reinterpret_cast<uint8_t *>(&in),
sizeof(in));
60 this->
read_register16(a_register, reinterpret_cast<uint8_t *>(&in),
sizeof(in));
66 this->
read_register16(a_register, reinterpret_cast<uint8_t *>(&in),
sizeof(in));
76 this->
write_register16(a_register, reinterpret_cast<uint8_t *>(&out),
sizeof(out));
81 this->
write_register16(a_register, reinterpret_cast<uint8_t *>(&out),
sizeof(out));
87 this->
write_register16(a_register, reinterpret_cast<uint8_t *>(&out),
sizeof(out));
92 this->
write_register16(a_register, reinterpret_cast<uint8_t *>(&out),
sizeof(out));
97 this->
write_register16(a_register, reinterpret_cast<uint8_t *>(&out),
sizeof(out));
T sign_extend(const T &v) noexcept
void write_s32_register16_(uint16_t a_register, int32_t value)
void write_u32_register16_(uint16_t a_register, uint32_t value)
int16_t read_s16_register16_(uint16_t a_register)
void write_u8_register16_(uint16_t a_register, uint8_t value)
void write_s10zp_register16_(uint16_t a_register, int16_t value)
void write_s24zpse_register16_(uint16_t a_register, int32_t value)
uint32_t read_u32_register16_(uint16_t a_register)
constexpr14 T convert_big_endian(T val)
Convert a value between host byte order and big endian (most significant byte first) order...
ErrorCode write_register16(uint16_t a_register, const uint8_t *data, size_t len, bool stop=true)
write an array of bytes to a specific register in the I²C device
int32_t read_s32_register16_(uint16_t a_register)
void write_u16_register16_(uint16_t a_register, uint16_t value)
uint8_t read_u8_register16_(uint16_t a_register)
Implementation of SPI Controller mode.
ErrorCode read_register16(uint16_t a_register, uint8_t *data, size_t len, bool stop=true)
reads an array of bytes from a specific register in the I²C device
uint16_t read_u16_register16_(uint16_t a_register)
int32_t read_s24zp_register16_(uint16_t a_register)