summaryrefslogtreecommitdiff
path: root/src/portable/ohci/ohci_nxp.h
blob: de06e4569d5d1769da61bc3f2cb1e605fee6fa77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * SPDX-FileCopyrightText: Copyright (c) 2025 Ha Thach (tinyusb.org)
 * SPDX-License-Identifier: MIT
 *
 * This file is part of the TinyUSB stack.
 */
#ifndef TUSB_OHCI_NXP_H
#define TUSB_OHCI_NXP_H

#if TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)

#include "chip.h"
#define OHCI_REG   ((ohci_registers_t *) LPC_USB_BASE)

void hcd_int_enable(uint8_t rhport) {
  (void)rhport;
  NVIC_EnableIRQ(USB_IRQn);
}

void hcd_int_disable(uint8_t rhport) {
  (void)rhport;
  NVIC_DisableIRQ(USB_IRQn);
}

static void ohci_phy_init(uint8_t rhport) {
  (void) rhport;
}

#else

#include "fsl_device_registers.h"

// for LPC55 USB0 controller
#define OHCI_REG  ((ohci_registers_t *) USBFSH_BASE)

static void ohci_phy_init(uint8_t rhport) {
  (void) rhport;
}

void hcd_int_enable(uint8_t rhport) {
  (void)rhport;
  NVIC_EnableIRQ(USB0_IRQn);
}

void hcd_int_disable(uint8_t rhport) {
  (void)rhport;
  NVIC_DisableIRQ(USB0_IRQn);
}
#endif

#endif