/*********************************************************************************************************//**
* @file IP/Example/ht32f1xxxx_01_usbdconf.h
* @version $Rev:: 1090 $
* @date $Date:: 2018-01-29 #$
* @brief The configuration file of USB Device Driver.
*************************************************************************************************************
* @attention
*
* Firmware Disclaimer Information
*
* 1. The customer hereby acknowledges and agrees that the program technical documentation, including the
* code, which is supplied by Holtek Semiconductor Inc., (hereinafter referred to as "HOLTEK") is the
* proprietary and confidential intellectual property of HOLTEK, and is protected by copyright law and
* other intellectual property laws.
*
* 2. The customer hereby acknowledges and agrees that the program technical documentation, including the
* code, is confidential information belonging to HOLTEK, and must not be disclosed to any third parties
* other than HOLTEK and the customer.
*
* 3. The program technical documentation, including the code, is provided "as is" and for customer reference
* only. After delivery by HOLTEK, the customer shall use the program technical documentation, including
* the code, at their own risk. HOLTEK disclaims any expressed, implied or statutory warranties, including
* the warranties of merchantability, satisfactory quality and fitness for a particular purpose.
*
*
Copyright (C) Holtek Semiconductor Inc. All rights reserved
************************************************************************************************************/
// <<< Use Configuration Wizard in Context Menu >>>
/* Define to prevent recursive inclusion -------------------------------------------------------------------*/
#ifndef __HT32F1XXXX_01_USBDCONF_H
#define __HT32F1XXXX_01_USBDCONF_H
// Enter Low Power mode when Suspended
#define USBDCORE_ENABLE_LOW_POWER (0)
//
#if (USBDCORE_ENABLE_LOW_POWER == 1)
#define USBDCore_LowPower() PWRCU_DeepSleep1(PWRCU_SLEEP_ENTRY_WFE)
#else
#define USBDCore_LowPower(...)
#endif
/*----------------------------------------------------------------------------------------------------------*/
/* USB Interrupt Enable */
/*----------------------------------------------------------------------------------------------------------*/
// USB Interrupt Setting (UIER)
// USB Global Interrupt Enable (UGIE) (Default)
// Start Of Frame Interrupt Enable (SOFIE)
// USB Reset Interrupt Enable (URSTIE) (Default)
// Resume Interrupt Enable (RSMIE) (Default)
// Suspend Interrupt Enable (SUSPIE) (Default)
// Expected Start of Frame Interrupt Enable (ESOFE)
// Control Endpoint Interrupt Enable (EP0IE) (Default)
// Endpoint1 Interrupt Enable (EP1IE)
// Endpoint2 Interrupt Enable (EP2IE)
// Endpoint3 Interrupt Enable (EP3IE)
// Endpoint4 Interrupt Enable (EP4IE)
// Endpoint5 Interrupt Enable (EP5IE)
// Endpoint6 Interrupt Enable (EP6IE)
// Endpoint7 Interrupt Enable (EP7IE)
#define _UIER (0x011D)
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint0 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Control Endpoint0 Configuration
// Endpoint Buffer Length (EPLEN)
// <8=> 8 bytes
// <16=> 16 bytes
// <32=> 32 bytes
// <64=> 64 bytes
/* Maximum: 64 Bytes */
#define _EP0LEN (64)
// Control Endpoint0 Interrupt Enable Settings (EP0IER)
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE) (Default)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE) (Default)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
// SETUP Token Packet Received Interrupt Enable (STRXIE)
// SETUP Data Packet Received Interrupt Enable (SDRXIE) (Default)
// SETUP Data Error Interrupt Enable (SDERIE)
// Zero Length Data Packet Received Interrupt Enable (ZLRXIE)
#define _EP0_IER (0x212)
//
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint1 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Endpoint1 Configuration
#define _EP1_ENABLE (0)
// Endpoint Address (EPADR)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#define _EP1_CFG_EPADR (1)
// Endpoint Enable (EPEN)
#define _EP1_CFG_EPEN_TMP (1)
// Endpoint Transfer Type
// <2=> Bulk
// <3=> Interrupt
#define _EP1_TYPR (3)
// Endpoint Direction (EPDIR)
// <1=> IN
// <0=> OUT
#define _EP1_CFG_EPDIR (1)
// Endpoint Buffer Length (EPLEN) (in byte) <4-64:4>
/* Maximum: 64 Bytes */
#define _EP1LEN_TMP (8)
// Endpoint Interrupt Enable Settings (EPIER)
// Endpoint Interrupt Enable Settings (EPIER) <0x0-0xFF:1>
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
#define _EP1_IER (0x10)
//
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint2 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Endpoint2 Configuration
#define _EP2_ENABLE (0)
// Endpoint Address (EPADR)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#define _EP2_CFG_EPADR (2)
// Endpoint Enable (EPEN)
#define _EP2_CFG_EPEN_TMP (1)
// Endpoint Transfer Type
// <2=> Bulk
// <3=> Interrupt
#define _EP2_TYPR (3)
// Endpoint Direction (EPDIR)
// <1=> IN
// <0=> OUT
#define _EP2_CFG_EPDIR (0)
// Endpoint Buffer Length (EPLEN) (in byte) <4-64:4>
/* Maximum: 64 Bytes */
#define _EP2LEN_TMP (8)
// Endpoint Interrupt Enable Settings (EPIER)
// Endpoint Interrupt Enable Settings (EPIER) <0x0-0xFF:1>
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
#define _EP2_IER (0x002)
//
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint3 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Endpoint3 Configuration
#define _EP3_ENABLE (0)
// Endpoint Address (EPADR)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#define _EP3_CFG_EPADR (3)
// Endpoint Enable (EPEN)
#define _EP3_CFG_EPEN_TMP (1)
// Endpoint Transfer Type
// <2=> Bulk
// <3=> Interrupt
#define _EP3_TYPR (3)
// Endpoint Direction (EPDIR)
// <1=> IN
// <0=> OUT
#define _EP3_CFG_EPDIR (1)
// Endpoint Buffer Length (EPLEN) (in byte) <4-64:4>
/* Maximum: 64 Bytes */
#define _EP3LEN_TMP (8)
// Endpoint Interrupt Enable Settings (EPIER)
// Endpoint Interrupt Enable Settings (EPIER) <0x0-0xFF:1>
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
#define _EP3_IER (0x10)
//
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint4 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Endpoint4 Configuration
#define _EP4_ENABLE (0)
// Endpoint Address (EPADR)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#define _EP4_CFG_EPADR (4)
// Endpoint Enable (EPEN)
#define _EP4_CFG_EPEN_TMP (1)
// Endpoint Transfer Type
// <1=> Isochronous
// <2=> Bulk
// <3=> Interrupt
#define _EP4_TYPR (3)
// Endpoint Direction (EPDIR)
// <1=> IN
// <0=> OUT
#define _EP4_CFG_EPDIR (0)
// Endpoint Buffer Length (EPLEN) (in byte) <4-1000:4>
/* Maximum: 1000 Bytes */
#define _EP4LEN_TMP (8)
// Single/Double Buffer Selection (SDBS)
// <0=> Single Buffer
// <1=> Double Buffer
#define _EP4_CFG_SDBS (0)
// Endpoint Interrupt Enable Settings (EPIER)
// Endpoint Interrupt Enable Settings (EPIER) <0x0-0xFF:1>
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
#define _EP4_IER (0x02)
//
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint5 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Endpoint5 Configuration
#define _EP5_ENABLE (0)
// Endpoint Address (EPADR)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#define _EP5_CFG_EPADR (5)
// Endpoint Enable (EPEN)
#define _EP5_CFG_EPEN_TMP (1)
// Endpoint Transfer Type
// <1=> Isochronous
// <2=> Bulk
// <3=> Interrupt
#define _EP5_TYPR (3)
// Endpoint Direction (EPDIR)
// <1=> IN
// <0=> OUT
#define _EP5_CFG_EPDIR (1)
// Endpoint Buffer Length (EPLEN) (in byte) <4-1000:4>
/* Maximum: 1000 Bytes */
#define _EP5LEN_TMP (8)
// Single/Double Buffer Selection (SDBS)
// <0=> Single Buffer
// <1=> Double Buffer
#define _EP5_CFG_SDBS (0)
// Endpoint Interrupt Enable Settings (EPIER)
// Endpoint Interrupt Enable Settings (EPIER) <0x0-0xFF:1>
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
#define _EP5_IER (0x10)
//
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint6 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Endpoint6 Configuration
#define _EP6_ENABLE (0)
// Endpoint Address (EPADR)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#define _EP6_CFG_EPADR (6)
// Endpoint Enable (EPEN)
#define _EP6_CFG_EPEN_TMP (1)
// Endpoint Transfer Type
// <1=> Isochronous
// <2=> Bulk
// <3=> Interrupt
#define _EP6_TYPR (3)
// Endpoint Direction (EPDIR)
// <1=> IN
// <0=> OUT
#define _EP6_CFG_EPDIR (0)
// Endpoint Buffer Length (EPLEN) (in byte) <4-1000:4>
/* Maximum: 1000 Bytes */
#define _EP6LEN_TMP (8)
// Single/Double Buffer Selection (SDBS)
// <0=> Single Buffer
// <1=> Double Buffer
#define _EP6_CFG_SDBS (0)
// Endpoint Interrupt Enable Settings (EPIER)
// Endpoint Interrupt Enable Settings (EPIER) <0x0-0xFF:1>
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
#define _EP6_IER (0x02)
//
//
/*----------------------------------------------------------------------------------------------------------*/
/* Endpoint7 Configuration Setting */
/*----------------------------------------------------------------------------------------------------------*/
// Endpoint7 Configuration
#define _EP7_ENABLE (0)
// Endpoint Address (EPADR)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#define _EP7_CFG_EPADR (7)
// Endpoint Enable (EPEN)
#define _EP7_CFG_EPEN_TMP (1)
// Endpoint Transfer Type
// <1=> Isochronous
// <2=> Bulk
// <3=> Interrupt
#define _EP7_TYPR (3)
// Endpoint Direction (EPDIR)
// <1=> IN
// <0=> OUT
#define _EP7_CFG_EPDIR (1)
// Endpoint Buffer Length (EPLEN) (in byte) <4-1000:4>
/* Maximum: 1000 Bytes */
#define _EP7LEN_TMP (8)
// Single/Double Buffer Selection (SDBS)
// <0=> Single Buffer
// <1=> Double Buffer
#define _EP7_CFG_SDBS (0)
// Endpoint Interrupt Enable Settings (EPIER)
// Endpoint Interrupt Enable Settings (EPIER) <0x0-0xFF:1>
// OUT Token Packet Received Interrupt Enable (OTRXIE)
// OUT Data Packet Received Interrupt Enable (ODRXIE)
// OUT Data Buffer Overrun Interrupt Enable (ODOVIE)
// IN Token Packet Received Interrupt Enable (ITRXIE)
// IN Data Packet Transmitted Interrupt Enable (IDTXIE)
// NAK Transmitted Interrupt Enable (NAKIE)
// STALL Transmitted Interrupt Enable (STLIE)
// USB Error Interrupt Enable (UERIE)
#define _EP7_IER (0x10)
//
//
#endif