Un-inline register read/write functions.

This commit is contained in:
Jared Boone 2015-12-13 13:18:37 -08:00
parent 041e211841
commit 2fe1285c11
2 changed files with 9 additions and 9 deletions

View File

@ -149,22 +149,22 @@ void MAX2837::flush_one(const Register reg) {
_dirty.clear(reg_num); _dirty.clear(reg_num);
} }
inline void MAX2837::write(const address_t reg_num, const reg_t value) { void MAX2837::write(const address_t reg_num, const reg_t value) {
uint16_t t = (0U << 15) | (reg_num << 10) | (value & 0x3ffU); uint16_t t = (0U << 15) | (reg_num << 10) | (value & 0x3ffU);
_target.transfer(&t, 1); _target.transfer(&t, 1);
} }
inline reg_t MAX2837::read(const address_t reg_num) { reg_t MAX2837::read(const address_t reg_num) {
uint16_t t = (1U << 15) | (reg_num << 10); uint16_t t = (1U << 15) | (reg_num << 10);
_target.transfer(&t, 1U); _target.transfer(&t, 1U);
return t & 0x3ffU; return t & 0x3ffU;
} }
inline void MAX2837::write(const Register reg, const reg_t value) { void MAX2837::write(const Register reg, const reg_t value) {
write(toUType(reg), value); write(toUType(reg), value);
} }
inline reg_t MAX2837::read(const Register reg) { reg_t MAX2837::read(const Register reg) {
return read(toUType(reg)); return read(toUType(reg));
} }

View File

@ -183,23 +183,23 @@ void RFFC507x::flush() {
} }
} }
inline void RFFC507x::write(const address_t reg_num, const spi::reg_t value) { void RFFC507x::write(const address_t reg_num, const spi::reg_t value) {
_bus.write(reg_num, value); _bus.write(reg_num, value);
} }
inline spi::reg_t RFFC507x::read(const address_t reg_num) { spi::reg_t RFFC507x::read(const address_t reg_num) {
return _bus.read(reg_num); return _bus.read(reg_num);
} }
inline void RFFC507x::write(const Register reg, const spi::reg_t value) { void RFFC507x::write(const Register reg, const spi::reg_t value) {
write(toUType(reg), value); write(toUType(reg), value);
} }
inline spi::reg_t RFFC507x::read(const Register reg) { spi::reg_t RFFC507x::read(const Register reg) {
return read(toUType(reg)); return read(toUType(reg));
} }
inline void RFFC507x::flush_one(const Register reg) { void RFFC507x::flush_one(const Register reg) {
const auto reg_num = toUType(reg); const auto reg_num = toUType(reg);
write(reg_num, _map.w[reg_num]); write(reg_num, _map.w[reg_num]);
_dirty.clear(reg_num); _dirty.clear(reg_num);