usb: Implement HCCA reads and writes
This commit is contained in:
@@ -58,6 +58,7 @@ typedef struct usb_t
|
|||||||
} usb_t;
|
} usb_t;
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
|
|
||||||
/* Base USB descriptor struct. */
|
/* Base USB descriptor struct. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
@@ -76,6 +77,7 @@ typedef struct
|
|||||||
uint8_t bmAttributes;
|
uint8_t bmAttributes;
|
||||||
uint8_t bMaxPower;
|
uint8_t bMaxPower;
|
||||||
} usb_desc_conf_t;
|
} usb_desc_conf_t;
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@@ -84,9 +86,7 @@ typedef struct
|
|||||||
uint16_t HccaFrameNumber;
|
uint16_t HccaFrameNumber;
|
||||||
uint16_t HccaPad1;
|
uint16_t HccaPad1;
|
||||||
uint32_t HccaDoneHead;
|
uint32_t HccaDoneHead;
|
||||||
uint32_t Reserved[29];
|
|
||||||
} usb_hcca_t;
|
} usb_hcca_t;
|
||||||
|
|
||||||
/* USB endpoint device struct. Incomplete and unused. */
|
/* USB endpoint device struct. Incomplete and unused. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@@ -300,8 +300,13 @@ ohci_set_interrupt(usb_t *dev, uint8_t bit)
|
|||||||
void
|
void
|
||||||
ohci_end_of_frame(usb_t* dev)
|
ohci_end_of_frame(usb_t* dev)
|
||||||
{
|
{
|
||||||
|
usb_hcca_t hcca;
|
||||||
/* TODO: Put endpoint and transfer descriptor processing here. */
|
/* TODO: Put endpoint and transfer descriptor processing here. */
|
||||||
|
dma_bm_read(dev->ohci_mmio[OHCI_HcHCCA].l, (uint8_t*)&hcca, sizeof(usb_hcca_t), 4);
|
||||||
|
|
||||||
dev->ohci_mmio[OHCI_HcFmNumber].w[0]++;
|
dev->ohci_mmio[OHCI_HcFmNumber].w[0]++;
|
||||||
|
|
||||||
|
dma_bm_write(dev->ohci_mmio[OHCI_HcHCCA].l, (uint8_t*)&hcca, sizeof(usb_hcca_t), 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user