Skip to content

Commit 3cd6401

Browse files
committed
Add register addrEndp with masking value; not yet used.
1 parent 149c258 commit 3cd6401

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/peripherals/usb.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const USB_BUF1_SHIFT = 16;
2424
const USB_BUF1_OFFSET = 64;
2525

2626
// USB Peripheral Register
27+
const ADDR_ENDP = 0x0;
2728
const MAIN_CTRL = 0x40;
2829
const SIE_STATUS = 0x50;
2930
const BUFF_STATUS = 0x58;
@@ -104,6 +105,7 @@ class USBEndpointAlarm {
104105
}
105106

106107
export class RPUSBController extends BasePeripheral {
108+
private addrEndp = 0;
107109
private mainCtrl = 0;
108110
private intRaw = 0;
109111
private intEnable = 0;
@@ -162,6 +164,8 @@ export class RPUSBController extends BasePeripheral {
162164

163165
readUint32(offset: number) {
164166
switch (offset) {
167+
case ADDR_ENDP:
168+
return this.addrEndp & 0b1111000000001111111;
165169
case MAIN_CTRL:
166170
return this.mainCtrl;
167171
case SIE_STATUS:
@@ -184,6 +188,9 @@ export class RPUSBController extends BasePeripheral {
184188

185189
writeUint32(offset: number, value: number) {
186190
switch (offset) {
191+
case ADDR_ENDP:
192+
this.addrEndp = value;
193+
break;
187194
case MAIN_CTRL:
188195
this.mainCtrl = value & (SIM_TIMING | CONTROLLER_EN | HOST_NDEVICE);
189196
if (value & CONTROLLER_EN && !(value & HOST_NDEVICE)) {

0 commit comments

Comments
 (0)