mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-04 21:29:36 -04:00
Enhanced Debug -> Peripherals app to allow direct register modification (#1584)
* Add files via upload * Add files via upload * Add files via upload * Add files via upload * Clang * Clang * Tweak position of field on screen * Reverted text on Write button per reviewer feedback
This commit is contained in:
parent
10f6600f52
commit
ef92c5bc0a
15 changed files with 178 additions and 79 deletions
|
@ -116,6 +116,8 @@ bool WM8731::write(const Register reg) {
|
|||
}
|
||||
|
||||
bool WM8731::write(const address_t reg_address, const reg_t value) {
|
||||
map.w[reg_address] = value; // Save data written in case this fn is called from Debug->Peripherals app
|
||||
|
||||
const uint16_t word = (reg_address << 9) | value;
|
||||
const std::array<uint8_t, 2> values{
|
||||
static_cast<uint8_t>(word >> 8),
|
||||
|
@ -124,10 +126,15 @@ bool WM8731::write(const address_t reg_address, const reg_t value) {
|
|||
return bus.transmit(bus_address, values.data(), values.size());
|
||||
}
|
||||
|
||||
/* WM8731 is a write-only device; the read function only returns the value we last wrote */
|
||||
uint32_t WM8731::reg_read(const size_t reg_address) {
|
||||
return map.w[reg_address];
|
||||
}
|
||||
|
||||
void WM8731::reg_write(const size_t reg_address, uint32_t value) {
|
||||
write(reg_address, value);
|
||||
}
|
||||
|
||||
void WM8731::write(const LeftLineIn value) {
|
||||
map.r.left_line_in = value;
|
||||
write(Register::LeftLineIn);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue