fusee_cpp: implement erista pll selection logic for mtc

This commit is contained in:
Michael Scire 2021-08-24 22:30:08 -07:00 committed by SciresM
parent d2f3b806d6
commit d7192343d8
4 changed files with 207 additions and 1 deletions

View file

@ -56,6 +56,12 @@ namespace ams::reg {
return (EncodeMask(masks) | ...);
}
template<typename IntType> requires UnsignedNonConstIntegral<IntType>
constexpr ALWAYS_INLINE IntType GetField(const IntType &value, const BitsMask mask) { return (value & EncodeMask(mask)) >> GetOffset(mask); }
template<typename IntType> requires UnsignedNonConstIntegral<IntType>
constexpr ALWAYS_INLINE void SetField(IntType &value, const BitsValue v) { value = (value & ~EncodeMask(v)) | EncodeValue(v); }
template<typename IntType> requires UnsignedNonConstIntegral<IntType>
ALWAYS_INLINE void Write(volatile IntType *reg, std::type_identity_t<IntType> val) { *reg = val; }