mirror of
https://github.com/fhgwright/SCSI2SD.git
synced 2024-06-11 05:29:27 +00:00
More compatibility and bug fixes.
- Maximum sector size increased to 8192 - Fix for REQUEST SENSE to support Ensoniq ASR-10 - Fix to configurable sector sizes
This commit is contained in:
parent
767f12e481
commit
db9c316019
|
@ -1,9 +1,11 @@
|
|||
201404?? 3.4
|
||||
20140418 3.4
|
||||
- Critical fix for writes when using non-standard block sizes.
|
||||
- Fix to ensure SCSI phase bits are set atomically.
|
||||
- Always return the requested number of bytes for a REQUEST SENSE command
|
||||
This is required to support the Ensoniq ASR-10.
|
||||
- Decreased (unused) heap and stack sizes to prepare for a memory
|
||||
write cache
|
||||
- Increased the maximum sector size to 8192 bytes.
|
||||
|
||||
20140416 3.3
|
||||
- Fix to SCSI Reset handling to avoid lockups
|
||||
|
|
|
@ -68,3 +68,5 @@ Users have reported success on these systems:
|
|||
EMU Emulator E4X with EOS 3.00b and E6400 (classic) with Eos 4.01
|
||||
Ensoniq ASR-X, ASR-10 (from v3.4, 2GB size limit)
|
||||
HP 16601A logic analyzer
|
||||
Apple IIgs using Apple II High Speed SCSI controller card (from v3.3)
|
||||
Symbolics List Machine XL1200, using 1280 byte sectors (from v3.4)
|
||||
|
|
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Bootloadable_1.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CFG_EEPROM.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CFG_EEPROM.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CFG_EEPROM.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CFG_EEPROM.h
Normal file → Executable file
|
@ -10,7 +10,7 @@ define symbol __ICFEDIT_region_RAM_start__ = 0x20000000 - (32768 / 2);
|
|||
define symbol __ICFEDIT_region_RAM_end__ = 0x20000000 + (32768 / 2) - 1;
|
||||
/*-Sizes-*/
|
||||
define symbol __ICFEDIT_size_cstack__ = 0x2000;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x0256;
|
||||
define symbol __ICFEDIT_size_heap__ = 0x0400;
|
||||
/**** End of ICF editor section. ###ICF###*/
|
||||
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ APPLICATION APPL_START (CY_FLASH_SIZE - APPL_START)
|
|||
.ANY (+RW, +ZI)
|
||||
}
|
||||
|
||||
ARM_LIB_HEAP (0x20000000 + (32768 / 2) - 0x0256 - 0x2000) EMPTY 0x0256
|
||||
ARM_LIB_HEAP (0x20000000 + (32768 / 2) - 0x0400 - 0x2000) EMPTY 0x0400
|
||||
{
|
||||
}
|
||||
|
||||
|
|
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Cm3Start.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Cm3Start.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyBootAsmGnu.s
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyBootAsmGnu.s
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyBootAsmIar.s
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyBootAsmIar.s
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyBootAsmRv.s
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyBootAsmRv.s
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyDmac.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyDmac.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyDmac.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyDmac.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyFlash.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyFlash.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyFlash.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyFlash.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyLib.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyLib.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyLib.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CyLib.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CySpc.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CySpc.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CySpc.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/CySpc.h
Normal file → Executable file
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_CMD_TIMER.c
|
||||
* File Name: Debug_Timer.c
|
||||
* Version 2.50
|
||||
*
|
||||
* Description:
|
||||
|
@ -21,13 +21,13 @@
|
|||
* the software package with which this file was provided.
|
||||
********************************************************************************/
|
||||
|
||||
#include "SCSI_CMD_TIMER.h"
|
||||
#include "Debug_Timer.h"
|
||||
|
||||
uint8 SCSI_CMD_TIMER_initVar = 0u;
|
||||
uint8 Debug_Timer_initVar = 0u;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_Init
|
||||
* Function Name: Debug_Timer_Init
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -40,130 +40,130 @@ uint8 SCSI_CMD_TIMER_initVar = 0u;
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_Init(void)
|
||||
void Debug_Timer_Init(void)
|
||||
{
|
||||
#if(!SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
#if(!Debug_Timer_UsingFixedFunction)
|
||||
/* Interrupt State Backup for Critical Region*/
|
||||
uint8 SCSI_CMD_TIMER_interruptState;
|
||||
uint8 Debug_Timer_interruptState;
|
||||
#endif /* Interrupt state back up for Fixed Function only */
|
||||
|
||||
#if (SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
#if (Debug_Timer_UsingFixedFunction)
|
||||
/* Clear all bits but the enable bit (if it's already set) for Timer operation */
|
||||
SCSI_CMD_TIMER_CONTROL &= SCSI_CMD_TIMER_CTRL_ENABLE;
|
||||
Debug_Timer_CONTROL &= Debug_Timer_CTRL_ENABLE;
|
||||
|
||||
/* Clear the mode bits for continuous run mode */
|
||||
#if (CY_PSOC5A)
|
||||
SCSI_CMD_TIMER_CONTROL2 &= ((uint8)(~SCSI_CMD_TIMER_CTRL_MODE_MASK));
|
||||
Debug_Timer_CONTROL2 &= ((uint8)(~Debug_Timer_CTRL_MODE_MASK));
|
||||
#endif /* Clear bits in CONTROL2 only in PSOC5A */
|
||||
|
||||
#if (CY_PSOC3 || CY_PSOC5LP)
|
||||
SCSI_CMD_TIMER_CONTROL3 &= ((uint8)(~SCSI_CMD_TIMER_CTRL_MODE_MASK));
|
||||
Debug_Timer_CONTROL3 &= ((uint8)(~Debug_Timer_CTRL_MODE_MASK));
|
||||
#endif /* CONTROL3 register exists only in PSoC3 OR PSoC5LP */
|
||||
|
||||
/* Check if One Shot mode is enabled i.e. RunMode !=0*/
|
||||
#if (SCSI_CMD_TIMER_RunModeUsed != 0x0u)
|
||||
#if (Debug_Timer_RunModeUsed != 0x0u)
|
||||
/* Set 3rd bit of Control register to enable one shot mode */
|
||||
SCSI_CMD_TIMER_CONTROL |= 0x04u;
|
||||
Debug_Timer_CONTROL |= 0x04u;
|
||||
#endif /* One Shot enabled only when RunModeUsed is not Continuous*/
|
||||
|
||||
#if (SCSI_CMD_TIMER_RunModeUsed == 2)
|
||||
#if (Debug_Timer_RunModeUsed == 2)
|
||||
#if (CY_PSOC5A)
|
||||
/* Set last 2 bits of control2 register if one shot(halt on
|
||||
interrupt) is enabled*/
|
||||
SCSI_CMD_TIMER_CONTROL2 |= 0x03u;
|
||||
Debug_Timer_CONTROL2 |= 0x03u;
|
||||
#endif /* Set One-Shot Halt on Interrupt bit in CONTROL2 for PSoC5A */
|
||||
|
||||
#if (CY_PSOC3 || CY_PSOC5LP)
|
||||
/* Set last 2 bits of control3 register if one shot(halt on
|
||||
interrupt) is enabled*/
|
||||
SCSI_CMD_TIMER_CONTROL3 |= 0x03u;
|
||||
Debug_Timer_CONTROL3 |= 0x03u;
|
||||
#endif /* Set One-Shot Halt on Interrupt bit in CONTROL3 for PSoC3 or PSoC5LP */
|
||||
|
||||
#endif /* Remove section if One Shot Halt on Interrupt is not enabled */
|
||||
|
||||
#if (SCSI_CMD_TIMER_UsingHWEnable != 0)
|
||||
#if (Debug_Timer_UsingHWEnable != 0)
|
||||
#if (CY_PSOC5A)
|
||||
/* Set the default Run Mode of the Timer to Continuous */
|
||||
SCSI_CMD_TIMER_CONTROL2 |= SCSI_CMD_TIMER_CTRL_MODE_PULSEWIDTH;
|
||||
Debug_Timer_CONTROL2 |= Debug_Timer_CTRL_MODE_PULSEWIDTH;
|
||||
#endif /* Set Continuous Run Mode in CONTROL2 for PSoC5A */
|
||||
|
||||
#if (CY_PSOC3 || CY_PSOC5LP)
|
||||
/* Clear and Set ROD and COD bits of CFG2 register */
|
||||
SCSI_CMD_TIMER_CONTROL3 &= ((uint8)(~SCSI_CMD_TIMER_CTRL_RCOD_MASK));
|
||||
SCSI_CMD_TIMER_CONTROL3 |= SCSI_CMD_TIMER_CTRL_RCOD;
|
||||
Debug_Timer_CONTROL3 &= ((uint8)(~Debug_Timer_CTRL_RCOD_MASK));
|
||||
Debug_Timer_CONTROL3 |= Debug_Timer_CTRL_RCOD;
|
||||
|
||||
/* Clear and Enable the HW enable bit in CFG2 register */
|
||||
SCSI_CMD_TIMER_CONTROL3 &= ((uint8)(~SCSI_CMD_TIMER_CTRL_ENBL_MASK));
|
||||
SCSI_CMD_TIMER_CONTROL3 |= SCSI_CMD_TIMER_CTRL_ENBL;
|
||||
Debug_Timer_CONTROL3 &= ((uint8)(~Debug_Timer_CTRL_ENBL_MASK));
|
||||
Debug_Timer_CONTROL3 |= Debug_Timer_CTRL_ENBL;
|
||||
|
||||
/* Set the default Run Mode of the Timer to Continuous */
|
||||
SCSI_CMD_TIMER_CONTROL3 |= SCSI_CMD_TIMER_CTRL_MODE_CONTINUOUS;
|
||||
Debug_Timer_CONTROL3 |= Debug_Timer_CTRL_MODE_CONTINUOUS;
|
||||
#endif /* Set Continuous Run Mode in CONTROL3 for PSoC3ES3 or PSoC5A */
|
||||
|
||||
#endif /* Configure Run Mode with hardware enable */
|
||||
|
||||
/* Clear and Set SYNCTC and SYNCCMP bits of RT1 register */
|
||||
SCSI_CMD_TIMER_RT1 &= ((uint8)(~SCSI_CMD_TIMER_RT1_MASK));
|
||||
SCSI_CMD_TIMER_RT1 |= SCSI_CMD_TIMER_SYNC;
|
||||
Debug_Timer_RT1 &= ((uint8)(~Debug_Timer_RT1_MASK));
|
||||
Debug_Timer_RT1 |= Debug_Timer_SYNC;
|
||||
|
||||
/*Enable DSI Sync all all inputs of the Timer*/
|
||||
SCSI_CMD_TIMER_RT1 &= ((uint8)(~SCSI_CMD_TIMER_SYNCDSI_MASK));
|
||||
SCSI_CMD_TIMER_RT1 |= SCSI_CMD_TIMER_SYNCDSI_EN;
|
||||
Debug_Timer_RT1 &= ((uint8)(~Debug_Timer_SYNCDSI_MASK));
|
||||
Debug_Timer_RT1 |= Debug_Timer_SYNCDSI_EN;
|
||||
|
||||
/* Set the IRQ to use the status register interrupts */
|
||||
SCSI_CMD_TIMER_CONTROL2 |= SCSI_CMD_TIMER_CTRL2_IRQ_SEL;
|
||||
Debug_Timer_CONTROL2 |= Debug_Timer_CTRL2_IRQ_SEL;
|
||||
#endif /* Configuring registers of fixed function implementation */
|
||||
|
||||
/* Set Initial values from Configuration */
|
||||
SCSI_CMD_TIMER_WritePeriod(SCSI_CMD_TIMER_INIT_PERIOD);
|
||||
SCSI_CMD_TIMER_WriteCounter(SCSI_CMD_TIMER_INIT_PERIOD);
|
||||
Debug_Timer_WritePeriod(Debug_Timer_INIT_PERIOD);
|
||||
Debug_Timer_WriteCounter(Debug_Timer_INIT_PERIOD);
|
||||
|
||||
#if (SCSI_CMD_TIMER_UsingHWCaptureCounter)/* Capture counter is enabled */
|
||||
SCSI_CMD_TIMER_CAPTURE_COUNT_CTRL |= SCSI_CMD_TIMER_CNTR_ENABLE;
|
||||
SCSI_CMD_TIMER_SetCaptureCount(SCSI_CMD_TIMER_INIT_CAPTURE_COUNT);
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)/* Capture counter is enabled */
|
||||
Debug_Timer_CAPTURE_COUNT_CTRL |= Debug_Timer_CNTR_ENABLE;
|
||||
Debug_Timer_SetCaptureCount(Debug_Timer_INIT_CAPTURE_COUNT);
|
||||
#endif /* Configure capture counter value */
|
||||
|
||||
#if (!SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
#if (SCSI_CMD_TIMER_SoftwareCaptureMode)
|
||||
SCSI_CMD_TIMER_SetCaptureMode(SCSI_CMD_TIMER_INIT_CAPTURE_MODE);
|
||||
#if (!Debug_Timer_UsingFixedFunction)
|
||||
#if (Debug_Timer_SoftwareCaptureMode)
|
||||
Debug_Timer_SetCaptureMode(Debug_Timer_INIT_CAPTURE_MODE);
|
||||
#endif /* Set Capture Mode for UDB implementation if capture mode is software controlled */
|
||||
|
||||
#if (SCSI_CMD_TIMER_SoftwareTriggerMode)
|
||||
if (0u == (SCSI_CMD_TIMER_CONTROL & SCSI_CMD_TIMER__B_TIMER__TM_SOFTWARE))
|
||||
#if (Debug_Timer_SoftwareTriggerMode)
|
||||
if (0u == (Debug_Timer_CONTROL & Debug_Timer__B_TIMER__TM_SOFTWARE))
|
||||
{
|
||||
SCSI_CMD_TIMER_SetTriggerMode(SCSI_CMD_TIMER_INIT_TRIGGER_MODE);
|
||||
Debug_Timer_SetTriggerMode(Debug_Timer_INIT_TRIGGER_MODE);
|
||||
}
|
||||
#endif /* Set trigger mode for UDB Implementation if trigger mode is software controlled */
|
||||
|
||||
/* CyEnterCriticalRegion and CyExitCriticalRegion are used to mark following region critical*/
|
||||
/* Enter Critical Region*/
|
||||
SCSI_CMD_TIMER_interruptState = CyEnterCriticalSection();
|
||||
Debug_Timer_interruptState = CyEnterCriticalSection();
|
||||
|
||||
/* Use the interrupt output of the status register for IRQ output */
|
||||
SCSI_CMD_TIMER_STATUS_AUX_CTRL |= SCSI_CMD_TIMER_STATUS_ACTL_INT_EN_MASK;
|
||||
Debug_Timer_STATUS_AUX_CTRL |= Debug_Timer_STATUS_ACTL_INT_EN_MASK;
|
||||
|
||||
/* Exit Critical Region*/
|
||||
CyExitCriticalSection(SCSI_CMD_TIMER_interruptState);
|
||||
CyExitCriticalSection(Debug_Timer_interruptState);
|
||||
|
||||
#if (SCSI_CMD_TIMER_EnableTriggerMode)
|
||||
SCSI_CMD_TIMER_EnableTrigger();
|
||||
#if (Debug_Timer_EnableTriggerMode)
|
||||
Debug_Timer_EnableTrigger();
|
||||
#endif /* Set Trigger enable bit for UDB implementation in the control register*/
|
||||
|
||||
#if (SCSI_CMD_TIMER_InterruptOnCaptureCount)
|
||||
#if (!SCSI_CMD_TIMER_ControlRegRemoved)
|
||||
SCSI_CMD_TIMER_SetInterruptCount(SCSI_CMD_TIMER_INIT_INT_CAPTURE_COUNT);
|
||||
#if (Debug_Timer_InterruptOnCaptureCount)
|
||||
#if (!Debug_Timer_ControlRegRemoved)
|
||||
Debug_Timer_SetInterruptCount(Debug_Timer_INIT_INT_CAPTURE_COUNT);
|
||||
#endif /* Set interrupt count in control register if control register is not removed */
|
||||
#endif /*Set interrupt count in UDB implementation if interrupt count feature is checked.*/
|
||||
|
||||
SCSI_CMD_TIMER_ClearFIFO();
|
||||
Debug_Timer_ClearFIFO();
|
||||
#endif /* Configure additional features of UDB implementation */
|
||||
|
||||
SCSI_CMD_TIMER_SetInterruptMode(SCSI_CMD_TIMER_INIT_INTERRUPT_MODE);
|
||||
Debug_Timer_SetInterruptMode(Debug_Timer_INIT_INTERRUPT_MODE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_Enable
|
||||
* Function Name: Debug_Timer_Enable
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -176,23 +176,23 @@ void SCSI_CMD_TIMER_Init(void)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_Enable(void)
|
||||
void Debug_Timer_Enable(void)
|
||||
{
|
||||
/* Globally Enable the Fixed Function Block chosen */
|
||||
#if (SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
SCSI_CMD_TIMER_GLOBAL_ENABLE |= SCSI_CMD_TIMER_BLOCK_EN_MASK;
|
||||
SCSI_CMD_TIMER_GLOBAL_STBY_ENABLE |= SCSI_CMD_TIMER_BLOCK_STBY_EN_MASK;
|
||||
#if (Debug_Timer_UsingFixedFunction)
|
||||
Debug_Timer_GLOBAL_ENABLE |= Debug_Timer_BLOCK_EN_MASK;
|
||||
Debug_Timer_GLOBAL_STBY_ENABLE |= Debug_Timer_BLOCK_STBY_EN_MASK;
|
||||
#endif /* Set Enable bit for enabling Fixed function timer*/
|
||||
|
||||
/* Remove assignment if control register is removed */
|
||||
#if (!SCSI_CMD_TIMER_ControlRegRemoved || SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
SCSI_CMD_TIMER_CONTROL |= SCSI_CMD_TIMER_CTRL_ENABLE;
|
||||
#if (!Debug_Timer_ControlRegRemoved || Debug_Timer_UsingFixedFunction)
|
||||
Debug_Timer_CONTROL |= Debug_Timer_CTRL_ENABLE;
|
||||
#endif /* Remove assignment if control register is removed */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_Start
|
||||
* Function Name: Debug_Timer_Start
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -207,26 +207,26 @@ void SCSI_CMD_TIMER_Enable(void)
|
|||
* void
|
||||
*
|
||||
* Global variables:
|
||||
* SCSI_CMD_TIMER_initVar: Is modified when this function is called for the
|
||||
* Debug_Timer_initVar: Is modified when this function is called for the
|
||||
* first time. Is used to ensure that initialization happens only once.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_Start(void)
|
||||
void Debug_Timer_Start(void)
|
||||
{
|
||||
if(SCSI_CMD_TIMER_initVar == 0u)
|
||||
if(Debug_Timer_initVar == 0u)
|
||||
{
|
||||
SCSI_CMD_TIMER_Init();
|
||||
Debug_Timer_Init();
|
||||
|
||||
SCSI_CMD_TIMER_initVar = 1u; /* Clear this bit for Initialization */
|
||||
Debug_Timer_initVar = 1u; /* Clear this bit for Initialization */
|
||||
}
|
||||
|
||||
/* Enable the Timer */
|
||||
SCSI_CMD_TIMER_Enable();
|
||||
Debug_Timer_Enable();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_Stop
|
||||
* Function Name: Debug_Timer_Stop
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -243,23 +243,23 @@ void SCSI_CMD_TIMER_Start(void)
|
|||
* has no effect on the operation of the timer.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_Stop(void)
|
||||
void Debug_Timer_Stop(void)
|
||||
{
|
||||
/* Disable Timer */
|
||||
#if(!SCSI_CMD_TIMER_ControlRegRemoved || SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
SCSI_CMD_TIMER_CONTROL &= ((uint8)(~SCSI_CMD_TIMER_CTRL_ENABLE));
|
||||
#if(!Debug_Timer_ControlRegRemoved || Debug_Timer_UsingFixedFunction)
|
||||
Debug_Timer_CONTROL &= ((uint8)(~Debug_Timer_CTRL_ENABLE));
|
||||
#endif /* Remove assignment if control register is removed */
|
||||
|
||||
/* Globally disable the Fixed Function Block chosen */
|
||||
#if (SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
SCSI_CMD_TIMER_GLOBAL_ENABLE &= ((uint8)(~SCSI_CMD_TIMER_BLOCK_EN_MASK));
|
||||
SCSI_CMD_TIMER_GLOBAL_STBY_ENABLE &= ((uint8)(~SCSI_CMD_TIMER_BLOCK_STBY_EN_MASK));
|
||||
#if (Debug_Timer_UsingFixedFunction)
|
||||
Debug_Timer_GLOBAL_ENABLE &= ((uint8)(~Debug_Timer_BLOCK_EN_MASK));
|
||||
Debug_Timer_GLOBAL_STBY_ENABLE &= ((uint8)(~Debug_Timer_BLOCK_STBY_EN_MASK));
|
||||
#endif /* Disable global enable for the Timer Fixed function block to stop the Timer*/
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_SetInterruptMode
|
||||
* Function Name: Debug_Timer_SetInterruptMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -275,14 +275,14 @@ void SCSI_CMD_TIMER_Stop(void)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_SetInterruptMode(uint8 interruptMode)
|
||||
void Debug_Timer_SetInterruptMode(uint8 interruptMode)
|
||||
{
|
||||
SCSI_CMD_TIMER_STATUS_MASK = interruptMode;
|
||||
Debug_Timer_STATUS_MASK = interruptMode;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_SoftwareCapture
|
||||
* Function Name: Debug_Timer_SoftwareCapture
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -298,16 +298,16 @@ void SCSI_CMD_TIMER_SetInterruptMode(uint8 interruptMode)
|
|||
* An existing hardware capture could be overwritten.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_SoftwareCapture(void)
|
||||
void Debug_Timer_SoftwareCapture(void)
|
||||
{
|
||||
/* Generate a software capture by reading the counter register */
|
||||
(void)SCSI_CMD_TIMER_COUNTER_LSB;
|
||||
(void)Debug_Timer_COUNTER_LSB;
|
||||
/* Capture Data is now in the FIFO */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ReadStatusRegister
|
||||
* Function Name: Debug_Timer_ReadStatusRegister
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -325,17 +325,17 @@ void SCSI_CMD_TIMER_SoftwareCapture(void)
|
|||
* Status register bits may be clear on read.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_CMD_TIMER_ReadStatusRegister(void)
|
||||
uint8 Debug_Timer_ReadStatusRegister(void)
|
||||
{
|
||||
return (SCSI_CMD_TIMER_STATUS);
|
||||
return (Debug_Timer_STATUS);
|
||||
}
|
||||
|
||||
|
||||
#if (!SCSI_CMD_TIMER_ControlRegRemoved) /* Remove API if control register is removed */
|
||||
#if (!Debug_Timer_ControlRegRemoved) /* Remove API if control register is removed */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ReadControlRegister
|
||||
* Function Name: Debug_Timer_ReadControlRegister
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -348,14 +348,14 @@ uint8 SCSI_CMD_TIMER_ReadStatusRegister(void)
|
|||
* The contents of the control register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_CMD_TIMER_ReadControlRegister(void)
|
||||
uint8 Debug_Timer_ReadControlRegister(void)
|
||||
{
|
||||
return ((uint8)SCSI_CMD_TIMER_CONTROL);
|
||||
return ((uint8)Debug_Timer_CONTROL);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_WriteControlRegister
|
||||
* Function Name: Debug_Timer_WriteControlRegister
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -367,15 +367,15 @@ uint8 SCSI_CMD_TIMER_ReadControlRegister(void)
|
|||
* Return:
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_WriteControlRegister(uint8 control)
|
||||
void Debug_Timer_WriteControlRegister(uint8 control)
|
||||
{
|
||||
SCSI_CMD_TIMER_CONTROL = control;
|
||||
Debug_Timer_CONTROL = control;
|
||||
}
|
||||
#endif /* Remove API if control register is removed */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ReadPeriod
|
||||
* Function Name: Debug_Timer_ReadPeriod
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -388,18 +388,18 @@ void SCSI_CMD_TIMER_WriteControlRegister(uint8 control)
|
|||
* The present value of the counter.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint16 SCSI_CMD_TIMER_ReadPeriod(void)
|
||||
uint16 Debug_Timer_ReadPeriod(void)
|
||||
{
|
||||
#if(SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
return ((uint16)CY_GET_REG16(SCSI_CMD_TIMER_PERIOD_LSB_PTR));
|
||||
#if(Debug_Timer_UsingFixedFunction)
|
||||
return ((uint16)CY_GET_REG16(Debug_Timer_PERIOD_LSB_PTR));
|
||||
#else
|
||||
return (CY_GET_REG16(SCSI_CMD_TIMER_PERIOD_LSB_PTR));
|
||||
#endif /* (SCSI_CMD_TIMER_UsingFixedFunction) */
|
||||
return (CY_GET_REG16(Debug_Timer_PERIOD_LSB_PTR));
|
||||
#endif /* (Debug_Timer_UsingFixedFunction) */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_WritePeriod
|
||||
* Function Name: Debug_Timer_WritePeriod
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -414,19 +414,19 @@ uint16 SCSI_CMD_TIMER_ReadPeriod(void)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_WritePeriod(uint16 period)
|
||||
void Debug_Timer_WritePeriod(uint16 period)
|
||||
{
|
||||
#if(SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
#if(Debug_Timer_UsingFixedFunction)
|
||||
uint16 period_temp = (uint16)period;
|
||||
CY_SET_REG16(SCSI_CMD_TIMER_PERIOD_LSB_PTR, period_temp);
|
||||
CY_SET_REG16(Debug_Timer_PERIOD_LSB_PTR, period_temp);
|
||||
#else
|
||||
CY_SET_REG16(SCSI_CMD_TIMER_PERIOD_LSB_PTR, period);
|
||||
CY_SET_REG16(Debug_Timer_PERIOD_LSB_PTR, period);
|
||||
#endif /*Write Period value with appropriate resolution suffix depending on UDB or fixed function implementation */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ReadCapture
|
||||
* Function Name: Debug_Timer_ReadCapture
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -439,18 +439,18 @@ void SCSI_CMD_TIMER_WritePeriod(uint16 period)
|
|||
* Present Capture value.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint16 SCSI_CMD_TIMER_ReadCapture(void)
|
||||
uint16 Debug_Timer_ReadCapture(void)
|
||||
{
|
||||
#if(SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
return ((uint16)CY_GET_REG16(SCSI_CMD_TIMER_CAPTURE_LSB_PTR));
|
||||
#if(Debug_Timer_UsingFixedFunction)
|
||||
return ((uint16)CY_GET_REG16(Debug_Timer_CAPTURE_LSB_PTR));
|
||||
#else
|
||||
return (CY_GET_REG16(SCSI_CMD_TIMER_CAPTURE_LSB_PTR));
|
||||
#endif /* (SCSI_CMD_TIMER_UsingFixedFunction) */
|
||||
return (CY_GET_REG16(Debug_Timer_CAPTURE_LSB_PTR));
|
||||
#endif /* (Debug_Timer_UsingFixedFunction) */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_WriteCounter
|
||||
* Function Name: Debug_Timer_WriteCounter
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -463,23 +463,23 @@ uint16 SCSI_CMD_TIMER_ReadCapture(void)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_WriteCounter(uint16 counter) \
|
||||
void Debug_Timer_WriteCounter(uint16 counter) \
|
||||
|
||||
{
|
||||
#if(SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
#if(Debug_Timer_UsingFixedFunction)
|
||||
/* This functionality is removed until a FixedFunction HW update to
|
||||
* allow this register to be written
|
||||
*/
|
||||
CY_SET_REG16(SCSI_CMD_TIMER_COUNTER_LSB_PTR, (uint16)counter);
|
||||
CY_SET_REG16(Debug_Timer_COUNTER_LSB_PTR, (uint16)counter);
|
||||
|
||||
#else
|
||||
CY_SET_REG16(SCSI_CMD_TIMER_COUNTER_LSB_PTR, counter);
|
||||
CY_SET_REG16(Debug_Timer_COUNTER_LSB_PTR, counter);
|
||||
#endif /* Set Write Counter only for the UDB implementation (Write Counter not available in fixed function Timer */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ReadCounter
|
||||
* Function Name: Debug_Timer_ReadCounter
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -492,24 +492,24 @@ void SCSI_CMD_TIMER_WriteCounter(uint16 counter) \
|
|||
* Present compare value.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint16 SCSI_CMD_TIMER_ReadCounter(void)
|
||||
uint16 Debug_Timer_ReadCounter(void)
|
||||
{
|
||||
|
||||
/* Force capture by reading Accumulator */
|
||||
/* Must first do a software capture to be able to read the counter */
|
||||
/* It is up to the user code to make sure there isn't already captured data in the FIFO */
|
||||
(void)SCSI_CMD_TIMER_COUNTER_LSB;
|
||||
(void)Debug_Timer_COUNTER_LSB;
|
||||
|
||||
/* Read the data from the FIFO (or capture register for Fixed Function)*/
|
||||
#if(SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
return ((uint16)CY_GET_REG16(SCSI_CMD_TIMER_CAPTURE_LSB_PTR));
|
||||
#if(Debug_Timer_UsingFixedFunction)
|
||||
return ((uint16)CY_GET_REG16(Debug_Timer_CAPTURE_LSB_PTR));
|
||||
#else
|
||||
return (CY_GET_REG16(SCSI_CMD_TIMER_CAPTURE_LSB_PTR));
|
||||
#endif /* (SCSI_CMD_TIMER_UsingFixedFunction) */
|
||||
return (CY_GET_REG16(Debug_Timer_CAPTURE_LSB_PTR));
|
||||
#endif /* (Debug_Timer_UsingFixedFunction) */
|
||||
}
|
||||
|
||||
|
||||
#if(!SCSI_CMD_TIMER_UsingFixedFunction) /* UDB Specific Functions */
|
||||
#if(!Debug_Timer_UsingFixedFunction) /* UDB Specific Functions */
|
||||
|
||||
/*******************************************************************************
|
||||
* The functions below this point are only available using the UDB
|
||||
|
@ -517,11 +517,11 @@ uint16 SCSI_CMD_TIMER_ReadCounter(void)
|
|||
******************************************************************************/
|
||||
|
||||
|
||||
#if (SCSI_CMD_TIMER_SoftwareCaptureMode)
|
||||
#if (Debug_Timer_SoftwareCaptureMode)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_SetCaptureMode
|
||||
* Function Name: Debug_Timer_SetCaptureMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -530,42 +530,42 @@ uint16 SCSI_CMD_TIMER_ReadCounter(void)
|
|||
* Parameters:
|
||||
* captureMode: This parameter sets the capture mode of the UDB capture feature
|
||||
* The parameter values are defined using the
|
||||
* #define SCSI_CMD_TIMER__B_TIMER__CM_NONE 0
|
||||
#define SCSI_CMD_TIMER__B_TIMER__CM_RISINGEDGE 1
|
||||
#define SCSI_CMD_TIMER__B_TIMER__CM_FALLINGEDGE 2
|
||||
#define SCSI_CMD_TIMER__B_TIMER__CM_EITHEREDGE 3
|
||||
#define SCSI_CMD_TIMER__B_TIMER__CM_SOFTWARE 4
|
||||
* #define Debug_Timer__B_TIMER__CM_NONE 0
|
||||
#define Debug_Timer__B_TIMER__CM_RISINGEDGE 1
|
||||
#define Debug_Timer__B_TIMER__CM_FALLINGEDGE 2
|
||||
#define Debug_Timer__B_TIMER__CM_EITHEREDGE 3
|
||||
#define Debug_Timer__B_TIMER__CM_SOFTWARE 4
|
||||
identifiers
|
||||
* The following are the possible values of the parameter
|
||||
* SCSI_CMD_TIMER__B_TIMER__CM_NONE - Set Capture mode to None
|
||||
* SCSI_CMD_TIMER__B_TIMER__CM_RISINGEDGE - Rising edge of Capture input
|
||||
* SCSI_CMD_TIMER__B_TIMER__CM_FALLINGEDGE - Falling edge of Capture input
|
||||
* SCSI_CMD_TIMER__B_TIMER__CM_EITHEREDGE - Either edge of Capture input
|
||||
* Debug_Timer__B_TIMER__CM_NONE - Set Capture mode to None
|
||||
* Debug_Timer__B_TIMER__CM_RISINGEDGE - Rising edge of Capture input
|
||||
* Debug_Timer__B_TIMER__CM_FALLINGEDGE - Falling edge of Capture input
|
||||
* Debug_Timer__B_TIMER__CM_EITHEREDGE - Either edge of Capture input
|
||||
*
|
||||
* Return:
|
||||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_SetCaptureMode(uint8 captureMode)
|
||||
void Debug_Timer_SetCaptureMode(uint8 captureMode)
|
||||
{
|
||||
/* This must only set to two bits of the control register associated */
|
||||
captureMode = ((uint8)((uint8)captureMode << SCSI_CMD_TIMER_CTRL_CAP_MODE_SHIFT));
|
||||
captureMode &= (SCSI_CMD_TIMER_CTRL_CAP_MODE_MASK);
|
||||
captureMode = ((uint8)((uint8)captureMode << Debug_Timer_CTRL_CAP_MODE_SHIFT));
|
||||
captureMode &= (Debug_Timer_CTRL_CAP_MODE_MASK);
|
||||
|
||||
/* Clear the Current Setting */
|
||||
SCSI_CMD_TIMER_CONTROL &= ((uint8)(~SCSI_CMD_TIMER_CTRL_CAP_MODE_MASK));
|
||||
Debug_Timer_CONTROL &= ((uint8)(~Debug_Timer_CTRL_CAP_MODE_MASK));
|
||||
|
||||
/* Write The New Setting */
|
||||
SCSI_CMD_TIMER_CONTROL |= captureMode;
|
||||
Debug_Timer_CONTROL |= captureMode;
|
||||
}
|
||||
#endif /* Remove API if Capture Mode is not Software Controlled */
|
||||
|
||||
|
||||
#if (SCSI_CMD_TIMER_SoftwareTriggerMode)
|
||||
#if (Debug_Timer_SoftwareTriggerMode)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_SetTriggerMode
|
||||
* Function Name: Debug_Timer_SetTriggerMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -573,35 +573,35 @@ void SCSI_CMD_TIMER_SetCaptureMode(uint8 captureMode)
|
|||
*
|
||||
* Parameters:
|
||||
* triggerMode: Pass one of the pre-defined Trigger Modes (except Software)
|
||||
#define SCSI_CMD_TIMER__B_TIMER__TM_NONE 0x00u
|
||||
#define SCSI_CMD_TIMER__B_TIMER__TM_RISINGEDGE 0x04u
|
||||
#define SCSI_CMD_TIMER__B_TIMER__TM_FALLINGEDGE 0x08u
|
||||
#define SCSI_CMD_TIMER__B_TIMER__TM_EITHEREDGE 0x0Cu
|
||||
#define SCSI_CMD_TIMER__B_TIMER__TM_SOFTWARE 0x10u
|
||||
#define Debug_Timer__B_TIMER__TM_NONE 0x00u
|
||||
#define Debug_Timer__B_TIMER__TM_RISINGEDGE 0x04u
|
||||
#define Debug_Timer__B_TIMER__TM_FALLINGEDGE 0x08u
|
||||
#define Debug_Timer__B_TIMER__TM_EITHEREDGE 0x0Cu
|
||||
#define Debug_Timer__B_TIMER__TM_SOFTWARE 0x10u
|
||||
*
|
||||
* Return:
|
||||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_SetTriggerMode(uint8 triggerMode)
|
||||
void Debug_Timer_SetTriggerMode(uint8 triggerMode)
|
||||
{
|
||||
/* This must only set to two bits of the control register associated */
|
||||
triggerMode &= SCSI_CMD_TIMER_CTRL_TRIG_MODE_MASK;
|
||||
triggerMode &= Debug_Timer_CTRL_TRIG_MODE_MASK;
|
||||
|
||||
/* Clear the Current Setting */
|
||||
SCSI_CMD_TIMER_CONTROL &= ((uint8)(~SCSI_CMD_TIMER_CTRL_TRIG_MODE_MASK));
|
||||
Debug_Timer_CONTROL &= ((uint8)(~Debug_Timer_CTRL_TRIG_MODE_MASK));
|
||||
|
||||
/* Write The New Setting */
|
||||
SCSI_CMD_TIMER_CONTROL |= (triggerMode | SCSI_CMD_TIMER__B_TIMER__TM_SOFTWARE);
|
||||
Debug_Timer_CONTROL |= (triggerMode | Debug_Timer__B_TIMER__TM_SOFTWARE);
|
||||
|
||||
}
|
||||
#endif /* Remove API if Trigger Mode is not Software Controlled */
|
||||
|
||||
#if (SCSI_CMD_TIMER_EnableTriggerMode)
|
||||
#if (Debug_Timer_EnableTriggerMode)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_EnableTrigger
|
||||
* Function Name: Debug_Timer_EnableTrigger
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -614,16 +614,16 @@ void SCSI_CMD_TIMER_SetTriggerMode(uint8 triggerMode)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_EnableTrigger(void)
|
||||
void Debug_Timer_EnableTrigger(void)
|
||||
{
|
||||
#if (!SCSI_CMD_TIMER_ControlRegRemoved) /* Remove assignment if control register is removed */
|
||||
SCSI_CMD_TIMER_CONTROL |= SCSI_CMD_TIMER_CTRL_TRIG_EN;
|
||||
#if (!Debug_Timer_ControlRegRemoved) /* Remove assignment if control register is removed */
|
||||
Debug_Timer_CONTROL |= Debug_Timer_CTRL_TRIG_EN;
|
||||
#endif /* Remove code section if control register is not used */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_DisableTrigger
|
||||
* Function Name: Debug_Timer_DisableTrigger
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -636,21 +636,21 @@ void SCSI_CMD_TIMER_EnableTrigger(void)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_DisableTrigger(void)
|
||||
void Debug_Timer_DisableTrigger(void)
|
||||
{
|
||||
#if (!SCSI_CMD_TIMER_ControlRegRemoved) /* Remove assignment if control register is removed */
|
||||
SCSI_CMD_TIMER_CONTROL &= ((uint8)(~SCSI_CMD_TIMER_CTRL_TRIG_EN));
|
||||
#if (!Debug_Timer_ControlRegRemoved) /* Remove assignment if control register is removed */
|
||||
Debug_Timer_CONTROL &= ((uint8)(~Debug_Timer_CTRL_TRIG_EN));
|
||||
#endif /* Remove code section if control register is not used */
|
||||
}
|
||||
#endif /* Remove API is Trigger Mode is set to None */
|
||||
|
||||
|
||||
#if(SCSI_CMD_TIMER_InterruptOnCaptureCount)
|
||||
#if (!SCSI_CMD_TIMER_ControlRegRemoved) /* Remove API if control register is removed */
|
||||
#if(Debug_Timer_InterruptOnCaptureCount)
|
||||
#if (!Debug_Timer_ControlRegRemoved) /* Remove API if control register is removed */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_SetInterruptCount
|
||||
* Function Name: Debug_Timer_SetInterruptCount
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -666,25 +666,25 @@ void SCSI_CMD_TIMER_DisableTrigger(void)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_SetInterruptCount(uint8 interruptCount)
|
||||
void Debug_Timer_SetInterruptCount(uint8 interruptCount)
|
||||
{
|
||||
/* This must only set to two bits of the control register associated */
|
||||
interruptCount &= SCSI_CMD_TIMER_CTRL_INTCNT_MASK;
|
||||
interruptCount &= Debug_Timer_CTRL_INTCNT_MASK;
|
||||
|
||||
/* Clear the Current Setting */
|
||||
SCSI_CMD_TIMER_CONTROL &= ((uint8)(~SCSI_CMD_TIMER_CTRL_INTCNT_MASK));
|
||||
Debug_Timer_CONTROL &= ((uint8)(~Debug_Timer_CTRL_INTCNT_MASK));
|
||||
/* Write The New Setting */
|
||||
SCSI_CMD_TIMER_CONTROL |= interruptCount;
|
||||
Debug_Timer_CONTROL |= interruptCount;
|
||||
}
|
||||
#endif /* Remove API if control register is removed */
|
||||
#endif /* SCSI_CMD_TIMER_InterruptOnCaptureCount */
|
||||
#endif /* Debug_Timer_InterruptOnCaptureCount */
|
||||
|
||||
|
||||
#if (SCSI_CMD_TIMER_UsingHWCaptureCounter)
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_SetCaptureCount
|
||||
* Function Name: Debug_Timer_SetCaptureCount
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -699,14 +699,14 @@ void SCSI_CMD_TIMER_SetInterruptCount(uint8 interruptCount)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_SetCaptureCount(uint8 captureCount)
|
||||
void Debug_Timer_SetCaptureCount(uint8 captureCount)
|
||||
{
|
||||
SCSI_CMD_TIMER_CAP_COUNT = captureCount;
|
||||
Debug_Timer_CAP_COUNT = captureCount;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ReadCaptureCount
|
||||
* Function Name: Debug_Timer_ReadCaptureCount
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -719,15 +719,15 @@ void SCSI_CMD_TIMER_SetCaptureCount(uint8 captureCount)
|
|||
* Returns the Capture Count Setting
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_CMD_TIMER_ReadCaptureCount(void)
|
||||
uint8 Debug_Timer_ReadCaptureCount(void)
|
||||
{
|
||||
return ((uint8)SCSI_CMD_TIMER_CAP_COUNT);
|
||||
return ((uint8)Debug_Timer_CAP_COUNT);
|
||||
}
|
||||
#endif /* SCSI_CMD_TIMER_UsingHWCaptureCounter */
|
||||
#endif /* Debug_Timer_UsingHWCaptureCounter */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ClearFIFO
|
||||
* Function Name: Debug_Timer_ClearFIFO
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -740,11 +740,11 @@ uint8 SCSI_CMD_TIMER_ReadCaptureCount(void)
|
|||
* void
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ClearFIFO(void)
|
||||
void Debug_Timer_ClearFIFO(void)
|
||||
{
|
||||
while(0u != (SCSI_CMD_TIMER_ReadStatusRegister() & SCSI_CMD_TIMER_STATUS_FIFONEMP))
|
||||
while(0u != (Debug_Timer_ReadStatusRegister() & Debug_Timer_STATUS_FIFONEMP))
|
||||
{
|
||||
(void)SCSI_CMD_TIMER_ReadCapture();
|
||||
(void)Debug_Timer_ReadCapture();
|
||||
}
|
||||
}
|
||||
|
439
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Debug_Timer.h
Executable file
439
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/Debug_Timer.h
Executable file
|
@ -0,0 +1,439 @@
|
|||
/*******************************************************************************
|
||||
* File Name: Debug_Timer.h
|
||||
* Version 2.50
|
||||
*
|
||||
* Description:
|
||||
* Contains the function prototypes and constants available to the timer
|
||||
* user module.
|
||||
*
|
||||
* Note:
|
||||
* None
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
********************************************************************************/
|
||||
|
||||
#if !defined(CY_Timer_v2_30_Debug_Timer_H)
|
||||
#define CY_Timer_v2_30_Debug_Timer_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
#include "CyLib.h" /* For CyEnterCriticalSection() and CyExitCriticalSection() functions */
|
||||
|
||||
extern uint8 Debug_Timer_initVar;
|
||||
|
||||
/* Check to see if required defines such as CY_PSOC5LP are available */
|
||||
/* They are defined starting with cy_boot v3.0 */
|
||||
#if !defined (CY_PSOC5LP)
|
||||
#error Component Timer_v2_50 requires cy_boot v3.0 or later
|
||||
#endif /* (CY_ PSOC5LP) */
|
||||
|
||||
|
||||
/**************************************
|
||||
* Parameter Defaults
|
||||
**************************************/
|
||||
|
||||
#define Debug_Timer_Resolution 16u
|
||||
#define Debug_Timer_UsingFixedFunction 1u
|
||||
#define Debug_Timer_UsingHWCaptureCounter 0u
|
||||
#define Debug_Timer_SoftwareCaptureMode 0u
|
||||
#define Debug_Timer_SoftwareTriggerMode 0u
|
||||
#define Debug_Timer_UsingHWEnable 0u
|
||||
#define Debug_Timer_EnableTriggerMode 0u
|
||||
#define Debug_Timer_InterruptOnCaptureCount 0u
|
||||
#define Debug_Timer_RunModeUsed 0u
|
||||
#define Debug_Timer_ControlRegRemoved 0u
|
||||
|
||||
|
||||
/***************************************
|
||||
* Type defines
|
||||
***************************************/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Sleep Wakeup Backup structure for Timer Component
|
||||
*************************************************************************/
|
||||
typedef struct
|
||||
{
|
||||
uint8 TimerEnableState;
|
||||
#if(!Debug_Timer_UsingFixedFunction)
|
||||
#if (CY_UDB_V0)
|
||||
uint16 TimerUdb; /* Timer internal counter value */
|
||||
uint16 TimerPeriod; /* Timer Period value */
|
||||
uint8 InterruptMaskValue; /* Timer Compare Value */
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
uint8 TimerCaptureCounter; /* Timer Capture Counter Value */
|
||||
#endif /* variable declaration for backing up Capture Counter value*/
|
||||
#endif /* variables for non retention registers in CY_UDB_V0 */
|
||||
|
||||
#if (CY_UDB_V1)
|
||||
uint16 TimerUdb;
|
||||
uint8 InterruptMaskValue;
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
uint8 TimerCaptureCounter;
|
||||
#endif /* variable declarations for backing up non retention registers in CY_UDB_V1 */
|
||||
#endif /* (CY_UDB_V1) */
|
||||
|
||||
#if (!Debug_Timer_ControlRegRemoved)
|
||||
uint8 TimerControlRegister;
|
||||
#endif /* variable declaration for backing up enable state of the Timer */
|
||||
#endif /* define backup variables only for UDB implementation. Fixed function registers are all retention */
|
||||
}Debug_Timer_backupStruct;
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void Debug_Timer_Start(void) ;
|
||||
void Debug_Timer_Stop(void) ;
|
||||
|
||||
void Debug_Timer_SetInterruptMode(uint8 interruptMode) ;
|
||||
uint8 Debug_Timer_ReadStatusRegister(void) ;
|
||||
/* Deprecated function. Do not use this in future. Retained for backward compatibility */
|
||||
#define Debug_Timer_GetInterruptSource() Debug_Timer_ReadStatusRegister()
|
||||
|
||||
#if(!Debug_Timer_ControlRegRemoved)
|
||||
uint8 Debug_Timer_ReadControlRegister(void) ;
|
||||
void Debug_Timer_WriteControlRegister(uint8 control) \
|
||||
;
|
||||
#endif /* (!Debug_Timer_ControlRegRemoved) */
|
||||
|
||||
uint16 Debug_Timer_ReadPeriod(void) ;
|
||||
void Debug_Timer_WritePeriod(uint16 period) \
|
||||
;
|
||||
uint16 Debug_Timer_ReadCounter(void) ;
|
||||
void Debug_Timer_WriteCounter(uint16 counter) \
|
||||
;
|
||||
uint16 Debug_Timer_ReadCapture(void) ;
|
||||
void Debug_Timer_SoftwareCapture(void) ;
|
||||
|
||||
|
||||
#if(!Debug_Timer_UsingFixedFunction) /* UDB Prototypes */
|
||||
#if (Debug_Timer_SoftwareCaptureMode)
|
||||
void Debug_Timer_SetCaptureMode(uint8 captureMode) ;
|
||||
#endif /* (!Debug_Timer_UsingFixedFunction) */
|
||||
|
||||
#if (Debug_Timer_SoftwareTriggerMode)
|
||||
void Debug_Timer_SetTriggerMode(uint8 triggerMode) ;
|
||||
#endif /* (Debug_Timer_SoftwareTriggerMode) */
|
||||
#if (Debug_Timer_EnableTriggerMode)
|
||||
void Debug_Timer_EnableTrigger(void) ;
|
||||
void Debug_Timer_DisableTrigger(void) ;
|
||||
#endif /* (Debug_Timer_EnableTriggerMode) */
|
||||
|
||||
#if(Debug_Timer_InterruptOnCaptureCount)
|
||||
#if(!Debug_Timer_ControlRegRemoved)
|
||||
void Debug_Timer_SetInterruptCount(uint8 interruptCount) \
|
||||
;
|
||||
#endif /* (!Debug_Timer_ControlRegRemoved) */
|
||||
#endif /* (Debug_Timer_InterruptOnCaptureCount) */
|
||||
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
void Debug_Timer_SetCaptureCount(uint8 captureCount) \
|
||||
;
|
||||
uint8 Debug_Timer_ReadCaptureCount(void) ;
|
||||
#endif /* (Debug_Timer_UsingHWCaptureCounter) */
|
||||
|
||||
void Debug_Timer_ClearFIFO(void) ;
|
||||
#endif /* UDB Prototypes */
|
||||
|
||||
/* Sleep Retention APIs */
|
||||
void Debug_Timer_Init(void) ;
|
||||
void Debug_Timer_Enable(void) ;
|
||||
void Debug_Timer_SaveConfig(void) ;
|
||||
void Debug_Timer_RestoreConfig(void) ;
|
||||
void Debug_Timer_Sleep(void) ;
|
||||
void Debug_Timer_Wakeup(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* Enumerated Types and Parameters
|
||||
***************************************/
|
||||
|
||||
/* Enumerated Type B_Timer__CaptureModes, Used in Capture Mode */
|
||||
#define Debug_Timer__B_TIMER__CM_NONE 0
|
||||
#define Debug_Timer__B_TIMER__CM_RISINGEDGE 1
|
||||
#define Debug_Timer__B_TIMER__CM_FALLINGEDGE 2
|
||||
#define Debug_Timer__B_TIMER__CM_EITHEREDGE 3
|
||||
#define Debug_Timer__B_TIMER__CM_SOFTWARE 4
|
||||
|
||||
|
||||
|
||||
/* Enumerated Type B_Timer__TriggerModes, Used in Trigger Mode */
|
||||
#define Debug_Timer__B_TIMER__TM_NONE 0x00u
|
||||
#define Debug_Timer__B_TIMER__TM_RISINGEDGE 0x04u
|
||||
#define Debug_Timer__B_TIMER__TM_FALLINGEDGE 0x08u
|
||||
#define Debug_Timer__B_TIMER__TM_EITHEREDGE 0x0Cu
|
||||
#define Debug_Timer__B_TIMER__TM_SOFTWARE 0x10u
|
||||
|
||||
|
||||
/***************************************
|
||||
* Initialial Parameter Constants
|
||||
***************************************/
|
||||
|
||||
#define Debug_Timer_INIT_PERIOD 31999u
|
||||
#define Debug_Timer_INIT_CAPTURE_MODE ((uint8)((uint8)0u << Debug_Timer_CTRL_CAP_MODE_SHIFT))
|
||||
#define Debug_Timer_INIT_TRIGGER_MODE ((uint8)((uint8)0u << Debug_Timer_CTRL_TRIG_MODE_SHIFT))
|
||||
#if (Debug_Timer_UsingFixedFunction)
|
||||
#define Debug_Timer_INIT_INTERRUPT_MODE (((uint8)((uint8)0u << Debug_Timer_STATUS_TC_INT_MASK_SHIFT)) | \
|
||||
((uint8)((uint8)0 << Debug_Timer_STATUS_CAPTURE_INT_MASK_SHIFT)))
|
||||
#else
|
||||
#define Debug_Timer_INIT_INTERRUPT_MODE (((uint8)((uint8)0u << Debug_Timer_STATUS_TC_INT_MASK_SHIFT)) | \
|
||||
((uint8)((uint8)0 << Debug_Timer_STATUS_CAPTURE_INT_MASK_SHIFT)) | \
|
||||
((uint8)((uint8)0 << Debug_Timer_STATUS_FIFOFULL_INT_MASK_SHIFT)))
|
||||
#endif /* (Debug_Timer_UsingFixedFunction) */
|
||||
#define Debug_Timer_INIT_CAPTURE_COUNT (2u)
|
||||
#define Debug_Timer_INIT_INT_CAPTURE_COUNT ((uint8)((uint8)(1u - 1u) << Debug_Timer_CTRL_INTCNT_SHIFT))
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
#if (Debug_Timer_UsingFixedFunction) /* Implementation Specific Registers and Register Constants */
|
||||
|
||||
|
||||
/***************************************
|
||||
* Fixed Function Registers
|
||||
***************************************/
|
||||
|
||||
#define Debug_Timer_STATUS (*(reg8 *) Debug_Timer_TimerHW__SR0 )
|
||||
/* In Fixed Function Block Status and Mask are the same register */
|
||||
#define Debug_Timer_STATUS_MASK (*(reg8 *) Debug_Timer_TimerHW__SR0 )
|
||||
#define Debug_Timer_CONTROL (*(reg8 *) Debug_Timer_TimerHW__CFG0)
|
||||
#define Debug_Timer_CONTROL2 (*(reg8 *) Debug_Timer_TimerHW__CFG1)
|
||||
#define Debug_Timer_CONTROL2_PTR ( (reg8 *) Debug_Timer_TimerHW__CFG1)
|
||||
#define Debug_Timer_RT1 (*(reg8 *) Debug_Timer_TimerHW__RT1)
|
||||
#define Debug_Timer_RT1_PTR ( (reg8 *) Debug_Timer_TimerHW__RT1)
|
||||
|
||||
#if (CY_PSOC3 || CY_PSOC5LP)
|
||||
#define Debug_Timer_CONTROL3 (*(reg8 *) Debug_Timer_TimerHW__CFG2)
|
||||
#define Debug_Timer_CONTROL3_PTR ( (reg8 *) Debug_Timer_TimerHW__CFG2)
|
||||
#endif /* (CY_PSOC3 || CY_PSOC5LP) */
|
||||
#define Debug_Timer_GLOBAL_ENABLE (*(reg8 *) Debug_Timer_TimerHW__PM_ACT_CFG)
|
||||
#define Debug_Timer_GLOBAL_STBY_ENABLE (*(reg8 *) Debug_Timer_TimerHW__PM_STBY_CFG)
|
||||
|
||||
#define Debug_Timer_CAPTURE_LSB (* (reg16 *) Debug_Timer_TimerHW__CAP0 )
|
||||
#define Debug_Timer_CAPTURE_LSB_PTR ((reg16 *) Debug_Timer_TimerHW__CAP0 )
|
||||
#define Debug_Timer_PERIOD_LSB (* (reg16 *) Debug_Timer_TimerHW__PER0 )
|
||||
#define Debug_Timer_PERIOD_LSB_PTR ((reg16 *) Debug_Timer_TimerHW__PER0 )
|
||||
#define Debug_Timer_COUNTER_LSB (* (reg16 *) Debug_Timer_TimerHW__CNT_CMP0 )
|
||||
#define Debug_Timer_COUNTER_LSB_PTR ((reg16 *) Debug_Timer_TimerHW__CNT_CMP0 )
|
||||
|
||||
|
||||
/***************************************
|
||||
* Register Constants
|
||||
***************************************/
|
||||
|
||||
/* Fixed Function Block Chosen */
|
||||
#define Debug_Timer_BLOCK_EN_MASK Debug_Timer_TimerHW__PM_ACT_MSK
|
||||
#define Debug_Timer_BLOCK_STBY_EN_MASK Debug_Timer_TimerHW__PM_STBY_MSK
|
||||
|
||||
/* Control Register Bit Locations */
|
||||
/* Interrupt Count - Not valid for Fixed Function Block */
|
||||
#define Debug_Timer_CTRL_INTCNT_SHIFT 0x00u
|
||||
/* Trigger Polarity - Not valid for Fixed Function Block */
|
||||
#define Debug_Timer_CTRL_TRIG_MODE_SHIFT 0x00u
|
||||
/* Trigger Enable - Not valid for Fixed Function Block */
|
||||
#define Debug_Timer_CTRL_TRIG_EN_SHIFT 0x00u
|
||||
/* Capture Polarity - Not valid for Fixed Function Block */
|
||||
#define Debug_Timer_CTRL_CAP_MODE_SHIFT 0x00u
|
||||
/* Timer Enable - As defined in Register Map, part of TMRX_CFG0 register */
|
||||
#define Debug_Timer_CTRL_ENABLE_SHIFT 0x00u
|
||||
|
||||
/* Control Register Bit Masks */
|
||||
#define Debug_Timer_CTRL_ENABLE ((uint8)((uint8)0x01u << Debug_Timer_CTRL_ENABLE_SHIFT))
|
||||
|
||||
/* Control2 Register Bit Masks */
|
||||
/* As defined in Register Map, Part of the TMRX_CFG1 register */
|
||||
#define Debug_Timer_CTRL2_IRQ_SEL_SHIFT 0x00u
|
||||
#define Debug_Timer_CTRL2_IRQ_SEL ((uint8)((uint8)0x01u << Debug_Timer_CTRL2_IRQ_SEL_SHIFT))
|
||||
|
||||
#if (CY_PSOC5A)
|
||||
/* Use CFG1 Mode bits to set run mode */
|
||||
/* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_CTRL_MODE_SHIFT 0x01u
|
||||
#define Debug_Timer_CTRL_MODE_MASK ((uint8)((uint8)0x07u << Debug_Timer_CTRL_MODE_SHIFT))
|
||||
#endif /* (CY_PSOC5A) */
|
||||
#if (CY_PSOC3 || CY_PSOC5LP)
|
||||
/* Control3 Register Bit Locations */
|
||||
#define Debug_Timer_CTRL_RCOD_SHIFT 0x02u
|
||||
#define Debug_Timer_CTRL_ENBL_SHIFT 0x00u
|
||||
#define Debug_Timer_CTRL_MODE_SHIFT 0x00u
|
||||
|
||||
/* Control3 Register Bit Masks */
|
||||
#define Debug_Timer_CTRL_RCOD_MASK ((uint8)((uint8)0x03u << Debug_Timer_CTRL_RCOD_SHIFT)) /* ROD and COD bit masks */
|
||||
#define Debug_Timer_CTRL_ENBL_MASK ((uint8)((uint8)0x80u << Debug_Timer_CTRL_ENBL_SHIFT)) /* HW_EN bit mask */
|
||||
#define Debug_Timer_CTRL_MODE_MASK ((uint8)((uint8)0x03u << Debug_Timer_CTRL_MODE_SHIFT)) /* Run mode bit mask */
|
||||
|
||||
#define Debug_Timer_CTRL_RCOD ((uint8)((uint8)0x03u << Debug_Timer_CTRL_RCOD_SHIFT))
|
||||
#define Debug_Timer_CTRL_ENBL ((uint8)((uint8)0x80u << Debug_Timer_CTRL_ENBL_SHIFT))
|
||||
#endif /* (CY_PSOC3 || CY_PSOC5LP) */
|
||||
|
||||
/*RT1 Synch Constants: Applicable for PSoC3 and PSoC5LP */
|
||||
#define Debug_Timer_RT1_SHIFT 0x04u
|
||||
/* Sync TC and CMP bit masks */
|
||||
#define Debug_Timer_RT1_MASK ((uint8)((uint8)0x03u << Debug_Timer_RT1_SHIFT))
|
||||
#define Debug_Timer_SYNC ((uint8)((uint8)0x03u << Debug_Timer_RT1_SHIFT))
|
||||
#define Debug_Timer_SYNCDSI_SHIFT 0x00u
|
||||
/* Sync all DSI inputs with Mask */
|
||||
#define Debug_Timer_SYNCDSI_MASK ((uint8)((uint8)0x0Fu << Debug_Timer_SYNCDSI_SHIFT))
|
||||
/* Sync all DSI inputs */
|
||||
#define Debug_Timer_SYNCDSI_EN ((uint8)((uint8)0x0Fu << Debug_Timer_SYNCDSI_SHIFT))
|
||||
|
||||
#define Debug_Timer_CTRL_MODE_PULSEWIDTH ((uint8)((uint8)0x01u << Debug_Timer_CTRL_MODE_SHIFT))
|
||||
#define Debug_Timer_CTRL_MODE_PERIOD ((uint8)((uint8)0x02u << Debug_Timer_CTRL_MODE_SHIFT))
|
||||
#define Debug_Timer_CTRL_MODE_CONTINUOUS ((uint8)((uint8)0x00u << Debug_Timer_CTRL_MODE_SHIFT))
|
||||
|
||||
/* Status Register Bit Locations */
|
||||
/* As defined in Register Map, part of TMRX_SR0 register */
|
||||
#define Debug_Timer_STATUS_TC_SHIFT 0x07u
|
||||
/* As defined in Register Map, part of TMRX_SR0 register, Shared with Compare Status */
|
||||
#define Debug_Timer_STATUS_CAPTURE_SHIFT 0x06u
|
||||
/* As defined in Register Map, part of TMRX_SR0 register */
|
||||
#define Debug_Timer_STATUS_TC_INT_MASK_SHIFT (Debug_Timer_STATUS_TC_SHIFT - 0x04u)
|
||||
/* As defined in Register Map, part of TMRX_SR0 register, Shared with Compare Status */
|
||||
#define Debug_Timer_STATUS_CAPTURE_INT_MASK_SHIFT (Debug_Timer_STATUS_CAPTURE_SHIFT - 0x04u)
|
||||
|
||||
/* Status Register Bit Masks */
|
||||
#define Debug_Timer_STATUS_TC ((uint8)((uint8)0x01u << Debug_Timer_STATUS_TC_SHIFT))
|
||||
#define Debug_Timer_STATUS_CAPTURE ((uint8)((uint8)0x01u << Debug_Timer_STATUS_CAPTURE_SHIFT))
|
||||
/* Interrupt Enable Bit-Mask for interrupt on TC */
|
||||
#define Debug_Timer_STATUS_TC_INT_MASK ((uint8)((uint8)0x01u << Debug_Timer_STATUS_TC_INT_MASK_SHIFT))
|
||||
/* Interrupt Enable Bit-Mask for interrupt on Capture */
|
||||
#define Debug_Timer_STATUS_CAPTURE_INT_MASK ((uint8)((uint8)0x01u << Debug_Timer_STATUS_CAPTURE_INT_MASK_SHIFT))
|
||||
|
||||
#else /* UDB Registers and Register Constants */
|
||||
|
||||
|
||||
/***************************************
|
||||
* UDB Registers
|
||||
***************************************/
|
||||
|
||||
#define Debug_Timer_STATUS (* (reg8 *) Debug_Timer_TimerUDB_rstSts_stsreg__STATUS_REG )
|
||||
#define Debug_Timer_STATUS_MASK (* (reg8 *) Debug_Timer_TimerUDB_rstSts_stsreg__MASK_REG)
|
||||
#define Debug_Timer_STATUS_AUX_CTRL (* (reg8 *) Debug_Timer_TimerUDB_rstSts_stsreg__STATUS_AUX_CTL_REG)
|
||||
#define Debug_Timer_CONTROL (* (reg8 *) Debug_Timer_TimerUDB_sCTRLReg_SyncCtl_ctrlreg__CONTROL_REG )
|
||||
|
||||
#if(Debug_Timer_Resolution <= 8u) /* 8-bit Timer */
|
||||
#define Debug_Timer_CAPTURE_LSB (* (reg8 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_CAPTURE_LSB_PTR ((reg8 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB (* (reg8 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB_PTR ((reg8 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB (* (reg8 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB_PTR ((reg8 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#elif(Debug_Timer_Resolution <= 16u) /* 8-bit Timer */
|
||||
#if(CY_PSOC3) /* 8-bit addres space */
|
||||
#define Debug_Timer_CAPTURE_LSB (* (reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_CAPTURE_LSB_PTR ((reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB (* (reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB_PTR ((reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB (* (reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB_PTR ((reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#else /* 16-bit address space */
|
||||
#define Debug_Timer_CAPTURE_LSB (* (reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__16BIT_F0_REG )
|
||||
#define Debug_Timer_CAPTURE_LSB_PTR ((reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__16BIT_F0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB (* (reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__16BIT_D0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB_PTR ((reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__16BIT_D0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB (* (reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__16BIT_A0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB_PTR ((reg16 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__16BIT_A0_REG )
|
||||
#endif /* CY_PSOC3 */
|
||||
#elif(Debug_Timer_Resolution <= 24u)/* 24-bit Timer */
|
||||
#define Debug_Timer_CAPTURE_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_CAPTURE_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#else /* 32-bit Timer */
|
||||
#if(CY_PSOC3 || CY_PSOC5) /* 8-bit address space */
|
||||
#define Debug_Timer_CAPTURE_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_CAPTURE_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__F0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__D0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__A0_REG )
|
||||
#else /* 32-bit address space */
|
||||
#define Debug_Timer_CAPTURE_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__32BIT_F0_REG )
|
||||
#define Debug_Timer_CAPTURE_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__32BIT_F0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__32BIT_D0_REG )
|
||||
#define Debug_Timer_PERIOD_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__32BIT_D0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB (* (reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__32BIT_A0_REG )
|
||||
#define Debug_Timer_COUNTER_LSB_PTR ((reg32 *) Debug_Timer_TimerUDB_sT16_timerdp_u0__32BIT_A0_REG )
|
||||
#endif /* CY_PSOC3 || CY_PSOC5 */
|
||||
#endif
|
||||
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
#define Debug_Timer_CAP_COUNT (*(reg8 *) Debug_Timer_TimerUDB_sCapCount_counter__PERIOD_REG )
|
||||
#define Debug_Timer_CAP_COUNT_PTR ( (reg8 *) Debug_Timer_TimerUDB_sCapCount_counter__PERIOD_REG )
|
||||
#define Debug_Timer_CAPTURE_COUNT_CTRL (*(reg8 *) Debug_Timer_TimerUDB_sCapCount_counter__CONTROL_AUX_CTL_REG )
|
||||
#define Debug_Timer_CAPTURE_COUNT_CTRL_PTR ( (reg8 *) Debug_Timer_TimerUDB_sCapCount_counter__CONTROL_AUX_CTL_REG )
|
||||
#endif /* (Debug_Timer_UsingHWCaptureCounter) */
|
||||
|
||||
|
||||
/***************************************
|
||||
* Register Constants
|
||||
***************************************/
|
||||
|
||||
/* Control Register Bit Locations */
|
||||
#define Debug_Timer_CTRL_INTCNT_SHIFT 0x00u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_CTRL_TRIG_MODE_SHIFT 0x02u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_CTRL_TRIG_EN_SHIFT 0x04u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_CTRL_CAP_MODE_SHIFT 0x05u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_CTRL_ENABLE_SHIFT 0x07u /* As defined by Verilog Implementation */
|
||||
|
||||
/* Control Register Bit Masks */
|
||||
#define Debug_Timer_CTRL_INTCNT_MASK ((uint8)((uint8)0x03u << Debug_Timer_CTRL_INTCNT_SHIFT))
|
||||
#define Debug_Timer_CTRL_TRIG_MODE_MASK ((uint8)((uint8)0x03u << Debug_Timer_CTRL_TRIG_MODE_SHIFT))
|
||||
#define Debug_Timer_CTRL_TRIG_EN ((uint8)((uint8)0x01u << Debug_Timer_CTRL_TRIG_EN_SHIFT))
|
||||
#define Debug_Timer_CTRL_CAP_MODE_MASK ((uint8)((uint8)0x03u << Debug_Timer_CTRL_CAP_MODE_SHIFT))
|
||||
#define Debug_Timer_CTRL_ENABLE ((uint8)((uint8)0x01u << Debug_Timer_CTRL_ENABLE_SHIFT))
|
||||
|
||||
/* Bit Counter (7-bit) Control Register Bit Definitions */
|
||||
/* As defined by the Register map for the AUX Control Register */
|
||||
#define Debug_Timer_CNTR_ENABLE 0x20u
|
||||
|
||||
/* Status Register Bit Locations */
|
||||
#define Debug_Timer_STATUS_TC_SHIFT 0x00u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_STATUS_CAPTURE_SHIFT 0x01u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_STATUS_TC_INT_MASK_SHIFT Debug_Timer_STATUS_TC_SHIFT
|
||||
#define Debug_Timer_STATUS_CAPTURE_INT_MASK_SHIFT Debug_Timer_STATUS_CAPTURE_SHIFT
|
||||
#define Debug_Timer_STATUS_FIFOFULL_SHIFT 0x02u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_STATUS_FIFONEMP_SHIFT 0x03u /* As defined by Verilog Implementation */
|
||||
#define Debug_Timer_STATUS_FIFOFULL_INT_MASK_SHIFT Debug_Timer_STATUS_FIFOFULL_SHIFT
|
||||
|
||||
/* Status Register Bit Masks */
|
||||
/* Sticky TC Event Bit-Mask */
|
||||
#define Debug_Timer_STATUS_TC ((uint8)((uint8)0x01u << Debug_Timer_STATUS_TC_SHIFT))
|
||||
/* Sticky Capture Event Bit-Mask */
|
||||
#define Debug_Timer_STATUS_CAPTURE ((uint8)((uint8)0x01u << Debug_Timer_STATUS_CAPTURE_SHIFT))
|
||||
/* Interrupt Enable Bit-Mask */
|
||||
#define Debug_Timer_STATUS_TC_INT_MASK ((uint8)((uint8)0x01u << Debug_Timer_STATUS_TC_SHIFT))
|
||||
/* Interrupt Enable Bit-Mask */
|
||||
#define Debug_Timer_STATUS_CAPTURE_INT_MASK ((uint8)((uint8)0x01u << Debug_Timer_STATUS_CAPTURE_SHIFT))
|
||||
/* NOT-Sticky FIFO Full Bit-Mask */
|
||||
#define Debug_Timer_STATUS_FIFOFULL ((uint8)((uint8)0x01u << Debug_Timer_STATUS_FIFOFULL_SHIFT))
|
||||
/* NOT-Sticky FIFO Not Empty Bit-Mask */
|
||||
#define Debug_Timer_STATUS_FIFONEMP ((uint8)((uint8)0x01u << Debug_Timer_STATUS_FIFONEMP_SHIFT))
|
||||
/* Interrupt Enable Bit-Mask */
|
||||
#define Debug_Timer_STATUS_FIFOFULL_INT_MASK ((uint8)((uint8)0x01u << Debug_Timer_STATUS_FIFOFULL_SHIFT))
|
||||
|
||||
#define Debug_Timer_STATUS_ACTL_INT_EN 0x10u /* As defined for the ACTL Register */
|
||||
|
||||
/* Datapath Auxillary Control Register definitions */
|
||||
#define Debug_Timer_AUX_CTRL_FIFO0_CLR 0x01u /* As defined by Register map */
|
||||
#define Debug_Timer_AUX_CTRL_FIFO1_CLR 0x02u /* As defined by Register map */
|
||||
#define Debug_Timer_AUX_CTRL_FIFO0_LVL 0x04u /* As defined by Register map */
|
||||
#define Debug_Timer_AUX_CTRL_FIFO1_LVL 0x08u /* As defined by Register map */
|
||||
#define Debug_Timer_STATUS_ACTL_INT_EN_MASK 0x10u /* As defined for the ACTL Register */
|
||||
|
||||
#endif /* Implementation Specific Registers and Register Constants */
|
||||
|
||||
#endif /* CY_Timer_v2_30_Debug_Timer_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,356 +1,356 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_ATN_ISR.c
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* API for controlling the state of an interrupt.
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#include <cydevice_trm.h>
|
||||
#include <CyLib.h>
|
||||
#include <SCSI_ATN_ISR.h>
|
||||
|
||||
#if !defined(SCSI_ATN_ISR__REMOVED) /* Check for removal by optimization */
|
||||
|
||||
/*******************************************************************************
|
||||
* Place your includes, defines and code here
|
||||
********************************************************************************/
|
||||
/* `#START SCSI_ATN_ISR_intc` */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
#ifndef CYINT_IRQ_BASE
|
||||
#define CYINT_IRQ_BASE 16
|
||||
#endif /* CYINT_IRQ_BASE */
|
||||
#ifndef CYINT_VECT_TABLE
|
||||
#define CYINT_VECT_TABLE ((cyisraddress **) CYREG_NVIC_VECT_OFFSET)
|
||||
#endif /* CYINT_VECT_TABLE */
|
||||
|
||||
/* Declared in startup, used to set unused interrupts to. */
|
||||
CY_ISR_PROTO(IntDefaultHandler);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_Start
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Set up the interrupt and enable it.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_Start(void)
|
||||
{
|
||||
/* For all we know the interrupt is active. */
|
||||
SCSI_ATN_ISR_Disable();
|
||||
|
||||
/* Set the ISR to point to the SCSI_ATN_ISR Interrupt. */
|
||||
SCSI_ATN_ISR_SetVector(&SCSI_ATN_ISR_Interrupt);
|
||||
|
||||
/* Set the priority. */
|
||||
SCSI_ATN_ISR_SetPriority((uint8)SCSI_ATN_ISR_INTC_PRIOR_NUMBER);
|
||||
|
||||
/* Enable it. */
|
||||
SCSI_ATN_ISR_Enable();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_StartEx
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Set up the interrupt and enable it.
|
||||
*
|
||||
* Parameters:
|
||||
* address: Address of the ISR to set in the interrupt vector table.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_StartEx(cyisraddress address)
|
||||
{
|
||||
/* For all we know the interrupt is active. */
|
||||
SCSI_ATN_ISR_Disable();
|
||||
|
||||
/* Set the ISR to point to the SCSI_ATN_ISR Interrupt. */
|
||||
SCSI_ATN_ISR_SetVector(address);
|
||||
|
||||
/* Set the priority. */
|
||||
SCSI_ATN_ISR_SetPriority((uint8)SCSI_ATN_ISR_INTC_PRIOR_NUMBER);
|
||||
|
||||
/* Enable it. */
|
||||
SCSI_ATN_ISR_Enable();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_Stop
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Disables and removes the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_Stop(void)
|
||||
{
|
||||
/* Disable this interrupt. */
|
||||
SCSI_ATN_ISR_Disable();
|
||||
|
||||
/* Set the ISR to point to the passive one. */
|
||||
SCSI_ATN_ISR_SetVector(&IntDefaultHandler);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_Interrupt
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* The default Interrupt Service Routine for SCSI_ATN_ISR.
|
||||
*
|
||||
* Add custom code between the coments to keep the next version of this file
|
||||
* from over writting your code.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
CY_ISR(SCSI_ATN_ISR_Interrupt)
|
||||
{
|
||||
/* Place your Interrupt code here. */
|
||||
/* `#START SCSI_ATN_ISR_Interrupt` */
|
||||
|
||||
/* `#END` */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_SetVector
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the ISR vector for the Interrupt. Note calling SCSI_ATN_ISR_Start
|
||||
* will override any effect this method would have had. To set the vector
|
||||
* before the component has been started use SCSI_ATN_ISR_StartEx instead.
|
||||
*
|
||||
* Parameters:
|
||||
* address: Address of the ISR to set in the interrupt vector table.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_SetVector(cyisraddress address)
|
||||
{
|
||||
cyisraddress * ramVectorTable;
|
||||
|
||||
ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
|
||||
|
||||
ramVectorTable[CYINT_IRQ_BASE + (uint32)SCSI_ATN_ISR__INTC_NUMBER] = address;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_GetVector
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the "address" of the current ISR vector for the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Address of the ISR in the interrupt vector table.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cyisraddress SCSI_ATN_ISR_GetVector(void)
|
||||
{
|
||||
cyisraddress * ramVectorTable;
|
||||
|
||||
ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
|
||||
|
||||
return ramVectorTable[CYINT_IRQ_BASE + (uint32)SCSI_ATN_ISR__INTC_NUMBER];
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_SetPriority
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Sets the Priority of the Interrupt. Note calling SCSI_ATN_ISR_Start
|
||||
* or SCSI_ATN_ISR_StartEx will override any effect this method
|
||||
* would have had. This method should only be called after
|
||||
* SCSI_ATN_ISR_Start or SCSI_ATN_ISR_StartEx has been called. To set
|
||||
* the initial priority for the component use the cydwr file in the tool.
|
||||
*
|
||||
* Parameters:
|
||||
* priority: Priority of the interrupt. 0 - 7, 0 being the highest.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_SetPriority(uint8 priority)
|
||||
{
|
||||
*SCSI_ATN_ISR_INTC_PRIOR = priority << 5;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_GetPriority
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the Priority of the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Priority of the interrupt. 0 - 7, 0 being the highest.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_ATN_ISR_GetPriority(void)
|
||||
{
|
||||
uint8 priority;
|
||||
|
||||
|
||||
priority = *SCSI_ATN_ISR_INTC_PRIOR >> 5;
|
||||
|
||||
return priority;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_Enable
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Enables the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_Enable(void)
|
||||
{
|
||||
/* Enable the general interrupt. */
|
||||
*SCSI_ATN_ISR_INTC_SET_EN = SCSI_ATN_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_GetState
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the state (enabled, disabled) of the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* 1 if enabled, 0 if disabled.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_ATN_ISR_GetState(void)
|
||||
{
|
||||
/* Get the state of the general interrupt. */
|
||||
return ((*SCSI_ATN_ISR_INTC_SET_EN & (uint32)SCSI_ATN_ISR__INTC_MASK) != 0u) ? 1u:0u;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_Disable
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Disables the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_Disable(void)
|
||||
{
|
||||
/* Disable the general interrupt. */
|
||||
*SCSI_ATN_ISR_INTC_CLR_EN = SCSI_ATN_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_SetPending
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Causes the Interrupt to enter the pending state, a software method of
|
||||
* generating the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_SetPending(void)
|
||||
{
|
||||
*SCSI_ATN_ISR_INTC_SET_PD = SCSI_ATN_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_ATN_ISR_ClearPending
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Clears a pending interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_ATN_ISR_ClearPending(void)
|
||||
{
|
||||
*SCSI_ATN_ISR_INTC_CLR_PD = SCSI_ATN_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
#endif /* End check for removal by optimization */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
||||
/*******************************************************************************
|
||||
* File Name: Debug_Timer_Interrupt.c
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* API for controlling the state of an interrupt.
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#include <cydevice_trm.h>
|
||||
#include <CyLib.h>
|
||||
#include <Debug_Timer_Interrupt.h>
|
||||
|
||||
#if !defined(Debug_Timer_Interrupt__REMOVED) /* Check for removal by optimization */
|
||||
|
||||
/*******************************************************************************
|
||||
* Place your includes, defines and code here
|
||||
********************************************************************************/
|
||||
/* `#START Debug_Timer_Interrupt_intc` */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
#ifndef CYINT_IRQ_BASE
|
||||
#define CYINT_IRQ_BASE 16
|
||||
#endif /* CYINT_IRQ_BASE */
|
||||
#ifndef CYINT_VECT_TABLE
|
||||
#define CYINT_VECT_TABLE ((cyisraddress **) CYREG_NVIC_VECT_OFFSET)
|
||||
#endif /* CYINT_VECT_TABLE */
|
||||
|
||||
/* Declared in startup, used to set unused interrupts to. */
|
||||
CY_ISR_PROTO(IntDefaultHandler);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_Start
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Set up the interrupt and enable it.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_Start(void)
|
||||
{
|
||||
/* For all we know the interrupt is active. */
|
||||
Debug_Timer_Interrupt_Disable();
|
||||
|
||||
/* Set the ISR to point to the Debug_Timer_Interrupt Interrupt. */
|
||||
Debug_Timer_Interrupt_SetVector(&Debug_Timer_Interrupt_Interrupt);
|
||||
|
||||
/* Set the priority. */
|
||||
Debug_Timer_Interrupt_SetPriority((uint8)Debug_Timer_Interrupt_INTC_PRIOR_NUMBER);
|
||||
|
||||
/* Enable it. */
|
||||
Debug_Timer_Interrupt_Enable();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_StartEx
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Set up the interrupt and enable it.
|
||||
*
|
||||
* Parameters:
|
||||
* address: Address of the ISR to set in the interrupt vector table.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_StartEx(cyisraddress address)
|
||||
{
|
||||
/* For all we know the interrupt is active. */
|
||||
Debug_Timer_Interrupt_Disable();
|
||||
|
||||
/* Set the ISR to point to the Debug_Timer_Interrupt Interrupt. */
|
||||
Debug_Timer_Interrupt_SetVector(address);
|
||||
|
||||
/* Set the priority. */
|
||||
Debug_Timer_Interrupt_SetPriority((uint8)Debug_Timer_Interrupt_INTC_PRIOR_NUMBER);
|
||||
|
||||
/* Enable it. */
|
||||
Debug_Timer_Interrupt_Enable();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_Stop
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Disables and removes the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_Stop(void)
|
||||
{
|
||||
/* Disable this interrupt. */
|
||||
Debug_Timer_Interrupt_Disable();
|
||||
|
||||
/* Set the ISR to point to the passive one. */
|
||||
Debug_Timer_Interrupt_SetVector(&IntDefaultHandler);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_Interrupt
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* The default Interrupt Service Routine for Debug_Timer_Interrupt.
|
||||
*
|
||||
* Add custom code between the coments to keep the next version of this file
|
||||
* from over writting your code.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
CY_ISR(Debug_Timer_Interrupt_Interrupt)
|
||||
{
|
||||
/* Place your Interrupt code here. */
|
||||
/* `#START Debug_Timer_Interrupt_Interrupt` */
|
||||
|
||||
/* `#END` */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_SetVector
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the ISR vector for the Interrupt. Note calling Debug_Timer_Interrupt_Start
|
||||
* will override any effect this method would have had. To set the vector
|
||||
* before the component has been started use Debug_Timer_Interrupt_StartEx instead.
|
||||
*
|
||||
* Parameters:
|
||||
* address: Address of the ISR to set in the interrupt vector table.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_SetVector(cyisraddress address)
|
||||
{
|
||||
cyisraddress * ramVectorTable;
|
||||
|
||||
ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
|
||||
|
||||
ramVectorTable[CYINT_IRQ_BASE + (uint32)Debug_Timer_Interrupt__INTC_NUMBER] = address;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_GetVector
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the "address" of the current ISR vector for the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Address of the ISR in the interrupt vector table.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cyisraddress Debug_Timer_Interrupt_GetVector(void)
|
||||
{
|
||||
cyisraddress * ramVectorTable;
|
||||
|
||||
ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
|
||||
|
||||
return ramVectorTable[CYINT_IRQ_BASE + (uint32)Debug_Timer_Interrupt__INTC_NUMBER];
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_SetPriority
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Sets the Priority of the Interrupt. Note calling Debug_Timer_Interrupt_Start
|
||||
* or Debug_Timer_Interrupt_StartEx will override any effect this method
|
||||
* would have had. This method should only be called after
|
||||
* Debug_Timer_Interrupt_Start or Debug_Timer_Interrupt_StartEx has been called. To set
|
||||
* the initial priority for the component use the cydwr file in the tool.
|
||||
*
|
||||
* Parameters:
|
||||
* priority: Priority of the interrupt. 0 - 7, 0 being the highest.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_SetPriority(uint8 priority)
|
||||
{
|
||||
*Debug_Timer_Interrupt_INTC_PRIOR = priority << 5;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_GetPriority
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the Priority of the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Priority of the interrupt. 0 - 7, 0 being the highest.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 Debug_Timer_Interrupt_GetPriority(void)
|
||||
{
|
||||
uint8 priority;
|
||||
|
||||
|
||||
priority = *Debug_Timer_Interrupt_INTC_PRIOR >> 5;
|
||||
|
||||
return priority;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_Enable
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Enables the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_Enable(void)
|
||||
{
|
||||
/* Enable the general interrupt. */
|
||||
*Debug_Timer_Interrupt_INTC_SET_EN = Debug_Timer_Interrupt__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_GetState
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the state (enabled, disabled) of the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* 1 if enabled, 0 if disabled.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 Debug_Timer_Interrupt_GetState(void)
|
||||
{
|
||||
/* Get the state of the general interrupt. */
|
||||
return ((*Debug_Timer_Interrupt_INTC_SET_EN & (uint32)Debug_Timer_Interrupt__INTC_MASK) != 0u) ? 1u:0u;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_Disable
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Disables the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_Disable(void)
|
||||
{
|
||||
/* Disable the general interrupt. */
|
||||
*Debug_Timer_Interrupt_INTC_CLR_EN = Debug_Timer_Interrupt__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_SetPending
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Causes the Interrupt to enter the pending state, a software method of
|
||||
* generating the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_SetPending(void)
|
||||
{
|
||||
*Debug_Timer_Interrupt_INTC_SET_PD = Debug_Timer_Interrupt__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: Debug_Timer_Interrupt_ClearPending
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Clears a pending interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void Debug_Timer_Interrupt_ClearPending(void)
|
||||
{
|
||||
*Debug_Timer_Interrupt_INTC_CLR_PD = Debug_Timer_Interrupt__INTC_MASK;
|
||||
}
|
||||
|
||||
#endif /* End check for removal by optimization */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -0,0 +1,70 @@
|
|||
/*******************************************************************************
|
||||
* File Name: Debug_Timer_Interrupt.h
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* Provides the function definitions for the Interrupt Controller.
|
||||
*
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
#if !defined(CY_ISR_Debug_Timer_Interrupt_H)
|
||||
#define CY_ISR_Debug_Timer_Interrupt_H
|
||||
|
||||
|
||||
#include <cytypes.h>
|
||||
#include <cyfitter.h>
|
||||
|
||||
/* Interrupt Controller API. */
|
||||
void Debug_Timer_Interrupt_Start(void);
|
||||
void Debug_Timer_Interrupt_StartEx(cyisraddress address);
|
||||
void Debug_Timer_Interrupt_Stop(void);
|
||||
|
||||
CY_ISR_PROTO(Debug_Timer_Interrupt_Interrupt);
|
||||
|
||||
void Debug_Timer_Interrupt_SetVector(cyisraddress address);
|
||||
cyisraddress Debug_Timer_Interrupt_GetVector(void);
|
||||
|
||||
void Debug_Timer_Interrupt_SetPriority(uint8 priority);
|
||||
uint8 Debug_Timer_Interrupt_GetPriority(void);
|
||||
|
||||
void Debug_Timer_Interrupt_Enable(void);
|
||||
uint8 Debug_Timer_Interrupt_GetState(void);
|
||||
void Debug_Timer_Interrupt_Disable(void);
|
||||
|
||||
void Debug_Timer_Interrupt_SetPending(void);
|
||||
void Debug_Timer_Interrupt_ClearPending(void);
|
||||
|
||||
|
||||
/* Interrupt Controller Constants */
|
||||
|
||||
/* Address of the INTC.VECT[x] register that contains the Address of the Debug_Timer_Interrupt ISR. */
|
||||
#define Debug_Timer_Interrupt_INTC_VECTOR ((reg32 *) Debug_Timer_Interrupt__INTC_VECT)
|
||||
|
||||
/* Address of the Debug_Timer_Interrupt ISR priority. */
|
||||
#define Debug_Timer_Interrupt_INTC_PRIOR ((reg8 *) Debug_Timer_Interrupt__INTC_PRIOR_REG)
|
||||
|
||||
/* Priority of the Debug_Timer_Interrupt interrupt. */
|
||||
#define Debug_Timer_Interrupt_INTC_PRIOR_NUMBER Debug_Timer_Interrupt__INTC_PRIOR_NUM
|
||||
|
||||
/* Address of the INTC.SET_EN[x] byte to bit enable Debug_Timer_Interrupt interrupt. */
|
||||
#define Debug_Timer_Interrupt_INTC_SET_EN ((reg32 *) Debug_Timer_Interrupt__INTC_SET_EN_REG)
|
||||
|
||||
/* Address of the INTC.CLR_EN[x] register to bit clear the Debug_Timer_Interrupt interrupt. */
|
||||
#define Debug_Timer_Interrupt_INTC_CLR_EN ((reg32 *) Debug_Timer_Interrupt__INTC_CLR_EN_REG)
|
||||
|
||||
/* Address of the INTC.SET_PD[x] register to set the Debug_Timer_Interrupt interrupt state to pending. */
|
||||
#define Debug_Timer_Interrupt_INTC_SET_PD ((reg32 *) Debug_Timer_Interrupt__INTC_SET_PD_REG)
|
||||
|
||||
/* Address of the INTC.CLR_PD[x] register to clear the Debug_Timer_Interrupt interrupt. */
|
||||
#define Debug_Timer_Interrupt_INTC_CLR_PD ((reg32 *) Debug_Timer_Interrupt__INTC_CLR_PD_REG)
|
||||
|
||||
|
||||
#endif /* CY_ISR_Debug_Timer_Interrupt_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_CMD_TIMER_PM.c
|
||||
* File Name: Debug_Timer_PM.c
|
||||
* Version 2.50
|
||||
*
|
||||
* Description:
|
||||
|
@ -16,12 +16,12 @@
|
|||
* the software package with which this file was provided.
|
||||
********************************************************************************/
|
||||
|
||||
#include "SCSI_CMD_TIMER.h"
|
||||
static SCSI_CMD_TIMER_backupStruct SCSI_CMD_TIMER_backup;
|
||||
#include "Debug_Timer.h"
|
||||
static Debug_Timer_backupStruct Debug_Timer_backup;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_SaveConfig
|
||||
* Function Name: Debug_Timer_SaveConfig
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -34,41 +34,41 @@ static SCSI_CMD_TIMER_backupStruct SCSI_CMD_TIMER_backup;
|
|||
* void
|
||||
*
|
||||
* Global variables:
|
||||
* SCSI_CMD_TIMER_backup: Variables of this global structure are modified to
|
||||
* Debug_Timer_backup: Variables of this global structure are modified to
|
||||
* store the values of non retention configuration registers when Sleep() API is
|
||||
* called.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_SaveConfig(void)
|
||||
void Debug_Timer_SaveConfig(void)
|
||||
{
|
||||
#if (!SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
#if (!Debug_Timer_UsingFixedFunction)
|
||||
/* Backup the UDB non-rentention registers for CY_UDB_V0 */
|
||||
#if (CY_UDB_V0)
|
||||
SCSI_CMD_TIMER_backup.TimerUdb = SCSI_CMD_TIMER_ReadCounter();
|
||||
SCSI_CMD_TIMER_backup.TimerPeriod = SCSI_CMD_TIMER_ReadPeriod();
|
||||
SCSI_CMD_TIMER_backup.InterruptMaskValue = SCSI_CMD_TIMER_STATUS_MASK;
|
||||
#if (SCSI_CMD_TIMER_UsingHWCaptureCounter)
|
||||
SCSI_CMD_TIMER_backup.TimerCaptureCounter = SCSI_CMD_TIMER_ReadCaptureCount();
|
||||
Debug_Timer_backup.TimerUdb = Debug_Timer_ReadCounter();
|
||||
Debug_Timer_backup.TimerPeriod = Debug_Timer_ReadPeriod();
|
||||
Debug_Timer_backup.InterruptMaskValue = Debug_Timer_STATUS_MASK;
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
Debug_Timer_backup.TimerCaptureCounter = Debug_Timer_ReadCaptureCount();
|
||||
#endif /* Backup the UDB non-rentention register capture counter for CY_UDB_V0 */
|
||||
#endif /* Backup the UDB non-rentention registers for CY_UDB_V0 */
|
||||
|
||||
#if (CY_UDB_V1)
|
||||
SCSI_CMD_TIMER_backup.TimerUdb = SCSI_CMD_TIMER_ReadCounter();
|
||||
SCSI_CMD_TIMER_backup.InterruptMaskValue = SCSI_CMD_TIMER_STATUS_MASK;
|
||||
#if (SCSI_CMD_TIMER_UsingHWCaptureCounter)
|
||||
SCSI_CMD_TIMER_backup.TimerCaptureCounter = SCSI_CMD_TIMER_ReadCaptureCount();
|
||||
Debug_Timer_backup.TimerUdb = Debug_Timer_ReadCounter();
|
||||
Debug_Timer_backup.InterruptMaskValue = Debug_Timer_STATUS_MASK;
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
Debug_Timer_backup.TimerCaptureCounter = Debug_Timer_ReadCaptureCount();
|
||||
#endif /* Back Up capture counter register */
|
||||
#endif /* Backup non retention registers, interrupt mask and capture counter for CY_UDB_V1 */
|
||||
|
||||
#if(!SCSI_CMD_TIMER_ControlRegRemoved)
|
||||
SCSI_CMD_TIMER_backup.TimerControlRegister = SCSI_CMD_TIMER_ReadControlRegister();
|
||||
#if(!Debug_Timer_ControlRegRemoved)
|
||||
Debug_Timer_backup.TimerControlRegister = Debug_Timer_ReadControlRegister();
|
||||
#endif /* Backup the enable state of the Timer component */
|
||||
#endif /* Backup non retention registers in UDB implementation. All fixed function registers are retention */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_RestoreConfig
|
||||
* Function Name: Debug_Timer_RestoreConfig
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -81,50 +81,50 @@ void SCSI_CMD_TIMER_SaveConfig(void)
|
|||
* void
|
||||
*
|
||||
* Global variables:
|
||||
* SCSI_CMD_TIMER_backup: Variables of this global structure are used to
|
||||
* Debug_Timer_backup: Variables of this global structure are used to
|
||||
* restore the values of non retention registers on wakeup from sleep mode.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_RestoreConfig(void)
|
||||
void Debug_Timer_RestoreConfig(void)
|
||||
{
|
||||
#if (!SCSI_CMD_TIMER_UsingFixedFunction)
|
||||
#if (!Debug_Timer_UsingFixedFunction)
|
||||
/* Restore the UDB non-rentention registers for CY_UDB_V0 */
|
||||
#if (CY_UDB_V0)
|
||||
/* Interrupt State Backup for Critical Region*/
|
||||
uint8 SCSI_CMD_TIMER_interruptState;
|
||||
uint8 Debug_Timer_interruptState;
|
||||
|
||||
SCSI_CMD_TIMER_WriteCounter(SCSI_CMD_TIMER_backup.TimerUdb);
|
||||
SCSI_CMD_TIMER_WritePeriod(SCSI_CMD_TIMER_backup.TimerPeriod);
|
||||
Debug_Timer_WriteCounter(Debug_Timer_backup.TimerUdb);
|
||||
Debug_Timer_WritePeriod(Debug_Timer_backup.TimerPeriod);
|
||||
/* CyEnterCriticalRegion and CyExitCriticalRegion are used to mark following region critical*/
|
||||
/* Enter Critical Region*/
|
||||
SCSI_CMD_TIMER_interruptState = CyEnterCriticalSection();
|
||||
Debug_Timer_interruptState = CyEnterCriticalSection();
|
||||
/* Use the interrupt output of the status register for IRQ output */
|
||||
SCSI_CMD_TIMER_STATUS_AUX_CTRL |= SCSI_CMD_TIMER_STATUS_ACTL_INT_EN_MASK;
|
||||
Debug_Timer_STATUS_AUX_CTRL |= Debug_Timer_STATUS_ACTL_INT_EN_MASK;
|
||||
/* Exit Critical Region*/
|
||||
CyExitCriticalSection(SCSI_CMD_TIMER_interruptState);
|
||||
SCSI_CMD_TIMER_STATUS_MASK =SCSI_CMD_TIMER_backup.InterruptMaskValue;
|
||||
#if (SCSI_CMD_TIMER_UsingHWCaptureCounter)
|
||||
SCSI_CMD_TIMER_SetCaptureCount(SCSI_CMD_TIMER_backup.TimerCaptureCounter);
|
||||
CyExitCriticalSection(Debug_Timer_interruptState);
|
||||
Debug_Timer_STATUS_MASK =Debug_Timer_backup.InterruptMaskValue;
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
Debug_Timer_SetCaptureCount(Debug_Timer_backup.TimerCaptureCounter);
|
||||
#endif /* Restore the UDB non-rentention register capture counter for CY_UDB_V0 */
|
||||
#endif /* Restore the UDB non-rentention registers for CY_UDB_V0 */
|
||||
|
||||
#if (CY_UDB_V1)
|
||||
SCSI_CMD_TIMER_WriteCounter(SCSI_CMD_TIMER_backup.TimerUdb);
|
||||
SCSI_CMD_TIMER_STATUS_MASK =SCSI_CMD_TIMER_backup.InterruptMaskValue;
|
||||
#if (SCSI_CMD_TIMER_UsingHWCaptureCounter)
|
||||
SCSI_CMD_TIMER_SetCaptureCount(SCSI_CMD_TIMER_backup.TimerCaptureCounter);
|
||||
Debug_Timer_WriteCounter(Debug_Timer_backup.TimerUdb);
|
||||
Debug_Timer_STATUS_MASK =Debug_Timer_backup.InterruptMaskValue;
|
||||
#if (Debug_Timer_UsingHWCaptureCounter)
|
||||
Debug_Timer_SetCaptureCount(Debug_Timer_backup.TimerCaptureCounter);
|
||||
#endif /* Restore Capture counter register*/
|
||||
#endif /* Restore up non retention registers, interrupt mask and capture counter for CY_UDB_V1 */
|
||||
|
||||
#if(!SCSI_CMD_TIMER_ControlRegRemoved)
|
||||
SCSI_CMD_TIMER_WriteControlRegister(SCSI_CMD_TIMER_backup.TimerControlRegister);
|
||||
#if(!Debug_Timer_ControlRegRemoved)
|
||||
Debug_Timer_WriteControlRegister(Debug_Timer_backup.TimerControlRegister);
|
||||
#endif /* Restore the enable state of the Timer component */
|
||||
#endif /* Restore non retention registers in the UDB implementation only */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_Sleep
|
||||
* Function Name: Debug_Timer_Sleep
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -137,32 +137,32 @@ void SCSI_CMD_TIMER_RestoreConfig(void)
|
|||
* void
|
||||
*
|
||||
* Global variables:
|
||||
* SCSI_CMD_TIMER_backup.TimerEnableState: Is modified depending on the
|
||||
* Debug_Timer_backup.TimerEnableState: Is modified depending on the
|
||||
* enable state of the block before entering sleep mode.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_Sleep(void)
|
||||
void Debug_Timer_Sleep(void)
|
||||
{
|
||||
#if(!SCSI_CMD_TIMER_ControlRegRemoved)
|
||||
#if(!Debug_Timer_ControlRegRemoved)
|
||||
/* Save Counter's enable state */
|
||||
if(SCSI_CMD_TIMER_CTRL_ENABLE == (SCSI_CMD_TIMER_CONTROL & SCSI_CMD_TIMER_CTRL_ENABLE))
|
||||
if(Debug_Timer_CTRL_ENABLE == (Debug_Timer_CONTROL & Debug_Timer_CTRL_ENABLE))
|
||||
{
|
||||
/* Timer is enabled */
|
||||
SCSI_CMD_TIMER_backup.TimerEnableState = 1u;
|
||||
Debug_Timer_backup.TimerEnableState = 1u;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Timer is disabled */
|
||||
SCSI_CMD_TIMER_backup.TimerEnableState = 0u;
|
||||
Debug_Timer_backup.TimerEnableState = 0u;
|
||||
}
|
||||
#endif /* Back up enable state from the Timer control register */
|
||||
SCSI_CMD_TIMER_Stop();
|
||||
SCSI_CMD_TIMER_SaveConfig();
|
||||
Debug_Timer_Stop();
|
||||
Debug_Timer_SaveConfig();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_Wakeup
|
||||
* Function Name: Debug_Timer_Wakeup
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
|
@ -175,17 +175,17 @@ void SCSI_CMD_TIMER_Sleep(void)
|
|||
* void
|
||||
*
|
||||
* Global variables:
|
||||
* SCSI_CMD_TIMER_backup.enableState: Is used to restore the enable state of
|
||||
* Debug_Timer_backup.enableState: Is used to restore the enable state of
|
||||
* block on wakeup from sleep mode.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_Wakeup(void)
|
||||
void Debug_Timer_Wakeup(void)
|
||||
{
|
||||
SCSI_CMD_TIMER_RestoreConfig();
|
||||
#if(!SCSI_CMD_TIMER_ControlRegRemoved)
|
||||
if(SCSI_CMD_TIMER_backup.TimerEnableState == 1u)
|
||||
Debug_Timer_RestoreConfig();
|
||||
#if(!Debug_Timer_ControlRegRemoved)
|
||||
if(Debug_Timer_backup.TimerEnableState == 1u)
|
||||
{ /* Enable Timer's operation */
|
||||
SCSI_CMD_TIMER_Enable();
|
||||
Debug_Timer_Enable();
|
||||
} /* Do nothing if Timer was disabled before */
|
||||
#endif /* Remove this code section if Control register is removed */
|
||||
}
|
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/LED1.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/LED1.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/LED1.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/LED1.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/LED1_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/LED1_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_ATN.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_ATN.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_ATN.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_ATN.h
Normal file → Executable file
|
@ -1,70 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_ATN_ISR.h
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* Provides the function definitions for the Interrupt Controller.
|
||||
*
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
#if !defined(CY_ISR_SCSI_ATN_ISR_H)
|
||||
#define CY_ISR_SCSI_ATN_ISR_H
|
||||
|
||||
|
||||
#include <cytypes.h>
|
||||
#include <cyfitter.h>
|
||||
|
||||
/* Interrupt Controller API. */
|
||||
void SCSI_ATN_ISR_Start(void);
|
||||
void SCSI_ATN_ISR_StartEx(cyisraddress address);
|
||||
void SCSI_ATN_ISR_Stop(void);
|
||||
|
||||
CY_ISR_PROTO(SCSI_ATN_ISR_Interrupt);
|
||||
|
||||
void SCSI_ATN_ISR_SetVector(cyisraddress address);
|
||||
cyisraddress SCSI_ATN_ISR_GetVector(void);
|
||||
|
||||
void SCSI_ATN_ISR_SetPriority(uint8 priority);
|
||||
uint8 SCSI_ATN_ISR_GetPriority(void);
|
||||
|
||||
void SCSI_ATN_ISR_Enable(void);
|
||||
uint8 SCSI_ATN_ISR_GetState(void);
|
||||
void SCSI_ATN_ISR_Disable(void);
|
||||
|
||||
void SCSI_ATN_ISR_SetPending(void);
|
||||
void SCSI_ATN_ISR_ClearPending(void);
|
||||
|
||||
|
||||
/* Interrupt Controller Constants */
|
||||
|
||||
/* Address of the INTC.VECT[x] register that contains the Address of the SCSI_ATN_ISR ISR. */
|
||||
#define SCSI_ATN_ISR_INTC_VECTOR ((reg32 *) SCSI_ATN_ISR__INTC_VECT)
|
||||
|
||||
/* Address of the SCSI_ATN_ISR ISR priority. */
|
||||
#define SCSI_ATN_ISR_INTC_PRIOR ((reg8 *) SCSI_ATN_ISR__INTC_PRIOR_REG)
|
||||
|
||||
/* Priority of the SCSI_ATN_ISR interrupt. */
|
||||
#define SCSI_ATN_ISR_INTC_PRIOR_NUMBER SCSI_ATN_ISR__INTC_PRIOR_NUM
|
||||
|
||||
/* Address of the INTC.SET_EN[x] byte to bit enable SCSI_ATN_ISR interrupt. */
|
||||
#define SCSI_ATN_ISR_INTC_SET_EN ((reg32 *) SCSI_ATN_ISR__INTC_SET_EN_REG)
|
||||
|
||||
/* Address of the INTC.CLR_EN[x] register to bit clear the SCSI_ATN_ISR interrupt. */
|
||||
#define SCSI_ATN_ISR_INTC_CLR_EN ((reg32 *) SCSI_ATN_ISR__INTC_CLR_EN_REG)
|
||||
|
||||
/* Address of the INTC.SET_PD[x] register to set the SCSI_ATN_ISR interrupt state to pending. */
|
||||
#define SCSI_ATN_ISR_INTC_SET_PD ((reg32 *) SCSI_ATN_ISR__INTC_SET_PD_REG)
|
||||
|
||||
/* Address of the INTC.CLR_PD[x] register to clear the SCSI_ATN_ISR interrupt. */
|
||||
#define SCSI_ATN_ISR_INTC_CLR_PD ((reg32 *) SCSI_ATN_ISR__INTC_CLR_PD_REG)
|
||||
|
||||
|
||||
#endif /* CY_ISR_SCSI_ATN_ISR_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_ATN_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_ATN_aliases.h
Normal file → Executable file
|
@ -1,356 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_CMD_TIMER_ISR.c
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* API for controlling the state of an interrupt.
|
||||
*
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
|
||||
#include <cydevice_trm.h>
|
||||
#include <CyLib.h>
|
||||
#include <SCSI_CMD_TIMER_ISR.h>
|
||||
|
||||
#if !defined(SCSI_CMD_TIMER_ISR__REMOVED) /* Check for removal by optimization */
|
||||
|
||||
/*******************************************************************************
|
||||
* Place your includes, defines and code here
|
||||
********************************************************************************/
|
||||
/* `#START SCSI_CMD_TIMER_ISR_intc` */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
#ifndef CYINT_IRQ_BASE
|
||||
#define CYINT_IRQ_BASE 16
|
||||
#endif /* CYINT_IRQ_BASE */
|
||||
#ifndef CYINT_VECT_TABLE
|
||||
#define CYINT_VECT_TABLE ((cyisraddress **) CYREG_NVIC_VECT_OFFSET)
|
||||
#endif /* CYINT_VECT_TABLE */
|
||||
|
||||
/* Declared in startup, used to set unused interrupts to. */
|
||||
CY_ISR_PROTO(IntDefaultHandler);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_Start
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Set up the interrupt and enable it.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_Start(void)
|
||||
{
|
||||
/* For all we know the interrupt is active. */
|
||||
SCSI_CMD_TIMER_ISR_Disable();
|
||||
|
||||
/* Set the ISR to point to the SCSI_CMD_TIMER_ISR Interrupt. */
|
||||
SCSI_CMD_TIMER_ISR_SetVector(&SCSI_CMD_TIMER_ISR_Interrupt);
|
||||
|
||||
/* Set the priority. */
|
||||
SCSI_CMD_TIMER_ISR_SetPriority((uint8)SCSI_CMD_TIMER_ISR_INTC_PRIOR_NUMBER);
|
||||
|
||||
/* Enable it. */
|
||||
SCSI_CMD_TIMER_ISR_Enable();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_StartEx
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Set up the interrupt and enable it.
|
||||
*
|
||||
* Parameters:
|
||||
* address: Address of the ISR to set in the interrupt vector table.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_StartEx(cyisraddress address)
|
||||
{
|
||||
/* For all we know the interrupt is active. */
|
||||
SCSI_CMD_TIMER_ISR_Disable();
|
||||
|
||||
/* Set the ISR to point to the SCSI_CMD_TIMER_ISR Interrupt. */
|
||||
SCSI_CMD_TIMER_ISR_SetVector(address);
|
||||
|
||||
/* Set the priority. */
|
||||
SCSI_CMD_TIMER_ISR_SetPriority((uint8)SCSI_CMD_TIMER_ISR_INTC_PRIOR_NUMBER);
|
||||
|
||||
/* Enable it. */
|
||||
SCSI_CMD_TIMER_ISR_Enable();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_Stop
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Disables and removes the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_Stop(void)
|
||||
{
|
||||
/* Disable this interrupt. */
|
||||
SCSI_CMD_TIMER_ISR_Disable();
|
||||
|
||||
/* Set the ISR to point to the passive one. */
|
||||
SCSI_CMD_TIMER_ISR_SetVector(&IntDefaultHandler);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_Interrupt
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* The default Interrupt Service Routine for SCSI_CMD_TIMER_ISR.
|
||||
*
|
||||
* Add custom code between the coments to keep the next version of this file
|
||||
* from over writting your code.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
CY_ISR(SCSI_CMD_TIMER_ISR_Interrupt)
|
||||
{
|
||||
/* Place your Interrupt code here. */
|
||||
/* `#START SCSI_CMD_TIMER_ISR_Interrupt` */
|
||||
|
||||
/* `#END` */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_SetVector
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the ISR vector for the Interrupt. Note calling SCSI_CMD_TIMER_ISR_Start
|
||||
* will override any effect this method would have had. To set the vector
|
||||
* before the component has been started use SCSI_CMD_TIMER_ISR_StartEx instead.
|
||||
*
|
||||
* Parameters:
|
||||
* address: Address of the ISR to set in the interrupt vector table.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_SetVector(cyisraddress address)
|
||||
{
|
||||
cyisraddress * ramVectorTable;
|
||||
|
||||
ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
|
||||
|
||||
ramVectorTable[CYINT_IRQ_BASE + (uint32)SCSI_CMD_TIMER_ISR__INTC_NUMBER] = address;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_GetVector
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the "address" of the current ISR vector for the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Address of the ISR in the interrupt vector table.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cyisraddress SCSI_CMD_TIMER_ISR_GetVector(void)
|
||||
{
|
||||
cyisraddress * ramVectorTable;
|
||||
|
||||
ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
|
||||
|
||||
return ramVectorTable[CYINT_IRQ_BASE + (uint32)SCSI_CMD_TIMER_ISR__INTC_NUMBER];
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_SetPriority
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Sets the Priority of the Interrupt. Note calling SCSI_CMD_TIMER_ISR_Start
|
||||
* or SCSI_CMD_TIMER_ISR_StartEx will override any effect this method
|
||||
* would have had. This method should only be called after
|
||||
* SCSI_CMD_TIMER_ISR_Start or SCSI_CMD_TIMER_ISR_StartEx has been called. To set
|
||||
* the initial priority for the component use the cydwr file in the tool.
|
||||
*
|
||||
* Parameters:
|
||||
* priority: Priority of the interrupt. 0 - 7, 0 being the highest.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_SetPriority(uint8 priority)
|
||||
{
|
||||
*SCSI_CMD_TIMER_ISR_INTC_PRIOR = priority << 5;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_GetPriority
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the Priority of the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Priority of the interrupt. 0 - 7, 0 being the highest.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_CMD_TIMER_ISR_GetPriority(void)
|
||||
{
|
||||
uint8 priority;
|
||||
|
||||
|
||||
priority = *SCSI_CMD_TIMER_ISR_INTC_PRIOR >> 5;
|
||||
|
||||
return priority;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_Enable
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Enables the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_Enable(void)
|
||||
{
|
||||
/* Enable the general interrupt. */
|
||||
*SCSI_CMD_TIMER_ISR_INTC_SET_EN = SCSI_CMD_TIMER_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_GetState
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets the state (enabled, disabled) of the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* 1 if enabled, 0 if disabled.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_CMD_TIMER_ISR_GetState(void)
|
||||
{
|
||||
/* Get the state of the general interrupt. */
|
||||
return ((*SCSI_CMD_TIMER_ISR_INTC_SET_EN & (uint32)SCSI_CMD_TIMER_ISR__INTC_MASK) != 0u) ? 1u:0u;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_Disable
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Disables the Interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_Disable(void)
|
||||
{
|
||||
/* Disable the general interrupt. */
|
||||
*SCSI_CMD_TIMER_ISR_INTC_CLR_EN = SCSI_CMD_TIMER_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_SetPending
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Causes the Interrupt to enter the pending state, a software method of
|
||||
* generating the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_SetPending(void)
|
||||
{
|
||||
*SCSI_CMD_TIMER_ISR_INTC_SET_PD = SCSI_CMD_TIMER_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_CMD_TIMER_ISR_ClearPending
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Clears a pending interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_CMD_TIMER_ISR_ClearPending(void)
|
||||
{
|
||||
*SCSI_CMD_TIMER_ISR_INTC_CLR_PD = SCSI_CMD_TIMER_ISR__INTC_MASK;
|
||||
}
|
||||
|
||||
#endif /* End check for removal by optimization */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,70 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_CMD_TIMER_ISR.h
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* Provides the function definitions for the Interrupt Controller.
|
||||
*
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
#if !defined(CY_ISR_SCSI_CMD_TIMER_ISR_H)
|
||||
#define CY_ISR_SCSI_CMD_TIMER_ISR_H
|
||||
|
||||
|
||||
#include <cytypes.h>
|
||||
#include <cyfitter.h>
|
||||
|
||||
/* Interrupt Controller API. */
|
||||
void SCSI_CMD_TIMER_ISR_Start(void);
|
||||
void SCSI_CMD_TIMER_ISR_StartEx(cyisraddress address);
|
||||
void SCSI_CMD_TIMER_ISR_Stop(void);
|
||||
|
||||
CY_ISR_PROTO(SCSI_CMD_TIMER_ISR_Interrupt);
|
||||
|
||||
void SCSI_CMD_TIMER_ISR_SetVector(cyisraddress address);
|
||||
cyisraddress SCSI_CMD_TIMER_ISR_GetVector(void);
|
||||
|
||||
void SCSI_CMD_TIMER_ISR_SetPriority(uint8 priority);
|
||||
uint8 SCSI_CMD_TIMER_ISR_GetPriority(void);
|
||||
|
||||
void SCSI_CMD_TIMER_ISR_Enable(void);
|
||||
uint8 SCSI_CMD_TIMER_ISR_GetState(void);
|
||||
void SCSI_CMD_TIMER_ISR_Disable(void);
|
||||
|
||||
void SCSI_CMD_TIMER_ISR_SetPending(void);
|
||||
void SCSI_CMD_TIMER_ISR_ClearPending(void);
|
||||
|
||||
|
||||
/* Interrupt Controller Constants */
|
||||
|
||||
/* Address of the INTC.VECT[x] register that contains the Address of the SCSI_CMD_TIMER_ISR ISR. */
|
||||
#define SCSI_CMD_TIMER_ISR_INTC_VECTOR ((reg32 *) SCSI_CMD_TIMER_ISR__INTC_VECT)
|
||||
|
||||
/* Address of the SCSI_CMD_TIMER_ISR ISR priority. */
|
||||
#define SCSI_CMD_TIMER_ISR_INTC_PRIOR ((reg8 *) SCSI_CMD_TIMER_ISR__INTC_PRIOR_REG)
|
||||
|
||||
/* Priority of the SCSI_CMD_TIMER_ISR interrupt. */
|
||||
#define SCSI_CMD_TIMER_ISR_INTC_PRIOR_NUMBER SCSI_CMD_TIMER_ISR__INTC_PRIOR_NUM
|
||||
|
||||
/* Address of the INTC.SET_EN[x] byte to bit enable SCSI_CMD_TIMER_ISR interrupt. */
|
||||
#define SCSI_CMD_TIMER_ISR_INTC_SET_EN ((reg32 *) SCSI_CMD_TIMER_ISR__INTC_SET_EN_REG)
|
||||
|
||||
/* Address of the INTC.CLR_EN[x] register to bit clear the SCSI_CMD_TIMER_ISR interrupt. */
|
||||
#define SCSI_CMD_TIMER_ISR_INTC_CLR_EN ((reg32 *) SCSI_CMD_TIMER_ISR__INTC_CLR_EN_REG)
|
||||
|
||||
/* Address of the INTC.SET_PD[x] register to set the SCSI_CMD_TIMER_ISR interrupt state to pending. */
|
||||
#define SCSI_CMD_TIMER_ISR_INTC_SET_PD ((reg32 *) SCSI_CMD_TIMER_ISR__INTC_SET_PD_REG)
|
||||
|
||||
/* Address of the INTC.CLR_PD[x] register to clear the SCSI_CMD_TIMER_ISR interrupt. */
|
||||
#define SCSI_CMD_TIMER_ISR_INTC_CLR_PD ((reg32 *) SCSI_CMD_TIMER_ISR__INTC_CLR_PD_REG)
|
||||
|
||||
|
||||
#endif /* CY_ISR_SCSI_CMD_TIMER_ISR_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,144 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_In_DBx.c
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file contains API to enable firmware control of a Pins component.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "SCSI_In_DBx.h"
|
||||
|
||||
/* APIs are not generated for P15[7:6] on PSoC 5 */
|
||||
#if !(CY_PSOC5A &&\
|
||||
SCSI_In_DBx__PORT == 15 && ((SCSI_In_DBx__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_In_DBx_Write
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Assign a new value to the digital port's data output register.
|
||||
*
|
||||
* Parameters:
|
||||
* prtValue: The value to be assigned to the Digital Port.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_In_DBx_Write(uint8 value)
|
||||
{
|
||||
uint8 staticBits = (SCSI_In_DBx_DR & (uint8)(~SCSI_In_DBx_MASK));
|
||||
SCSI_In_DBx_DR = staticBits | ((uint8)(value << SCSI_In_DBx_SHIFT) & SCSI_In_DBx_MASK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_In_DBx_SetDriveMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the drive mode on the pins of the port.
|
||||
*
|
||||
* Parameters:
|
||||
* mode: Change the pins to this drive mode.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_In_DBx_SetDriveMode(uint8 mode)
|
||||
{
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_0, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_1, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_2, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_3, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_4, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_5, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_6, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_In_DBx_7, mode);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_In_DBx_Read
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value on the pins of the Digital Port in right justified
|
||||
* form.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value of the Digital Port as a right justified number
|
||||
*
|
||||
* Note:
|
||||
* Macro SCSI_In_DBx_ReadPS calls this function.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_In_DBx_Read(void)
|
||||
{
|
||||
return (SCSI_In_DBx_PS & SCSI_In_DBx_MASK) >> SCSI_In_DBx_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_In_DBx_ReadDataReg
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value assigned to a Digital Port's data output register
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value assigned to the Digital Port's data output register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_In_DBx_ReadDataReg(void)
|
||||
{
|
||||
return (SCSI_In_DBx_DR & SCSI_In_DBx_MASK) >> SCSI_In_DBx_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/* If Interrupts Are Enabled for this Pins component */
|
||||
#if defined(SCSI_In_DBx_INTSTAT)
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_In_DBx_ClearInterrupt
|
||||
********************************************************************************
|
||||
* Summary:
|
||||
* Clears any active interrupts attached to port and returns the value of the
|
||||
* interrupt status register.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the value of the interrupt status register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_In_DBx_ClearInterrupt(void)
|
||||
{
|
||||
return (SCSI_In_DBx_INTSTAT & SCSI_In_DBx_MASK) >> SCSI_In_DBx_SHIFT;
|
||||
}
|
||||
|
||||
#endif /* If Interrupts Are Enabled for this Pins component */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,130 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_In_DBx.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_SCSI_In_DBx_H) /* Pins SCSI_In_DBx_H */
|
||||
#define CY_PINS_SCSI_In_DBx_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
#include "cypins.h"
|
||||
#include "SCSI_In_DBx_aliases.h"
|
||||
|
||||
/* Check to see if required defines such as CY_PSOC5A are available */
|
||||
/* They are defined starting with cy_boot v3.0 */
|
||||
#if !defined (CY_PSOC5A)
|
||||
#error Component cy_pins_v1_90 requires cy_boot v3.0 or later
|
||||
#endif /* (CY_PSOC5A) */
|
||||
|
||||
/* APIs are not generated for P15[7:6] */
|
||||
#if !(CY_PSOC5A &&\
|
||||
SCSI_In_DBx__PORT == 15 && ((SCSI_In_DBx__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void SCSI_In_DBx_Write(uint8 value) ;
|
||||
void SCSI_In_DBx_SetDriveMode(uint8 mode) ;
|
||||
uint8 SCSI_In_DBx_ReadDataReg(void) ;
|
||||
uint8 SCSI_In_DBx_Read(void) ;
|
||||
uint8 SCSI_In_DBx_ClearInterrupt(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* API Constants
|
||||
***************************************/
|
||||
|
||||
/* Drive Modes */
|
||||
#define SCSI_In_DBx_DM_ALG_HIZ PIN_DM_ALG_HIZ
|
||||
#define SCSI_In_DBx_DM_DIG_HIZ PIN_DM_DIG_HIZ
|
||||
#define SCSI_In_DBx_DM_RES_UP PIN_DM_RES_UP
|
||||
#define SCSI_In_DBx_DM_RES_DWN PIN_DM_RES_DWN
|
||||
#define SCSI_In_DBx_DM_OD_LO PIN_DM_OD_LO
|
||||
#define SCSI_In_DBx_DM_OD_HI PIN_DM_OD_HI
|
||||
#define SCSI_In_DBx_DM_STRONG PIN_DM_STRONG
|
||||
#define SCSI_In_DBx_DM_RES_UPDWN PIN_DM_RES_UPDWN
|
||||
|
||||
/* Digital Port Constants */
|
||||
#define SCSI_In_DBx_MASK SCSI_In_DBx__MASK
|
||||
#define SCSI_In_DBx_SHIFT SCSI_In_DBx__SHIFT
|
||||
#define SCSI_In_DBx_WIDTH 8u
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
/* Main Port Registers */
|
||||
/* Pin State */
|
||||
#define SCSI_In_DBx_PS (* (reg8 *) SCSI_In_DBx__PS)
|
||||
/* Data Register */
|
||||
#define SCSI_In_DBx_DR (* (reg8 *) SCSI_In_DBx__DR)
|
||||
/* Port Number */
|
||||
#define SCSI_In_DBx_PRT_NUM (* (reg8 *) SCSI_In_DBx__PRT)
|
||||
/* Connect to Analog Globals */
|
||||
#define SCSI_In_DBx_AG (* (reg8 *) SCSI_In_DBx__AG)
|
||||
/* Analog MUX bux enable */
|
||||
#define SCSI_In_DBx_AMUX (* (reg8 *) SCSI_In_DBx__AMUX)
|
||||
/* Bidirectional Enable */
|
||||
#define SCSI_In_DBx_BIE (* (reg8 *) SCSI_In_DBx__BIE)
|
||||
/* Bit-mask for Aliased Register Access */
|
||||
#define SCSI_In_DBx_BIT_MASK (* (reg8 *) SCSI_In_DBx__BIT_MASK)
|
||||
/* Bypass Enable */
|
||||
#define SCSI_In_DBx_BYP (* (reg8 *) SCSI_In_DBx__BYP)
|
||||
/* Port wide control signals */
|
||||
#define SCSI_In_DBx_CTL (* (reg8 *) SCSI_In_DBx__CTL)
|
||||
/* Drive Modes */
|
||||
#define SCSI_In_DBx_DM0 (* (reg8 *) SCSI_In_DBx__DM0)
|
||||
#define SCSI_In_DBx_DM1 (* (reg8 *) SCSI_In_DBx__DM1)
|
||||
#define SCSI_In_DBx_DM2 (* (reg8 *) SCSI_In_DBx__DM2)
|
||||
/* Input Buffer Disable Override */
|
||||
#define SCSI_In_DBx_INP_DIS (* (reg8 *) SCSI_In_DBx__INP_DIS)
|
||||
/* LCD Common or Segment Drive */
|
||||
#define SCSI_In_DBx_LCD_COM_SEG (* (reg8 *) SCSI_In_DBx__LCD_COM_SEG)
|
||||
/* Enable Segment LCD */
|
||||
#define SCSI_In_DBx_LCD_EN (* (reg8 *) SCSI_In_DBx__LCD_EN)
|
||||
/* Slew Rate Control */
|
||||
#define SCSI_In_DBx_SLW (* (reg8 *) SCSI_In_DBx__SLW)
|
||||
|
||||
/* DSI Port Registers */
|
||||
/* Global DSI Select Register */
|
||||
#define SCSI_In_DBx_PRTDSI__CAPS_SEL (* (reg8 *) SCSI_In_DBx__PRTDSI__CAPS_SEL)
|
||||
/* Double Sync Enable */
|
||||
#define SCSI_In_DBx_PRTDSI__DBL_SYNC_IN (* (reg8 *) SCSI_In_DBx__PRTDSI__DBL_SYNC_IN)
|
||||
/* Output Enable Select Drive Strength */
|
||||
#define SCSI_In_DBx_PRTDSI__OE_SEL0 (* (reg8 *) SCSI_In_DBx__PRTDSI__OE_SEL0)
|
||||
#define SCSI_In_DBx_PRTDSI__OE_SEL1 (* (reg8 *) SCSI_In_DBx__PRTDSI__OE_SEL1)
|
||||
/* Port Pin Output Select Registers */
|
||||
#define SCSI_In_DBx_PRTDSI__OUT_SEL0 (* (reg8 *) SCSI_In_DBx__PRTDSI__OUT_SEL0)
|
||||
#define SCSI_In_DBx_PRTDSI__OUT_SEL1 (* (reg8 *) SCSI_In_DBx__PRTDSI__OUT_SEL1)
|
||||
/* Sync Output Enable Registers */
|
||||
#define SCSI_In_DBx_PRTDSI__SYNC_OUT (* (reg8 *) SCSI_In_DBx__PRTDSI__SYNC_OUT)
|
||||
|
||||
|
||||
#if defined(SCSI_In_DBx__INTSTAT) /* Interrupt Registers */
|
||||
|
||||
#define SCSI_In_DBx_INTSTAT (* (reg8 *) SCSI_In_DBx__INTSTAT)
|
||||
#define SCSI_In_DBx_SNAP (* (reg8 *) SCSI_In_DBx__SNAP)
|
||||
|
||||
#endif /* Interrupt Registers */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
#endif /* CY_PINS_SCSI_In_DBx_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_In_DBx_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_In_DBx_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_In_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_In_aliases.h
Normal file → Executable file
63
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_Out_Bits.c
Executable file
63
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_Out_Bits.c
Executable file
|
@ -0,0 +1,63 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_Out_Bits.c
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* This file contains API to enable firmware control of a Control Register.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "SCSI_Out_Bits.h"
|
||||
|
||||
#if !defined(SCSI_Out_Bits_Sync_ctrl_reg__REMOVED) /* Check for removal by optimization */
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_Bits_Write
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Write a byte to the Control Register.
|
||||
*
|
||||
* Parameters:
|
||||
* control: The value to be assigned to the Control Register.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_Out_Bits_Write(uint8 control)
|
||||
{
|
||||
SCSI_Out_Bits_Control = control;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_Bits_Read
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Reads the current value assigned to the Control Register.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value in the Control Register.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_Out_Bits_Read(void)
|
||||
{
|
||||
return SCSI_Out_Bits_Control;
|
||||
}
|
||||
|
||||
#endif /* End check for removal by optimization */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,32 +1,42 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_Dp.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_USBFS_1_Dp_ALIASES_H) /* Pins USBFS_1_Dp_ALIASES_H */
|
||||
#define CY_PINS_USBFS_1_Dp_ALIASES_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
|
||||
|
||||
|
||||
/***************************************
|
||||
* Constants
|
||||
***************************************/
|
||||
#define USBFS_1_Dp_0 USBFS_1_Dp__0__PC
|
||||
|
||||
#endif /* End Pins USBFS_1_Dp_ALIASES_H */
|
||||
|
||||
/* [] END OF FILE */
|
||||
/*******************************************************************************
|
||||
* File Name: SCSI_Out_Bits.h
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_CONTROL_REG_SCSI_Out_Bits_H) /* CY_CONTROL_REG_SCSI_Out_Bits_H */
|
||||
#define CY_CONTROL_REG_SCSI_Out_Bits_H
|
||||
|
||||
#include "cytypes.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void SCSI_Out_Bits_Write(uint8 control) ;
|
||||
uint8 SCSI_Out_Bits_Read(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
/* Control Register */
|
||||
#define SCSI_Out_Bits_Control (* (reg8 *) SCSI_Out_Bits_Sync_ctrl_reg__CONTROL_REG )
|
||||
#define SCSI_Out_Bits_Control_PTR ( (reg8 *) SCSI_Out_Bits_Sync_ctrl_reg__CONTROL_REG )
|
||||
|
||||
#endif /* End CY_CONTROL_REG_SCSI_Out_Bits_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
63
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_Out_Ctl.c
Executable file
63
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_Out_Ctl.c
Executable file
|
@ -0,0 +1,63 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_Out_Ctl.c
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* This file contains API to enable firmware control of a Control Register.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "SCSI_Out_Ctl.h"
|
||||
|
||||
#if !defined(SCSI_Out_Ctl_Sync_ctrl_reg__REMOVED) /* Check for removal by optimization */
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_Ctl_Write
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Write a byte to the Control Register.
|
||||
*
|
||||
* Parameters:
|
||||
* control: The value to be assigned to the Control Register.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_Out_Ctl_Write(uint8 control)
|
||||
{
|
||||
SCSI_Out_Ctl_Control = control;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_Ctl_Read
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Reads the current value assigned to the Control Register.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value in the Control Register.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_Out_Ctl_Read(void)
|
||||
{
|
||||
return SCSI_Out_Ctl_Control;
|
||||
}
|
||||
|
||||
#endif /* End check for removal by optimization */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,32 +1,42 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SD_WP.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_SD_WP_ALIASES_H) /* Pins SD_WP_ALIASES_H */
|
||||
#define CY_PINS_SD_WP_ALIASES_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
|
||||
|
||||
|
||||
/***************************************
|
||||
* Constants
|
||||
***************************************/
|
||||
#define SD_WP_0 SD_WP__0__PC
|
||||
|
||||
#endif /* End Pins SD_WP_ALIASES_H */
|
||||
|
||||
/* [] END OF FILE */
|
||||
/*******************************************************************************
|
||||
* File Name: SCSI_Out_Ctl.h
|
||||
* Version 1.70
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_CONTROL_REG_SCSI_Out_Ctl_H) /* CY_CONTROL_REG_SCSI_Out_Ctl_H */
|
||||
#define CY_CONTROL_REG_SCSI_Out_Ctl_H
|
||||
|
||||
#include "cytypes.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void SCSI_Out_Ctl_Write(uint8 control) ;
|
||||
uint8 SCSI_Out_Ctl_Read(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
/* Control Register */
|
||||
#define SCSI_Out_Ctl_Control (* (reg8 *) SCSI_Out_Ctl_Sync_ctrl_reg__CONTROL_REG )
|
||||
#define SCSI_Out_Ctl_Control_PTR ( (reg8 *) SCSI_Out_Ctl_Sync_ctrl_reg__CONTROL_REG )
|
||||
|
||||
#endif /* End CY_CONTROL_REG_SCSI_Out_Ctl_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,144 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_Out_DBx.c
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file contains API to enable firmware control of a Pins component.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "SCSI_Out_DBx.h"
|
||||
|
||||
/* APIs are not generated for P15[7:6] on PSoC 5 */
|
||||
#if !(CY_PSOC5A &&\
|
||||
SCSI_Out_DBx__PORT == 15 && ((SCSI_Out_DBx__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_DBx_Write
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Assign a new value to the digital port's data output register.
|
||||
*
|
||||
* Parameters:
|
||||
* prtValue: The value to be assigned to the Digital Port.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_Out_DBx_Write(uint8 value)
|
||||
{
|
||||
uint8 staticBits = (SCSI_Out_DBx_DR & (uint8)(~SCSI_Out_DBx_MASK));
|
||||
SCSI_Out_DBx_DR = staticBits | ((uint8)(value << SCSI_Out_DBx_SHIFT) & SCSI_Out_DBx_MASK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_DBx_SetDriveMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the drive mode on the pins of the port.
|
||||
*
|
||||
* Parameters:
|
||||
* mode: Change the pins to this drive mode.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SCSI_Out_DBx_SetDriveMode(uint8 mode)
|
||||
{
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_0, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_1, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_2, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_3, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_4, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_5, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_6, mode);
|
||||
CyPins_SetPinDriveMode(SCSI_Out_DBx_7, mode);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_DBx_Read
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value on the pins of the Digital Port in right justified
|
||||
* form.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value of the Digital Port as a right justified number
|
||||
*
|
||||
* Note:
|
||||
* Macro SCSI_Out_DBx_ReadPS calls this function.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_Out_DBx_Read(void)
|
||||
{
|
||||
return (SCSI_Out_DBx_PS & SCSI_Out_DBx_MASK) >> SCSI_Out_DBx_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_DBx_ReadDataReg
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value assigned to a Digital Port's data output register
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value assigned to the Digital Port's data output register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_Out_DBx_ReadDataReg(void)
|
||||
{
|
||||
return (SCSI_Out_DBx_DR & SCSI_Out_DBx_MASK) >> SCSI_Out_DBx_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/* If Interrupts Are Enabled for this Pins component */
|
||||
#if defined(SCSI_Out_DBx_INTSTAT)
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SCSI_Out_DBx_ClearInterrupt
|
||||
********************************************************************************
|
||||
* Summary:
|
||||
* Clears any active interrupts attached to port and returns the value of the
|
||||
* interrupt status register.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the value of the interrupt status register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SCSI_Out_DBx_ClearInterrupt(void)
|
||||
{
|
||||
return (SCSI_Out_DBx_INTSTAT & SCSI_Out_DBx_MASK) >> SCSI_Out_DBx_SHIFT;
|
||||
}
|
||||
|
||||
#endif /* If Interrupts Are Enabled for this Pins component */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,130 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SCSI_Out_DBx.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_SCSI_Out_DBx_H) /* Pins SCSI_Out_DBx_H */
|
||||
#define CY_PINS_SCSI_Out_DBx_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
#include "cypins.h"
|
||||
#include "SCSI_Out_DBx_aliases.h"
|
||||
|
||||
/* Check to see if required defines such as CY_PSOC5A are available */
|
||||
/* They are defined starting with cy_boot v3.0 */
|
||||
#if !defined (CY_PSOC5A)
|
||||
#error Component cy_pins_v1_90 requires cy_boot v3.0 or later
|
||||
#endif /* (CY_PSOC5A) */
|
||||
|
||||
/* APIs are not generated for P15[7:6] */
|
||||
#if !(CY_PSOC5A &&\
|
||||
SCSI_Out_DBx__PORT == 15 && ((SCSI_Out_DBx__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void SCSI_Out_DBx_Write(uint8 value) ;
|
||||
void SCSI_Out_DBx_SetDriveMode(uint8 mode) ;
|
||||
uint8 SCSI_Out_DBx_ReadDataReg(void) ;
|
||||
uint8 SCSI_Out_DBx_Read(void) ;
|
||||
uint8 SCSI_Out_DBx_ClearInterrupt(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* API Constants
|
||||
***************************************/
|
||||
|
||||
/* Drive Modes */
|
||||
#define SCSI_Out_DBx_DM_ALG_HIZ PIN_DM_ALG_HIZ
|
||||
#define SCSI_Out_DBx_DM_DIG_HIZ PIN_DM_DIG_HIZ
|
||||
#define SCSI_Out_DBx_DM_RES_UP PIN_DM_RES_UP
|
||||
#define SCSI_Out_DBx_DM_RES_DWN PIN_DM_RES_DWN
|
||||
#define SCSI_Out_DBx_DM_OD_LO PIN_DM_OD_LO
|
||||
#define SCSI_Out_DBx_DM_OD_HI PIN_DM_OD_HI
|
||||
#define SCSI_Out_DBx_DM_STRONG PIN_DM_STRONG
|
||||
#define SCSI_Out_DBx_DM_RES_UPDWN PIN_DM_RES_UPDWN
|
||||
|
||||
/* Digital Port Constants */
|
||||
#define SCSI_Out_DBx_MASK SCSI_Out_DBx__MASK
|
||||
#define SCSI_Out_DBx_SHIFT SCSI_Out_DBx__SHIFT
|
||||
#define SCSI_Out_DBx_WIDTH 8u
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
/* Main Port Registers */
|
||||
/* Pin State */
|
||||
#define SCSI_Out_DBx_PS (* (reg8 *) SCSI_Out_DBx__PS)
|
||||
/* Data Register */
|
||||
#define SCSI_Out_DBx_DR (* (reg8 *) SCSI_Out_DBx__DR)
|
||||
/* Port Number */
|
||||
#define SCSI_Out_DBx_PRT_NUM (* (reg8 *) SCSI_Out_DBx__PRT)
|
||||
/* Connect to Analog Globals */
|
||||
#define SCSI_Out_DBx_AG (* (reg8 *) SCSI_Out_DBx__AG)
|
||||
/* Analog MUX bux enable */
|
||||
#define SCSI_Out_DBx_AMUX (* (reg8 *) SCSI_Out_DBx__AMUX)
|
||||
/* Bidirectional Enable */
|
||||
#define SCSI_Out_DBx_BIE (* (reg8 *) SCSI_Out_DBx__BIE)
|
||||
/* Bit-mask for Aliased Register Access */
|
||||
#define SCSI_Out_DBx_BIT_MASK (* (reg8 *) SCSI_Out_DBx__BIT_MASK)
|
||||
/* Bypass Enable */
|
||||
#define SCSI_Out_DBx_BYP (* (reg8 *) SCSI_Out_DBx__BYP)
|
||||
/* Port wide control signals */
|
||||
#define SCSI_Out_DBx_CTL (* (reg8 *) SCSI_Out_DBx__CTL)
|
||||
/* Drive Modes */
|
||||
#define SCSI_Out_DBx_DM0 (* (reg8 *) SCSI_Out_DBx__DM0)
|
||||
#define SCSI_Out_DBx_DM1 (* (reg8 *) SCSI_Out_DBx__DM1)
|
||||
#define SCSI_Out_DBx_DM2 (* (reg8 *) SCSI_Out_DBx__DM2)
|
||||
/* Input Buffer Disable Override */
|
||||
#define SCSI_Out_DBx_INP_DIS (* (reg8 *) SCSI_Out_DBx__INP_DIS)
|
||||
/* LCD Common or Segment Drive */
|
||||
#define SCSI_Out_DBx_LCD_COM_SEG (* (reg8 *) SCSI_Out_DBx__LCD_COM_SEG)
|
||||
/* Enable Segment LCD */
|
||||
#define SCSI_Out_DBx_LCD_EN (* (reg8 *) SCSI_Out_DBx__LCD_EN)
|
||||
/* Slew Rate Control */
|
||||
#define SCSI_Out_DBx_SLW (* (reg8 *) SCSI_Out_DBx__SLW)
|
||||
|
||||
/* DSI Port Registers */
|
||||
/* Global DSI Select Register */
|
||||
#define SCSI_Out_DBx_PRTDSI__CAPS_SEL (* (reg8 *) SCSI_Out_DBx__PRTDSI__CAPS_SEL)
|
||||
/* Double Sync Enable */
|
||||
#define SCSI_Out_DBx_PRTDSI__DBL_SYNC_IN (* (reg8 *) SCSI_Out_DBx__PRTDSI__DBL_SYNC_IN)
|
||||
/* Output Enable Select Drive Strength */
|
||||
#define SCSI_Out_DBx_PRTDSI__OE_SEL0 (* (reg8 *) SCSI_Out_DBx__PRTDSI__OE_SEL0)
|
||||
#define SCSI_Out_DBx_PRTDSI__OE_SEL1 (* (reg8 *) SCSI_Out_DBx__PRTDSI__OE_SEL1)
|
||||
/* Port Pin Output Select Registers */
|
||||
#define SCSI_Out_DBx_PRTDSI__OUT_SEL0 (* (reg8 *) SCSI_Out_DBx__PRTDSI__OUT_SEL0)
|
||||
#define SCSI_Out_DBx_PRTDSI__OUT_SEL1 (* (reg8 *) SCSI_Out_DBx__PRTDSI__OUT_SEL1)
|
||||
/* Sync Output Enable Registers */
|
||||
#define SCSI_Out_DBx_PRTDSI__SYNC_OUT (* (reg8 *) SCSI_Out_DBx__PRTDSI__SYNC_OUT)
|
||||
|
||||
|
||||
#if defined(SCSI_Out_DBx__INTSTAT) /* Interrupt Registers */
|
||||
|
||||
#define SCSI_Out_DBx_INTSTAT (* (reg8 *) SCSI_Out_DBx__INTSTAT)
|
||||
#define SCSI_Out_DBx_SNAP (* (reg8 *) SCSI_Out_DBx__SNAP)
|
||||
|
||||
#endif /* Interrupt Registers */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
#endif /* CY_PINS_SCSI_Out_DBx_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_Out_DBx_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_Out_DBx_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST_ISR.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST_ISR.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST_ISR.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST_ISR.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SCSI_RST_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard_INT.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard_INT.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard_PM.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard_PM.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard_PVT.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SDCard_PVT.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CD.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CD.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CD.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CD.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CD_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CD_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CS.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CS.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CS.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CS.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CS_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_CS_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Clk_Ctl.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Clk_Ctl.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Clk_Ctl.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Clk_Ctl.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT1.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT1.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT1.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT1.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT1_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT1_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT2.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT2.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT2.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT2.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT2_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_DAT2_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Data_Clk.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Data_Clk.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Data_Clk.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Data_Clk.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Init_Clk.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Init_Clk.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Init_Clk.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_Init_Clk.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MISO.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MISO.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MISO.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MISO.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MISO_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MISO_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MOSI.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MOSI.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MOSI.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MOSI.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MOSI_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_MOSI_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_SCK.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_SCK.c
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_SCK.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_SCK.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_SCK_aliases.h
Normal file → Executable file
0
software/SCSI2SD/SCSI2SD.cydsn/Generated_Source/PSoC5/SD_SCK_aliases.h
Normal file → Executable file
|
@ -1,137 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SD_WP.c
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file contains API to enable firmware control of a Pins component.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "SD_WP.h"
|
||||
|
||||
/* APIs are not generated for P15[7:6] on PSoC 5 */
|
||||
#if !(CY_PSOC5A &&\
|
||||
SD_WP__PORT == 15 && ((SD_WP__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SD_WP_Write
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Assign a new value to the digital port's data output register.
|
||||
*
|
||||
* Parameters:
|
||||
* prtValue: The value to be assigned to the Digital Port.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SD_WP_Write(uint8 value)
|
||||
{
|
||||
uint8 staticBits = (SD_WP_DR & (uint8)(~SD_WP_MASK));
|
||||
SD_WP_DR = staticBits | ((uint8)(value << SD_WP_SHIFT) & SD_WP_MASK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SD_WP_SetDriveMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the drive mode on the pins of the port.
|
||||
*
|
||||
* Parameters:
|
||||
* mode: Change the pins to this drive mode.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void SD_WP_SetDriveMode(uint8 mode)
|
||||
{
|
||||
CyPins_SetPinDriveMode(SD_WP_0, mode);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SD_WP_Read
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value on the pins of the Digital Port in right justified
|
||||
* form.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value of the Digital Port as a right justified number
|
||||
*
|
||||
* Note:
|
||||
* Macro SD_WP_ReadPS calls this function.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SD_WP_Read(void)
|
||||
{
|
||||
return (SD_WP_PS & SD_WP_MASK) >> SD_WP_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SD_WP_ReadDataReg
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value assigned to a Digital Port's data output register
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value assigned to the Digital Port's data output register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SD_WP_ReadDataReg(void)
|
||||
{
|
||||
return (SD_WP_DR & SD_WP_MASK) >> SD_WP_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/* If Interrupts Are Enabled for this Pins component */
|
||||
#if defined(SD_WP_INTSTAT)
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: SD_WP_ClearInterrupt
|
||||
********************************************************************************
|
||||
* Summary:
|
||||
* Clears any active interrupts attached to port and returns the value of the
|
||||
* interrupt status register.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the value of the interrupt status register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 SD_WP_ClearInterrupt(void)
|
||||
{
|
||||
return (SD_WP_INTSTAT & SD_WP_MASK) >> SD_WP_SHIFT;
|
||||
}
|
||||
|
||||
#endif /* If Interrupts Are Enabled for this Pins component */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,130 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: SD_WP.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_SD_WP_H) /* Pins SD_WP_H */
|
||||
#define CY_PINS_SD_WP_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
#include "cypins.h"
|
||||
#include "SD_WP_aliases.h"
|
||||
|
||||
/* Check to see if required defines such as CY_PSOC5A are available */
|
||||
/* They are defined starting with cy_boot v3.0 */
|
||||
#if !defined (CY_PSOC5A)
|
||||
#error Component cy_pins_v1_90 requires cy_boot v3.0 or later
|
||||
#endif /* (CY_PSOC5A) */
|
||||
|
||||
/* APIs are not generated for P15[7:6] */
|
||||
#if !(CY_PSOC5A &&\
|
||||
SD_WP__PORT == 15 && ((SD_WP__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void SD_WP_Write(uint8 value) ;
|
||||
void SD_WP_SetDriveMode(uint8 mode) ;
|
||||
uint8 SD_WP_ReadDataReg(void) ;
|
||||
uint8 SD_WP_Read(void) ;
|
||||
uint8 SD_WP_ClearInterrupt(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* API Constants
|
||||
***************************************/
|
||||
|
||||
/* Drive Modes */
|
||||
#define SD_WP_DM_ALG_HIZ PIN_DM_ALG_HIZ
|
||||
#define SD_WP_DM_DIG_HIZ PIN_DM_DIG_HIZ
|
||||
#define SD_WP_DM_RES_UP PIN_DM_RES_UP
|
||||
#define SD_WP_DM_RES_DWN PIN_DM_RES_DWN
|
||||
#define SD_WP_DM_OD_LO PIN_DM_OD_LO
|
||||
#define SD_WP_DM_OD_HI PIN_DM_OD_HI
|
||||
#define SD_WP_DM_STRONG PIN_DM_STRONG
|
||||
#define SD_WP_DM_RES_UPDWN PIN_DM_RES_UPDWN
|
||||
|
||||
/* Digital Port Constants */
|
||||
#define SD_WP_MASK SD_WP__MASK
|
||||
#define SD_WP_SHIFT SD_WP__SHIFT
|
||||
#define SD_WP_WIDTH 1u
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
/* Main Port Registers */
|
||||
/* Pin State */
|
||||
#define SD_WP_PS (* (reg8 *) SD_WP__PS)
|
||||
/* Data Register */
|
||||
#define SD_WP_DR (* (reg8 *) SD_WP__DR)
|
||||
/* Port Number */
|
||||
#define SD_WP_PRT_NUM (* (reg8 *) SD_WP__PRT)
|
||||
/* Connect to Analog Globals */
|
||||
#define SD_WP_AG (* (reg8 *) SD_WP__AG)
|
||||
/* Analog MUX bux enable */
|
||||
#define SD_WP_AMUX (* (reg8 *) SD_WP__AMUX)
|
||||
/* Bidirectional Enable */
|
||||
#define SD_WP_BIE (* (reg8 *) SD_WP__BIE)
|
||||
/* Bit-mask for Aliased Register Access */
|
||||
#define SD_WP_BIT_MASK (* (reg8 *) SD_WP__BIT_MASK)
|
||||
/* Bypass Enable */
|
||||
#define SD_WP_BYP (* (reg8 *) SD_WP__BYP)
|
||||
/* Port wide control signals */
|
||||
#define SD_WP_CTL (* (reg8 *) SD_WP__CTL)
|
||||
/* Drive Modes */
|
||||
#define SD_WP_DM0 (* (reg8 *) SD_WP__DM0)
|
||||
#define SD_WP_DM1 (* (reg8 *) SD_WP__DM1)
|
||||
#define SD_WP_DM2 (* (reg8 *) SD_WP__DM2)
|
||||
/* Input Buffer Disable Override */
|
||||
#define SD_WP_INP_DIS (* (reg8 *) SD_WP__INP_DIS)
|
||||
/* LCD Common or Segment Drive */
|
||||
#define SD_WP_LCD_COM_SEG (* (reg8 *) SD_WP__LCD_COM_SEG)
|
||||
/* Enable Segment LCD */
|
||||
#define SD_WP_LCD_EN (* (reg8 *) SD_WP__LCD_EN)
|
||||
/* Slew Rate Control */
|
||||
#define SD_WP_SLW (* (reg8 *) SD_WP__SLW)
|
||||
|
||||
/* DSI Port Registers */
|
||||
/* Global DSI Select Register */
|
||||
#define SD_WP_PRTDSI__CAPS_SEL (* (reg8 *) SD_WP__PRTDSI__CAPS_SEL)
|
||||
/* Double Sync Enable */
|
||||
#define SD_WP_PRTDSI__DBL_SYNC_IN (* (reg8 *) SD_WP__PRTDSI__DBL_SYNC_IN)
|
||||
/* Output Enable Select Drive Strength */
|
||||
#define SD_WP_PRTDSI__OE_SEL0 (* (reg8 *) SD_WP__PRTDSI__OE_SEL0)
|
||||
#define SD_WP_PRTDSI__OE_SEL1 (* (reg8 *) SD_WP__PRTDSI__OE_SEL1)
|
||||
/* Port Pin Output Select Registers */
|
||||
#define SD_WP_PRTDSI__OUT_SEL0 (* (reg8 *) SD_WP__PRTDSI__OUT_SEL0)
|
||||
#define SD_WP_PRTDSI__OUT_SEL1 (* (reg8 *) SD_WP__PRTDSI__OUT_SEL1)
|
||||
/* Sync Output Enable Registers */
|
||||
#define SD_WP_PRTDSI__SYNC_OUT (* (reg8 *) SD_WP__PRTDSI__SYNC_OUT)
|
||||
|
||||
|
||||
#if defined(SD_WP__INTSTAT) /* Interrupt Registers */
|
||||
|
||||
#define SD_WP_INTSTAT (* (reg8 *) SD_WP__INTSTAT)
|
||||
#define SD_WP_SNAP (* (reg8 *) SD_WP__SNAP)
|
||||
|
||||
#endif /* Interrupt Registers */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
#endif /* CY_PINS_SD_WP_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -77,6 +77,11 @@
|
|||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE0_ALTERNATE0_HID_OUT_BUF_SIZE (65u)
|
||||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE0_ALTERNATE0_HID_NUM_OUT_RPTS (1u)
|
||||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE0_ALTERNATE0_HID_COUNT (1u)
|
||||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE1_ALTERNATE0_HID_IN_BUF_SIZE (65u)
|
||||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE1_ALTERNATE0_HID_NUM_IN_RPTS (1u)
|
||||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE1_ALTERNATE0_HID_OUT_BUF_SIZE (65u)
|
||||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE1_ALTERNATE0_HID_NUM_OUT_RPTS (1u)
|
||||
#define USBFS_DEVICE0_CONFIGURATION0_INTERFACE1_ALTERNATE0_HID_COUNT (1u)
|
||||
#define USBFS_ENABLE_HID_CLASS
|
||||
#define USBFS_HID_RPT_1_SIZE_LSB (0x24u)
|
||||
#define USBFS_HID_RPT_1_SIZE_MSB (0x00u)
|
||||
|
@ -86,12 +91,12 @@
|
|||
#define USBFS_EXTERN_VBUS (0u)
|
||||
#define USBFS_EXTERN_VND (0u)
|
||||
#define USBFS_EXTERN_CLS (0u)
|
||||
#define USBFS_MAX_INTERFACES_NUMBER (1u)
|
||||
#define USBFS_MAX_INTERFACES_NUMBER (2u)
|
||||
#define USBFS_EP0_ISR_REMOVE (0u)
|
||||
#define USBFS_EP1_ISR_REMOVE (0u)
|
||||
#define USBFS_EP2_ISR_REMOVE (0u)
|
||||
#define USBFS_EP3_ISR_REMOVE (1u)
|
||||
#define USBFS_EP4_ISR_REMOVE (1u)
|
||||
#define USBFS_EP3_ISR_REMOVE (0u)
|
||||
#define USBFS_EP4_ISR_REMOVE (0u)
|
||||
#define USBFS_EP5_ISR_REMOVE (1u)
|
||||
#define USBFS_EP6_ISR_REMOVE (1u)
|
||||
#define USBFS_EP7_ISR_REMOVE (1u)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,137 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_Dm.c
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file contains API to enable firmware control of a Pins component.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "USBFS_1_Dm.h"
|
||||
|
||||
/* APIs are not generated for P15[7:6] on PSoC 5 */
|
||||
#if !(CY_PSOC5A &&\
|
||||
USBFS_1_Dm__PORT == 15 && ((USBFS_1_Dm__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dm_Write
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Assign a new value to the digital port's data output register.
|
||||
*
|
||||
* Parameters:
|
||||
* prtValue: The value to be assigned to the Digital Port.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_Dm_Write(uint8 value)
|
||||
{
|
||||
uint8 staticBits = (USBFS_1_Dm_DR & (uint8)(~USBFS_1_Dm_MASK));
|
||||
USBFS_1_Dm_DR = staticBits | ((uint8)(value << USBFS_1_Dm_SHIFT) & USBFS_1_Dm_MASK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dm_SetDriveMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the drive mode on the pins of the port.
|
||||
*
|
||||
* Parameters:
|
||||
* mode: Change the pins to this drive mode.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_Dm_SetDriveMode(uint8 mode)
|
||||
{
|
||||
CyPins_SetPinDriveMode(USBFS_1_Dm_0, mode);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dm_Read
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value on the pins of the Digital Port in right justified
|
||||
* form.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value of the Digital Port as a right justified number
|
||||
*
|
||||
* Note:
|
||||
* Macro USBFS_1_Dm_ReadPS calls this function.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_Dm_Read(void)
|
||||
{
|
||||
return (USBFS_1_Dm_PS & USBFS_1_Dm_MASK) >> USBFS_1_Dm_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dm_ReadDataReg
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value assigned to a Digital Port's data output register
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value assigned to the Digital Port's data output register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_Dm_ReadDataReg(void)
|
||||
{
|
||||
return (USBFS_1_Dm_DR & USBFS_1_Dm_MASK) >> USBFS_1_Dm_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/* If Interrupts Are Enabled for this Pins component */
|
||||
#if defined(USBFS_1_Dm_INTSTAT)
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dm_ClearInterrupt
|
||||
********************************************************************************
|
||||
* Summary:
|
||||
* Clears any active interrupts attached to port and returns the value of the
|
||||
* interrupt status register.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the value of the interrupt status register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_Dm_ClearInterrupt(void)
|
||||
{
|
||||
return (USBFS_1_Dm_INTSTAT & USBFS_1_Dm_MASK) >> USBFS_1_Dm_SHIFT;
|
||||
}
|
||||
|
||||
#endif /* If Interrupts Are Enabled for this Pins component */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,130 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_Dm.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_USBFS_1_Dm_H) /* Pins USBFS_1_Dm_H */
|
||||
#define CY_PINS_USBFS_1_Dm_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
#include "cypins.h"
|
||||
#include "USBFS_1_Dm_aliases.h"
|
||||
|
||||
/* Check to see if required defines such as CY_PSOC5A are available */
|
||||
/* They are defined starting with cy_boot v3.0 */
|
||||
#if !defined (CY_PSOC5A)
|
||||
#error Component cy_pins_v1_90 requires cy_boot v3.0 or later
|
||||
#endif /* (CY_PSOC5A) */
|
||||
|
||||
/* APIs are not generated for P15[7:6] */
|
||||
#if !(CY_PSOC5A &&\
|
||||
USBFS_1_Dm__PORT == 15 && ((USBFS_1_Dm__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void USBFS_1_Dm_Write(uint8 value) ;
|
||||
void USBFS_1_Dm_SetDriveMode(uint8 mode) ;
|
||||
uint8 USBFS_1_Dm_ReadDataReg(void) ;
|
||||
uint8 USBFS_1_Dm_Read(void) ;
|
||||
uint8 USBFS_1_Dm_ClearInterrupt(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* API Constants
|
||||
***************************************/
|
||||
|
||||
/* Drive Modes */
|
||||
#define USBFS_1_Dm_DM_ALG_HIZ PIN_DM_ALG_HIZ
|
||||
#define USBFS_1_Dm_DM_DIG_HIZ PIN_DM_DIG_HIZ
|
||||
#define USBFS_1_Dm_DM_RES_UP PIN_DM_RES_UP
|
||||
#define USBFS_1_Dm_DM_RES_DWN PIN_DM_RES_DWN
|
||||
#define USBFS_1_Dm_DM_OD_LO PIN_DM_OD_LO
|
||||
#define USBFS_1_Dm_DM_OD_HI PIN_DM_OD_HI
|
||||
#define USBFS_1_Dm_DM_STRONG PIN_DM_STRONG
|
||||
#define USBFS_1_Dm_DM_RES_UPDWN PIN_DM_RES_UPDWN
|
||||
|
||||
/* Digital Port Constants */
|
||||
#define USBFS_1_Dm_MASK USBFS_1_Dm__MASK
|
||||
#define USBFS_1_Dm_SHIFT USBFS_1_Dm__SHIFT
|
||||
#define USBFS_1_Dm_WIDTH 1u
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
/* Main Port Registers */
|
||||
/* Pin State */
|
||||
#define USBFS_1_Dm_PS (* (reg8 *) USBFS_1_Dm__PS)
|
||||
/* Data Register */
|
||||
#define USBFS_1_Dm_DR (* (reg8 *) USBFS_1_Dm__DR)
|
||||
/* Port Number */
|
||||
#define USBFS_1_Dm_PRT_NUM (* (reg8 *) USBFS_1_Dm__PRT)
|
||||
/* Connect to Analog Globals */
|
||||
#define USBFS_1_Dm_AG (* (reg8 *) USBFS_1_Dm__AG)
|
||||
/* Analog MUX bux enable */
|
||||
#define USBFS_1_Dm_AMUX (* (reg8 *) USBFS_1_Dm__AMUX)
|
||||
/* Bidirectional Enable */
|
||||
#define USBFS_1_Dm_BIE (* (reg8 *) USBFS_1_Dm__BIE)
|
||||
/* Bit-mask for Aliased Register Access */
|
||||
#define USBFS_1_Dm_BIT_MASK (* (reg8 *) USBFS_1_Dm__BIT_MASK)
|
||||
/* Bypass Enable */
|
||||
#define USBFS_1_Dm_BYP (* (reg8 *) USBFS_1_Dm__BYP)
|
||||
/* Port wide control signals */
|
||||
#define USBFS_1_Dm_CTL (* (reg8 *) USBFS_1_Dm__CTL)
|
||||
/* Drive Modes */
|
||||
#define USBFS_1_Dm_DM0 (* (reg8 *) USBFS_1_Dm__DM0)
|
||||
#define USBFS_1_Dm_DM1 (* (reg8 *) USBFS_1_Dm__DM1)
|
||||
#define USBFS_1_Dm_DM2 (* (reg8 *) USBFS_1_Dm__DM2)
|
||||
/* Input Buffer Disable Override */
|
||||
#define USBFS_1_Dm_INP_DIS (* (reg8 *) USBFS_1_Dm__INP_DIS)
|
||||
/* LCD Common or Segment Drive */
|
||||
#define USBFS_1_Dm_LCD_COM_SEG (* (reg8 *) USBFS_1_Dm__LCD_COM_SEG)
|
||||
/* Enable Segment LCD */
|
||||
#define USBFS_1_Dm_LCD_EN (* (reg8 *) USBFS_1_Dm__LCD_EN)
|
||||
/* Slew Rate Control */
|
||||
#define USBFS_1_Dm_SLW (* (reg8 *) USBFS_1_Dm__SLW)
|
||||
|
||||
/* DSI Port Registers */
|
||||
/* Global DSI Select Register */
|
||||
#define USBFS_1_Dm_PRTDSI__CAPS_SEL (* (reg8 *) USBFS_1_Dm__PRTDSI__CAPS_SEL)
|
||||
/* Double Sync Enable */
|
||||
#define USBFS_1_Dm_PRTDSI__DBL_SYNC_IN (* (reg8 *) USBFS_1_Dm__PRTDSI__DBL_SYNC_IN)
|
||||
/* Output Enable Select Drive Strength */
|
||||
#define USBFS_1_Dm_PRTDSI__OE_SEL0 (* (reg8 *) USBFS_1_Dm__PRTDSI__OE_SEL0)
|
||||
#define USBFS_1_Dm_PRTDSI__OE_SEL1 (* (reg8 *) USBFS_1_Dm__PRTDSI__OE_SEL1)
|
||||
/* Port Pin Output Select Registers */
|
||||
#define USBFS_1_Dm_PRTDSI__OUT_SEL0 (* (reg8 *) USBFS_1_Dm__PRTDSI__OUT_SEL0)
|
||||
#define USBFS_1_Dm_PRTDSI__OUT_SEL1 (* (reg8 *) USBFS_1_Dm__PRTDSI__OUT_SEL1)
|
||||
/* Sync Output Enable Registers */
|
||||
#define USBFS_1_Dm_PRTDSI__SYNC_OUT (* (reg8 *) USBFS_1_Dm__PRTDSI__SYNC_OUT)
|
||||
|
||||
|
||||
#if defined(USBFS_1_Dm__INTSTAT) /* Interrupt Registers */
|
||||
|
||||
#define USBFS_1_Dm_INTSTAT (* (reg8 *) USBFS_1_Dm__INTSTAT)
|
||||
#define USBFS_1_Dm_SNAP (* (reg8 *) USBFS_1_Dm__SNAP)
|
||||
|
||||
#endif /* Interrupt Registers */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
#endif /* CY_PINS_USBFS_1_Dm_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,32 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_Dm.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_USBFS_1_Dm_ALIASES_H) /* Pins USBFS_1_Dm_ALIASES_H */
|
||||
#define CY_PINS_USBFS_1_Dm_ALIASES_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
|
||||
|
||||
|
||||
/***************************************
|
||||
* Constants
|
||||
***************************************/
|
||||
#define USBFS_1_Dm_0 USBFS_1_Dm__0__PC
|
||||
|
||||
#endif /* End Pins USBFS_1_Dm_ALIASES_H */
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,137 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_Dp.c
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file contains API to enable firmware control of a Pins component.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "USBFS_1_Dp.h"
|
||||
|
||||
/* APIs are not generated for P15[7:6] on PSoC 5 */
|
||||
#if !(CY_PSOC5A &&\
|
||||
USBFS_1_Dp__PORT == 15 && ((USBFS_1_Dp__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dp_Write
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Assign a new value to the digital port's data output register.
|
||||
*
|
||||
* Parameters:
|
||||
* prtValue: The value to be assigned to the Digital Port.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_Dp_Write(uint8 value)
|
||||
{
|
||||
uint8 staticBits = (USBFS_1_Dp_DR & (uint8)(~USBFS_1_Dp_MASK));
|
||||
USBFS_1_Dp_DR = staticBits | ((uint8)(value << USBFS_1_Dp_SHIFT) & USBFS_1_Dp_MASK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dp_SetDriveMode
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Change the drive mode on the pins of the port.
|
||||
*
|
||||
* Parameters:
|
||||
* mode: Change the pins to this drive mode.
|
||||
*
|
||||
* Return:
|
||||
* None
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_Dp_SetDriveMode(uint8 mode)
|
||||
{
|
||||
CyPins_SetPinDriveMode(USBFS_1_Dp_0, mode);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dp_Read
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value on the pins of the Digital Port in right justified
|
||||
* form.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value of the Digital Port as a right justified number
|
||||
*
|
||||
* Note:
|
||||
* Macro USBFS_1_Dp_ReadPS calls this function.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_Dp_Read(void)
|
||||
{
|
||||
return (USBFS_1_Dp_PS & USBFS_1_Dp_MASK) >> USBFS_1_Dp_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dp_ReadDataReg
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Read the current value assigned to a Digital Port's data output register
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the current value assigned to the Digital Port's data output register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_Dp_ReadDataReg(void)
|
||||
{
|
||||
return (USBFS_1_Dp_DR & USBFS_1_Dp_MASK) >> USBFS_1_Dp_SHIFT;
|
||||
}
|
||||
|
||||
|
||||
/* If Interrupts Are Enabled for this Pins component */
|
||||
#if defined(USBFS_1_Dp_INTSTAT)
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_Dp_ClearInterrupt
|
||||
********************************************************************************
|
||||
* Summary:
|
||||
* Clears any active interrupts attached to port and returns the value of the
|
||||
* interrupt status register.
|
||||
*
|
||||
* Parameters:
|
||||
* None
|
||||
*
|
||||
* Return:
|
||||
* Returns the value of the interrupt status register
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_Dp_ClearInterrupt(void)
|
||||
{
|
||||
return (USBFS_1_Dp_INTSTAT & USBFS_1_Dp_MASK) >> USBFS_1_Dp_SHIFT;
|
||||
}
|
||||
|
||||
#endif /* If Interrupts Are Enabled for this Pins component */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,130 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_Dp.h
|
||||
* Version 1.90
|
||||
*
|
||||
* Description:
|
||||
* This file containts Control Register function prototypes and register defines
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2012, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_PINS_USBFS_1_Dp_H) /* Pins USBFS_1_Dp_H */
|
||||
#define CY_PINS_USBFS_1_Dp_H
|
||||
|
||||
#include "cytypes.h"
|
||||
#include "cyfitter.h"
|
||||
#include "cypins.h"
|
||||
#include "USBFS_1_Dp_aliases.h"
|
||||
|
||||
/* Check to see if required defines such as CY_PSOC5A are available */
|
||||
/* They are defined starting with cy_boot v3.0 */
|
||||
#if !defined (CY_PSOC5A)
|
||||
#error Component cy_pins_v1_90 requires cy_boot v3.0 or later
|
||||
#endif /* (CY_PSOC5A) */
|
||||
|
||||
/* APIs are not generated for P15[7:6] */
|
||||
#if !(CY_PSOC5A &&\
|
||||
USBFS_1_Dp__PORT == 15 && ((USBFS_1_Dp__MASK & 0xC0) != 0))
|
||||
|
||||
|
||||
/***************************************
|
||||
* Function Prototypes
|
||||
***************************************/
|
||||
|
||||
void USBFS_1_Dp_Write(uint8 value) ;
|
||||
void USBFS_1_Dp_SetDriveMode(uint8 mode) ;
|
||||
uint8 USBFS_1_Dp_ReadDataReg(void) ;
|
||||
uint8 USBFS_1_Dp_Read(void) ;
|
||||
uint8 USBFS_1_Dp_ClearInterrupt(void) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* API Constants
|
||||
***************************************/
|
||||
|
||||
/* Drive Modes */
|
||||
#define USBFS_1_Dp_DM_ALG_HIZ PIN_DM_ALG_HIZ
|
||||
#define USBFS_1_Dp_DM_DIG_HIZ PIN_DM_DIG_HIZ
|
||||
#define USBFS_1_Dp_DM_RES_UP PIN_DM_RES_UP
|
||||
#define USBFS_1_Dp_DM_RES_DWN PIN_DM_RES_DWN
|
||||
#define USBFS_1_Dp_DM_OD_LO PIN_DM_OD_LO
|
||||
#define USBFS_1_Dp_DM_OD_HI PIN_DM_OD_HI
|
||||
#define USBFS_1_Dp_DM_STRONG PIN_DM_STRONG
|
||||
#define USBFS_1_Dp_DM_RES_UPDWN PIN_DM_RES_UPDWN
|
||||
|
||||
/* Digital Port Constants */
|
||||
#define USBFS_1_Dp_MASK USBFS_1_Dp__MASK
|
||||
#define USBFS_1_Dp_SHIFT USBFS_1_Dp__SHIFT
|
||||
#define USBFS_1_Dp_WIDTH 1u
|
||||
|
||||
|
||||
/***************************************
|
||||
* Registers
|
||||
***************************************/
|
||||
|
||||
/* Main Port Registers */
|
||||
/* Pin State */
|
||||
#define USBFS_1_Dp_PS (* (reg8 *) USBFS_1_Dp__PS)
|
||||
/* Data Register */
|
||||
#define USBFS_1_Dp_DR (* (reg8 *) USBFS_1_Dp__DR)
|
||||
/* Port Number */
|
||||
#define USBFS_1_Dp_PRT_NUM (* (reg8 *) USBFS_1_Dp__PRT)
|
||||
/* Connect to Analog Globals */
|
||||
#define USBFS_1_Dp_AG (* (reg8 *) USBFS_1_Dp__AG)
|
||||
/* Analog MUX bux enable */
|
||||
#define USBFS_1_Dp_AMUX (* (reg8 *) USBFS_1_Dp__AMUX)
|
||||
/* Bidirectional Enable */
|
||||
#define USBFS_1_Dp_BIE (* (reg8 *) USBFS_1_Dp__BIE)
|
||||
/* Bit-mask for Aliased Register Access */
|
||||
#define USBFS_1_Dp_BIT_MASK (* (reg8 *) USBFS_1_Dp__BIT_MASK)
|
||||
/* Bypass Enable */
|
||||
#define USBFS_1_Dp_BYP (* (reg8 *) USBFS_1_Dp__BYP)
|
||||
/* Port wide control signals */
|
||||
#define USBFS_1_Dp_CTL (* (reg8 *) USBFS_1_Dp__CTL)
|
||||
/* Drive Modes */
|
||||
#define USBFS_1_Dp_DM0 (* (reg8 *) USBFS_1_Dp__DM0)
|
||||
#define USBFS_1_Dp_DM1 (* (reg8 *) USBFS_1_Dp__DM1)
|
||||
#define USBFS_1_Dp_DM2 (* (reg8 *) USBFS_1_Dp__DM2)
|
||||
/* Input Buffer Disable Override */
|
||||
#define USBFS_1_Dp_INP_DIS (* (reg8 *) USBFS_1_Dp__INP_DIS)
|
||||
/* LCD Common or Segment Drive */
|
||||
#define USBFS_1_Dp_LCD_COM_SEG (* (reg8 *) USBFS_1_Dp__LCD_COM_SEG)
|
||||
/* Enable Segment LCD */
|
||||
#define USBFS_1_Dp_LCD_EN (* (reg8 *) USBFS_1_Dp__LCD_EN)
|
||||
/* Slew Rate Control */
|
||||
#define USBFS_1_Dp_SLW (* (reg8 *) USBFS_1_Dp__SLW)
|
||||
|
||||
/* DSI Port Registers */
|
||||
/* Global DSI Select Register */
|
||||
#define USBFS_1_Dp_PRTDSI__CAPS_SEL (* (reg8 *) USBFS_1_Dp__PRTDSI__CAPS_SEL)
|
||||
/* Double Sync Enable */
|
||||
#define USBFS_1_Dp_PRTDSI__DBL_SYNC_IN (* (reg8 *) USBFS_1_Dp__PRTDSI__DBL_SYNC_IN)
|
||||
/* Output Enable Select Drive Strength */
|
||||
#define USBFS_1_Dp_PRTDSI__OE_SEL0 (* (reg8 *) USBFS_1_Dp__PRTDSI__OE_SEL0)
|
||||
#define USBFS_1_Dp_PRTDSI__OE_SEL1 (* (reg8 *) USBFS_1_Dp__PRTDSI__OE_SEL1)
|
||||
/* Port Pin Output Select Registers */
|
||||
#define USBFS_1_Dp_PRTDSI__OUT_SEL0 (* (reg8 *) USBFS_1_Dp__PRTDSI__OUT_SEL0)
|
||||
#define USBFS_1_Dp_PRTDSI__OUT_SEL1 (* (reg8 *) USBFS_1_Dp__PRTDSI__OUT_SEL1)
|
||||
/* Sync Output Enable Registers */
|
||||
#define USBFS_1_Dp_PRTDSI__SYNC_OUT (* (reg8 *) USBFS_1_Dp__PRTDSI__SYNC_OUT)
|
||||
|
||||
|
||||
#if defined(USBFS_1_Dp__INTSTAT) /* Interrupt Registers */
|
||||
|
||||
#define USBFS_1_Dp_INTSTAT (* (reg8 *) USBFS_1_Dp__INTSTAT)
|
||||
#define USBFS_1_Dp_SNAP (* (reg8 *) USBFS_1_Dp__SNAP)
|
||||
|
||||
#endif /* Interrupt Registers */
|
||||
|
||||
#endif /* CY_PSOC5A... */
|
||||
|
||||
#endif /* CY_PINS_USBFS_1_Dp_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,318 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_audio.c
|
||||
* Version 2.60
|
||||
*
|
||||
* Description:
|
||||
* USB AUDIO Class request handler.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "USBFS_1.h"
|
||||
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_CLASS)
|
||||
|
||||
#include "USBFS_1_audio.h"
|
||||
#include "USBFS_1_pvt.h"
|
||||
#if defined(USBFS_1_ENABLE_MIDI_STREAMING)
|
||||
#include "USBFS_1_midi.h"
|
||||
#endif /* End USBFS_1_ENABLE_MIDI_STREAMING*/
|
||||
|
||||
|
||||
/***************************************
|
||||
* Custom Declarations
|
||||
***************************************/
|
||||
|
||||
/* `#START CUSTOM_DECLARATIONS` Place your declaration here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
|
||||
#if !defined(USER_SUPPLIED_AUDIO_HANDLER)
|
||||
|
||||
|
||||
/***************************************
|
||||
* AUDIO Variables
|
||||
***************************************/
|
||||
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_STREAMING)
|
||||
volatile uint8 USBFS_1_currentSampleFrequency[USBFS_1_MAX_EP][USBFS_1_SAMPLE_FREQ_LEN];
|
||||
volatile uint8 USBFS_1_frequencyChanged;
|
||||
volatile uint8 USBFS_1_currentMute;
|
||||
volatile uint8 USBFS_1_currentVolume[USBFS_1_VOLUME_LEN];
|
||||
volatile uint8 USBFS_1_minimumVolume[USBFS_1_VOLUME_LEN] = {USBFS_1_VOL_MIN_LSB,
|
||||
USBFS_1_VOL_MIN_MSB};
|
||||
volatile uint8 USBFS_1_maximumVolume[USBFS_1_VOLUME_LEN] = {USBFS_1_VOL_MAX_LSB,
|
||||
USBFS_1_VOL_MAX_MSB};
|
||||
volatile uint8 USBFS_1_resolutionVolume[USBFS_1_VOLUME_LEN] = {USBFS_1_VOL_RES_LSB,
|
||||
USBFS_1_VOL_RES_MSB};
|
||||
#endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_DispatchAUDIOClassRqst
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* This routine dispatches class requests
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* requestHandled
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_currentSampleFrequency: Contains the current audio Sample
|
||||
* Frequency. It is set by the Host using SET_CUR request to the endpoint.
|
||||
* USBFS_1_frequencyChanged: This variable is used as a flag for the
|
||||
* user code, to be aware that Host has been sent request for changing
|
||||
* Sample Frequency. Sample frequency will be sent on the next OUT
|
||||
* transaction. It is contains endpoint address when set. The following
|
||||
* code is recommended for detecting new Sample Frequency in main code:
|
||||
* if((USBFS_1_frequencyChanged != 0) &&
|
||||
* (USBFS_1_transferState == USBFS_1_TRANS_STATE_IDLE))
|
||||
* {
|
||||
* USBFS_1_frequencyChanged = 0;
|
||||
* }
|
||||
* USBFS_1_transferState variable is checked to be sure that
|
||||
* transfer completes.
|
||||
* USBFS_1_currentMute: Contains mute configuration set by Host.
|
||||
* USBFS_1_currentVolume: Contains volume level set by Host.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_DispatchAUDIOClassRqst(void)
|
||||
{
|
||||
uint8 requestHandled = USBFS_1_FALSE;
|
||||
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_STREAMING)
|
||||
uint8 epNumber;
|
||||
epNumber = CY_GET_REG8(USBFS_1_wIndexLo) & USBFS_1_DIR_UNUSED;
|
||||
#endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */
|
||||
|
||||
if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == USBFS_1_RQST_DIR_D2H)
|
||||
{
|
||||
/* Control Read */
|
||||
if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \
|
||||
USBFS_1_RQST_RCPT_EP)
|
||||
{
|
||||
/* Endpoint */
|
||||
switch (CY_GET_REG8(USBFS_1_bRequest))
|
||||
{
|
||||
case USBFS_1_GET_CUR:
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_STREAMING)
|
||||
if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_SAMPLING_FREQ_CONTROL)
|
||||
{
|
||||
/* Endpoint Control Selector is Sampling Frequency */
|
||||
USBFS_1_currentTD.wCount = USBFS_1_SAMPLE_FREQ_LEN;
|
||||
USBFS_1_currentTD.pData = USBFS_1_currentSampleFrequency[epNumber];
|
||||
requestHandled = USBFS_1_InitControlRead();
|
||||
}
|
||||
#endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */
|
||||
|
||||
/* `#START AUDIO_READ_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \
|
||||
USBFS_1_RQST_RCPT_IFC)
|
||||
{
|
||||
/* Interface or Entity ID */
|
||||
switch (CY_GET_REG8(USBFS_1_bRequest))
|
||||
{
|
||||
case USBFS_1_GET_CUR:
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_STREAMING)
|
||||
if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_MUTE_CONTROL)
|
||||
{
|
||||
/* `#START MUTE_CONTROL_GET_REQUEST` Place multi-channel handler here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
/* Entity ID Control Selector is MUTE */
|
||||
USBFS_1_currentTD.wCount = 1u;
|
||||
USBFS_1_currentTD.pData = &USBFS_1_currentMute;
|
||||
requestHandled = USBFS_1_InitControlRead();
|
||||
}
|
||||
else if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)
|
||||
{
|
||||
/* `#START VOLUME_CONTROL_GET_REQUEST` Place multi-channel handler here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
/* Entity ID Control Selector is VOLUME, */
|
||||
USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;
|
||||
USBFS_1_currentTD.pData = USBFS_1_currentVolume;
|
||||
requestHandled = USBFS_1_InitControlRead();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* `#START OTHER_GET_CUR_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
}
|
||||
break;
|
||||
case USBFS_1_GET_MIN: /* GET_MIN */
|
||||
if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)
|
||||
{
|
||||
/* Entity ID Control Selector is VOLUME, */
|
||||
USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;
|
||||
USBFS_1_currentTD.pData = &USBFS_1_minimumVolume[0];
|
||||
requestHandled = USBFS_1_InitControlRead();
|
||||
}
|
||||
break;
|
||||
case USBFS_1_GET_MAX: /* GET_MAX */
|
||||
if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)
|
||||
{
|
||||
/* Entity ID Control Selector is VOLUME, */
|
||||
USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;
|
||||
USBFS_1_currentTD.pData = &USBFS_1_maximumVolume[0];
|
||||
requestHandled = USBFS_1_InitControlRead();
|
||||
}
|
||||
break;
|
||||
case USBFS_1_GET_RES: /* GET_RES */
|
||||
if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)
|
||||
{
|
||||
/* Entity ID Control Selector is VOLUME, */
|
||||
USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;
|
||||
USBFS_1_currentTD.pData = &USBFS_1_resolutionVolume[0];
|
||||
requestHandled = USBFS_1_InitControlRead();
|
||||
}
|
||||
break;
|
||||
/* The contents of the status message is reserved for future use.
|
||||
* For the time being, a null packet should be returned in the data stage of the
|
||||
* control transfer, and the received null packet should be ACKed.
|
||||
*/
|
||||
case USBFS_1_GET_STAT:
|
||||
USBFS_1_currentTD.wCount = 0u;
|
||||
requestHandled = USBFS_1_InitControlWrite();
|
||||
|
||||
#endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */
|
||||
|
||||
/* `#START AUDIO_WRITE_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* USBFS_1_RQST_RCPT_OTHER */
|
||||
}
|
||||
}
|
||||
else if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == \
|
||||
USBFS_1_RQST_DIR_H2D)
|
||||
{
|
||||
/* Control Write */
|
||||
if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \
|
||||
USBFS_1_RQST_RCPT_EP)
|
||||
{
|
||||
/* Endpoint */
|
||||
switch (CY_GET_REG8(USBFS_1_bRequest))
|
||||
{
|
||||
case USBFS_1_SET_CUR:
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_STREAMING)
|
||||
if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_SAMPLING_FREQ_CONTROL)
|
||||
{
|
||||
/* Endpoint Control Selector is Sampling Frequency */
|
||||
USBFS_1_currentTD.wCount = USBFS_1_SAMPLE_FREQ_LEN;
|
||||
USBFS_1_currentTD.pData = USBFS_1_currentSampleFrequency[epNumber];
|
||||
requestHandled = USBFS_1_InitControlWrite();
|
||||
USBFS_1_frequencyChanged = epNumber;
|
||||
}
|
||||
#endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */
|
||||
|
||||
/* `#START AUDIO_SAMPLING_FREQ_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK) == \
|
||||
USBFS_1_RQST_RCPT_IFC)
|
||||
{
|
||||
/* Interface or Entity ID */
|
||||
switch (CY_GET_REG8(USBFS_1_bRequest))
|
||||
{
|
||||
case USBFS_1_SET_CUR:
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_STREAMING)
|
||||
if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_MUTE_CONTROL)
|
||||
{
|
||||
/* `#START MUTE_SET_REQUEST` Place multi-channel handler here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
/* Entity ID Control Selector is MUTE */
|
||||
USBFS_1_currentTD.wCount = 1u;
|
||||
USBFS_1_currentTD.pData = &USBFS_1_currentMute;
|
||||
requestHandled = USBFS_1_InitControlWrite();
|
||||
}
|
||||
else if(CY_GET_REG8(USBFS_1_wValueHi) == USBFS_1_VOLUME_CONTROL)
|
||||
{
|
||||
/* `#START VOLUME_CONTROL_SET_REQUEST` Place multi-channel handler here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
/* Entity ID Control Selector is VOLUME */
|
||||
USBFS_1_currentTD.wCount = USBFS_1_VOLUME_LEN;
|
||||
USBFS_1_currentTD.pData = USBFS_1_currentVolume;
|
||||
requestHandled = USBFS_1_InitControlWrite();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* `#START OTHER_SET_CUR_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
}
|
||||
#endif /* End USBFS_1_ENABLE_AUDIO_STREAMING */
|
||||
|
||||
/* `#START AUDIO_CONTROL_SEL_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* USBFS_1_RQST_RCPT_OTHER */
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* requestHandled is initialized as FALSE by default */
|
||||
}
|
||||
|
||||
return(requestHandled);
|
||||
}
|
||||
|
||||
|
||||
#endif /* USER_SUPPLIED_AUDIO_HANDLER */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Additional user functions supporting AUDIO Requests
|
||||
********************************************************************************/
|
||||
|
||||
/* `#START AUDIO_FUNCTIONS` Place any additional functions here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
#endif /* End USBFS_1_ENABLE_AUDIO_CLASS*/
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,95 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_audio.h
|
||||
* Version 2.60
|
||||
*
|
||||
* Description:
|
||||
* Header File for the USFS component. Contains prototypes and constant values.
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_USBFS_USBFS_1_audio_H)
|
||||
#define CY_USBFS_USBFS_1_audio_H
|
||||
|
||||
#include "cytypes.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
* Custom Declarations
|
||||
***************************************/
|
||||
|
||||
/* `#START CUSTOM_CONSTANTS` Place your declaration here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
|
||||
/***************************************
|
||||
* Constants for USBFS_1_audio API.
|
||||
***************************************/
|
||||
|
||||
/* Audio Class-Specific Request Codes (AUDIO Table A-9) */
|
||||
#define USBFS_1_REQUEST_CODE_UNDEFINED (0x00u)
|
||||
#define USBFS_1_SET_CUR (0x01u)
|
||||
#define USBFS_1_GET_CUR (0x81u)
|
||||
#define USBFS_1_SET_MIN (0x02u)
|
||||
#define USBFS_1_GET_MIN (0x82u)
|
||||
#define USBFS_1_SET_MAX (0x03u)
|
||||
#define USBFS_1_GET_MAX (0x83u)
|
||||
#define USBFS_1_SET_RES (0x04u)
|
||||
#define USBFS_1_GET_RES (0x84u)
|
||||
#define USBFS_1_SET_MEM (0x05u)
|
||||
#define USBFS_1_GET_MEM (0x85u)
|
||||
#define USBFS_1_GET_STAT (0xFFu)
|
||||
|
||||
/* Endpoint Control Selectors (AUDIO Table A-19) */
|
||||
#define USBFS_1_EP_CONTROL_UNDEFINED (0x00u)
|
||||
#define USBFS_1_SAMPLING_FREQ_CONTROL (0x01u)
|
||||
#define USBFS_1_PITCH_CONTROL (0x02u)
|
||||
|
||||
/* Feature Unit Control Selectors (AUDIO Table A-11) */
|
||||
#define USBFS_1_FU_CONTROL_UNDEFINED (0x00u)
|
||||
#define USBFS_1_MUTE_CONTROL (0x01u)
|
||||
#define USBFS_1_VOLUME_CONTROL (0x02u)
|
||||
#define USBFS_1_BASS_CONTROL (0x03u)
|
||||
#define USBFS_1_MID_CONTROL (0x04u)
|
||||
#define USBFS_1_TREBLE_CONTROL (0x05u)
|
||||
#define USBFS_1_GRAPHIC_EQUALIZER_CONTROL (0x06u)
|
||||
#define USBFS_1_AUTOMATIC_GAIN_CONTROL (0x07u)
|
||||
#define USBFS_1_DELAY_CONTROL (0x08u)
|
||||
#define USBFS_1_BASS_BOOST_CONTROL (0x09u)
|
||||
#define USBFS_1_LOUDNESS_CONTROL (0x0Au)
|
||||
|
||||
#define USBFS_1_SAMPLE_FREQ_LEN (3u)
|
||||
#define USBFS_1_VOLUME_LEN (2u)
|
||||
|
||||
#if !defined(USER_SUPPLIED_DEFAULT_VOLUME_VALUE)
|
||||
#define USBFS_1_VOL_MIN_MSB (0x80u)
|
||||
#define USBFS_1_VOL_MIN_LSB (0x01u)
|
||||
#define USBFS_1_VOL_MAX_MSB (0x7Fu)
|
||||
#define USBFS_1_VOL_MAX_LSB (0xFFu)
|
||||
#define USBFS_1_VOL_RES_MSB (0x00u)
|
||||
#define USBFS_1_VOL_RES_LSB (0x01u)
|
||||
#endif /* USER_SUPPLIED_DEFAULT_VOLUME_VALUE */
|
||||
|
||||
|
||||
/***************************************
|
||||
* External data references
|
||||
***************************************/
|
||||
|
||||
extern volatile uint8 USBFS_1_currentSampleFrequency[USBFS_1_MAX_EP]
|
||||
[USBFS_1_SAMPLE_FREQ_LEN];
|
||||
extern volatile uint8 USBFS_1_frequencyChanged;
|
||||
extern volatile uint8 USBFS_1_currentMute;
|
||||
extern volatile uint8 USBFS_1_currentVolume[USBFS_1_VOLUME_LEN];
|
||||
extern volatile uint8 USBFS_1_minimumVolume[USBFS_1_VOLUME_LEN];
|
||||
extern volatile uint8 USBFS_1_maximumVolume[USBFS_1_VOLUME_LEN];
|
||||
extern volatile uint8 USBFS_1_resolutionVolume[USBFS_1_VOLUME_LEN];
|
||||
|
||||
#endif /* End CY_USBFS_USBFS_1_audio_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,262 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_boot.c
|
||||
* Version 2.60
|
||||
*
|
||||
* Description:
|
||||
* Boot loader API for USBFS Component.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "USBFS_1.h"
|
||||
|
||||
#if defined(CYDEV_BOOTLOADER_IO_COMP) && ((CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1) || \
|
||||
(CYDEV_BOOTLOADER_IO_COMP == CyBtldr_Custom_Interface))
|
||||
|
||||
|
||||
/***************************************
|
||||
* Bootloader defines
|
||||
***************************************/
|
||||
|
||||
#define USBFS_1_CyBtLdrStarttimer(X, T) {USBFS_1_universalTime = T * 10; X = 0u;}
|
||||
#define USBFS_1_CyBtLdrChecktimer(X) ((X++ < USBFS_1_universalTime) ? 1u : 0u)
|
||||
|
||||
#define USBFS_1_BTLDR_OUT_EP (0x01u)
|
||||
#define USBFS_1_BTLDR_IN_EP (0x02u)
|
||||
|
||||
|
||||
/***************************************
|
||||
* Bootloader Variables
|
||||
***************************************/
|
||||
|
||||
static uint16 USBFS_1_universalTime;
|
||||
static uint8 USBFS_1_started = 0u;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_CyBtldrCommStart
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Starts the component and enables the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
* Side Effects:
|
||||
* This function starts the USB with 3V or 5V operation.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_CyBtldrCommStart(void)
|
||||
{
|
||||
CyGlobalIntEnable; /* Enable Global Interrupts */
|
||||
|
||||
/*Start USBFS Operation/device 0 and with 5V or 3V operation depend on Voltage Configuration in DWR */
|
||||
USBFS_1_Start(0u, USBFS_1_DWR_VDDD_OPERATION);
|
||||
|
||||
/* USB component started, the correct enumeration will be checked in first Read operation */
|
||||
USBFS_1_started = 1u;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_CyBtldrCommStop.
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Disable the component and disable the interrupt.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_CyBtldrCommStop(void)
|
||||
{
|
||||
USBFS_1_Stop();
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_CyBtldrCommReset.
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Resets the receive and transmit communication Buffers.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_CyBtldrCommReset(void)
|
||||
{
|
||||
USBFS_1_EnableOutEP(USBFS_1_BTLDR_OUT_EP); /* Enable the OUT endpoint */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_CyBtldrCommWrite.
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Allows the caller to write data to the boot loader host. The function will
|
||||
* handle polling to allow a block of data to be completely sent to the host
|
||||
* device.
|
||||
*
|
||||
* Parameters:
|
||||
* pData: A pointer to the block of data to send to the device
|
||||
* size: The number of bytes to write.
|
||||
* count: Pointer to an unsigned short variable to write the number of
|
||||
* bytes actually written.
|
||||
* timeOut: Number of units to wait before returning because of a timeout.
|
||||
*
|
||||
* Return:
|
||||
* Returns the value that best describes the problem.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cystatus USBFS_1_CyBtldrCommWrite(uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL
|
||||
|
||||
{
|
||||
uint16 time;
|
||||
cystatus status;
|
||||
|
||||
/* Enable IN transfer */
|
||||
USBFS_1_LoadInEP(USBFS_1_BTLDR_IN_EP, pData, USBFS_1_BTLDR_SIZEOF_READ_BUFFER);
|
||||
|
||||
/* Start a timer to wait on. */
|
||||
USBFS_1_CyBtLdrStarttimer(time, timeOut);
|
||||
|
||||
/* Wait for the master to read it. */
|
||||
while((USBFS_1_GetEPState(USBFS_1_BTLDR_IN_EP) == USBFS_1_IN_BUFFER_FULL) && \
|
||||
USBFS_1_CyBtLdrChecktimer(time))
|
||||
{
|
||||
CyDelay(1u); /* 1ms delay */
|
||||
}
|
||||
|
||||
if (USBFS_1_GetEPState(USBFS_1_BTLDR_IN_EP) == USBFS_1_IN_BUFFER_FULL)
|
||||
{
|
||||
status = CYRET_TIMEOUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
*count = size;
|
||||
status = CYRET_SUCCESS;
|
||||
}
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_CyBtldrCommRead.
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Allows the caller to read data from the boot loader host. The function will
|
||||
* handle polling to allow a block of data to be completely received from the
|
||||
* host device.
|
||||
*
|
||||
* Parameters:
|
||||
* pData: A pointer to the area to store the block of data received
|
||||
* from the device.
|
||||
* size: The number of bytes to read.
|
||||
* count: Pointer to an unsigned short variable to write the number
|
||||
* of bytes actually read.
|
||||
* timeOut: Number of units to wait before returning because of a timeOut.
|
||||
* Timeout is measured in 10s of ms.
|
||||
*
|
||||
* Return:
|
||||
* Returns the value that best describes the problem.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
cystatus USBFS_1_CyBtldrCommRead(uint8 *pData, uint16 size, uint16 *count, uint8 timeOut) CYSMALL
|
||||
|
||||
{
|
||||
cystatus status;
|
||||
uint16 time;
|
||||
|
||||
if(size > USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER)
|
||||
{
|
||||
size = USBFS_1_BTLDR_SIZEOF_WRITE_BUFFER;
|
||||
}
|
||||
/* Start a timer to wait on. */
|
||||
USBFS_1_CyBtLdrStarttimer(time, timeOut);
|
||||
|
||||
/* Wait on enumeration in first time */
|
||||
if(USBFS_1_started)
|
||||
{
|
||||
/* Wait for Device to enumerate */
|
||||
while(!USBFS_1_GetConfiguration() && USBFS_1_CyBtLdrChecktimer(time))
|
||||
{
|
||||
CyDelay(1u); /* 1ms delay */
|
||||
}
|
||||
/* Enable first OUT, if enumeration complete */
|
||||
if(USBFS_1_GetConfiguration())
|
||||
{
|
||||
USBFS_1_IsConfigurationChanged(); /* Clear configuration changes state status */
|
||||
USBFS_1_CyBtldrCommReset();
|
||||
USBFS_1_started = 0u;
|
||||
}
|
||||
}
|
||||
else /* Check for configuration changes, has been done by Host */
|
||||
{
|
||||
if(USBFS_1_IsConfigurationChanged() != 0u) /* Host could send double SET_INTERFACE request or RESET */
|
||||
{
|
||||
if(USBFS_1_GetConfiguration() != 0u) /* Init OUT endpoints when device reconfigured */
|
||||
{
|
||||
USBFS_1_CyBtldrCommReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Wait on next packet */
|
||||
while((USBFS_1_GetEPState(USBFS_1_BTLDR_OUT_EP) != USBFS_1_OUT_BUFFER_FULL) && \
|
||||
USBFS_1_CyBtLdrChecktimer(time))
|
||||
{
|
||||
CyDelay(1u); /* 1ms delay */
|
||||
}
|
||||
|
||||
/* OUT EP has completed */
|
||||
if (USBFS_1_GetEPState(USBFS_1_BTLDR_OUT_EP) == USBFS_1_OUT_BUFFER_FULL)
|
||||
{
|
||||
*count = USBFS_1_ReadOutEP(USBFS_1_BTLDR_OUT_EP, pData, size);
|
||||
status = CYRET_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
*count = 0u;
|
||||
status = CYRET_TIMEOUT;
|
||||
}
|
||||
return(status);
|
||||
}
|
||||
|
||||
#endif /* End CYDEV_BOOTLOADER_IO_COMP == CyBtldr_USBFS_1 */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,706 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_cdc.c
|
||||
* Version 2.60
|
||||
*
|
||||
* Description:
|
||||
* USB HID Class request handler.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2012-2013, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "USBFS_1.h"
|
||||
|
||||
#if defined(USBFS_1_ENABLE_CDC_CLASS)
|
||||
|
||||
#include "USBFS_1_cdc.h"
|
||||
#include "USBFS_1_pvt.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
* CDC Variables
|
||||
***************************************/
|
||||
|
||||
volatile uint8 USBFS_1_lineCoding[USBFS_1_LINE_CODING_SIZE];
|
||||
volatile uint8 USBFS_1_lineChanged;
|
||||
volatile uint16 USBFS_1_lineControlBitmap;
|
||||
volatile uint8 USBFS_1_cdc_data_in_ep;
|
||||
volatile uint8 USBFS_1_cdc_data_out_ep;
|
||||
|
||||
|
||||
/***************************************
|
||||
* Static Function Prototypes
|
||||
***************************************/
|
||||
static uint16 USBFS_1_StrLen(const char8 string[]) ;
|
||||
|
||||
|
||||
/***************************************
|
||||
* Custom Declarations
|
||||
***************************************/
|
||||
|
||||
/* `#START CDC_CUSTOM_DECLARATIONS` Place your declaration here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_DispatchCDCClassRqst
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* This routine dispatches CDC class requests.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* requestHandled
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_lineCoding: Contains the current line coding structure.
|
||||
* It is set by the Host using SET_LINE_CODING request and returned to the
|
||||
* user code by the USBFS_GetDTERate(), USBFS_GetCharFormat(),
|
||||
* USBFS_GetParityType(), USBFS_GetDataBits() APIs.
|
||||
* USBFS_1_lineControlBitmap: Contains the current control signal
|
||||
* bitmap. It is set by the Host using SET_CONTROL_LINE request and returned
|
||||
* to the user code by the USBFS_GetLineControl() API.
|
||||
* USBFS_1_lineChanged: This variable is used as a flag for the
|
||||
* USBFS_IsLineChanged() API, to be aware that Host has been sent request
|
||||
* for changing Line Coding or Control Bitmap.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_DispatchCDCClassRqst(void)
|
||||
{
|
||||
uint8 requestHandled = USBFS_1_FALSE;
|
||||
|
||||
if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == USBFS_1_RQST_DIR_D2H)
|
||||
{ /* Control Read */
|
||||
switch (CY_GET_REG8(USBFS_1_bRequest))
|
||||
{
|
||||
case USBFS_1_CDC_GET_LINE_CODING:
|
||||
USBFS_1_currentTD.count = USBFS_1_LINE_CODING_SIZE;
|
||||
USBFS_1_currentTD.pData = USBFS_1_lineCoding;
|
||||
requestHandled = USBFS_1_InitControlRead();
|
||||
break;
|
||||
|
||||
/* `#START CDC_READ_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
default: /* requestHandled is initialized as FALSE by default */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ((CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_DIR_MASK) == \
|
||||
USBFS_1_RQST_DIR_H2D)
|
||||
{ /* Control Write */
|
||||
switch (CY_GET_REG8(USBFS_1_bRequest))
|
||||
{
|
||||
case USBFS_1_CDC_SET_LINE_CODING:
|
||||
USBFS_1_currentTD.count = USBFS_1_LINE_CODING_SIZE;
|
||||
USBFS_1_currentTD.pData = USBFS_1_lineCoding;
|
||||
USBFS_1_lineChanged |= USBFS_1_LINE_CODING_CHANGED;
|
||||
requestHandled = USBFS_1_InitControlWrite();
|
||||
break;
|
||||
|
||||
case USBFS_1_CDC_SET_CONTROL_LINE_STATE:
|
||||
USBFS_1_lineControlBitmap = CY_GET_REG8(USBFS_1_wValueLo);
|
||||
USBFS_1_lineChanged |= USBFS_1_LINE_CONTROL_CHANGED;
|
||||
requestHandled = USBFS_1_InitNoDataControlTransfer();
|
||||
break;
|
||||
|
||||
/* `#START CDC_WRITE_REQUESTS` Place other request handler here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
default: /* requestHandled is initialized as FALSE by default */
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* requestHandled is initialized as FALSE by default */
|
||||
}
|
||||
|
||||
return(requestHandled);
|
||||
}
|
||||
|
||||
|
||||
/***************************************
|
||||
* Optional CDC APIs
|
||||
***************************************/
|
||||
#if (USBFS_1_ENABLE_CDC_CLASS_API != 0u)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_CDC_Init
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* This function initialize the CDC interface to be ready for the receive data
|
||||
* from the PC.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_lineChanged: Initialized to zero.
|
||||
* USBFS_1_cdc_data_out_ep: Used as an OUT endpoint number.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_CDC_Init(void)
|
||||
{
|
||||
USBFS_1_lineChanged = 0u;
|
||||
USBFS_1_EnableOutEP(USBFS_1_cdc_data_out_ep);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_PutData
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Sends a specified number of bytes from the location specified by a
|
||||
* pointer to the PC.
|
||||
*
|
||||
* Parameters:
|
||||
* pData: pointer to the buffer containing data to be sent.
|
||||
* length: Specifies the number of bytes to send from the pData
|
||||
* buffer. Maximum length will be limited by the maximum packet
|
||||
* size for the endpoint.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending
|
||||
* data.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_PutData(const uint8* pData, uint16 length)
|
||||
{
|
||||
/* Limits length to maximum packet size for the EP */
|
||||
if(length > USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize)
|
||||
{
|
||||
/* Caution: Data will be lost if length is greater than Max Packet Length */
|
||||
length = USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize;
|
||||
/* Halt CPU in debug mode */
|
||||
CYASSERT(0u != 0u);
|
||||
}
|
||||
USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, pData, length);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_StrLen
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Calculates length of a null terminated string.
|
||||
*
|
||||
* Parameters:
|
||||
* string: pointer to the string.
|
||||
*
|
||||
* Return:
|
||||
* Length of the string
|
||||
*
|
||||
*******************************************************************************/
|
||||
static uint16 USBFS_1_StrLen(const char8 string[])
|
||||
{
|
||||
uint16 len = 0u;
|
||||
|
||||
while (string[len] != (char8)0)
|
||||
{
|
||||
len++;
|
||||
}
|
||||
|
||||
return (len);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_PutString
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Sends a null terminated string to the PC.
|
||||
*
|
||||
* Parameters:
|
||||
* string: pointer to the string to be sent to the PC
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending
|
||||
* data.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
* Theory:
|
||||
* This function will block if there is not enough memory to place the whole
|
||||
* string, it will block until the entire string has been written to the
|
||||
* transmit buffer.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_PutString(const char8 string[])
|
||||
{
|
||||
uint16 str_length;
|
||||
uint16 send_length;
|
||||
uint16 buf_index = 0u;
|
||||
|
||||
/* Get length of the null terminated string */
|
||||
str_length = USBFS_1_StrLen(string);
|
||||
do
|
||||
{
|
||||
/* Limits length to maximum packet size for the EP */
|
||||
send_length = (str_length > USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize) ?
|
||||
USBFS_1_EP[USBFS_1_cdc_data_in_ep].bufferSize : str_length;
|
||||
/* Enable IN transfer */
|
||||
USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, (const uint8 *)&string[buf_index], send_length);
|
||||
str_length -= send_length;
|
||||
|
||||
/* If more data are present to send */
|
||||
if(str_length > 0u)
|
||||
{
|
||||
buf_index += send_length;
|
||||
/* Wait for the Host to read it. */
|
||||
while(USBFS_1_EP[USBFS_1_cdc_data_in_ep].apiEpState ==
|
||||
USBFS_1_IN_BUFFER_FULL)
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}while(str_length > 0u);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_PutChar
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Writes a single character to the PC.
|
||||
*
|
||||
* Parameters:
|
||||
* txDataByte: Character to be sent to the PC.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending
|
||||
* data.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_PutChar(char8 txDataByte)
|
||||
{
|
||||
uint8 dataByte;
|
||||
dataByte = (uint8)txDataByte;
|
||||
|
||||
USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, &dataByte, 1u);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_PutCRLF
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Sends a carriage return (0x0D) and line feed (0x0A) to the PC
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* None.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_in_ep: CDC IN endpoint number used for sending
|
||||
* data.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
void USBFS_1_PutCRLF(void)
|
||||
{
|
||||
const uint8 CYCODE txData[] = {0x0Du, 0x0Au};
|
||||
|
||||
USBFS_1_LoadInEP(USBFS_1_cdc_data_in_ep, (const uint8 *)txData, 2u);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetCount
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* This function returns the number of bytes that were received from the PC.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns the number of received bytes.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint16 USBFS_1_GetCount(void)
|
||||
{
|
||||
uint16 bytesCount = 0u;
|
||||
|
||||
if (USBFS_1_EP[USBFS_1_cdc_data_out_ep].apiEpState == USBFS_1_OUT_BUFFER_FULL)
|
||||
{
|
||||
bytesCount = USBFS_1_GetEPCount(USBFS_1_cdc_data_out_ep);
|
||||
}
|
||||
|
||||
return(bytesCount);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_DataIsReady
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Returns a nonzero value if the component received data or received
|
||||
* zero-length packet. The GetAll() or GetData() API should be called to read
|
||||
* data from the buffer and re-init OUT endpoint even when zero-length packet
|
||||
* received.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* If the OUT packet received this function returns a nonzero value.
|
||||
* Otherwise zero is returned.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_DataIsReady(void)
|
||||
{
|
||||
return(USBFS_1_EP[USBFS_1_cdc_data_out_ep].apiEpState);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_CDCIsReady
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Returns a nonzero value if the component is ready to send more data to the
|
||||
* PC. Otherwise returns zero. Should be called before sending new data to
|
||||
* ensure the previous data has finished sending.This function returns the
|
||||
* number of bytes that were received from the PC.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* If the buffer can accept new data then this function returns a nonzero value.
|
||||
* Otherwise zero is returned.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_in_ep: CDC IN endpoint number used.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_CDCIsReady(void)
|
||||
{
|
||||
return(USBFS_1_EP[USBFS_1_cdc_data_in_ep].apiEpState);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetData
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets a specified number of bytes from the input buffer and places it in a
|
||||
* data array specified by the passed pointer.
|
||||
* USBFS_1_DataIsReady() API should be called before, to be sure
|
||||
* that data is received from the Host.
|
||||
*
|
||||
* Parameters:
|
||||
* pData: Pointer to the data array where data will be placed.
|
||||
* Length: Number of bytes to read into the data array from the RX buffer.
|
||||
* Maximum length is limited by the the number of received bytes.
|
||||
*
|
||||
* Return:
|
||||
* Number of bytes received.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint16 USBFS_1_GetData(uint8* pData, uint16 length)
|
||||
{
|
||||
return(USBFS_1_ReadOutEP(USBFS_1_cdc_data_out_ep, pData, length));
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetAll
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Gets all bytes of received data from the input buffer and places it into a
|
||||
* specified data array. USBFS_1_DataIsReady() API should be called
|
||||
* before, to be sure that data is received from the Host.
|
||||
*
|
||||
* Parameters:
|
||||
* pData: Pointer to the data array where data will be placed.
|
||||
*
|
||||
* Return:
|
||||
* Number of bytes received.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.
|
||||
* USBFS_1_EP[].bufferSize: EP max packet size is used as a length
|
||||
* to read all data from the EP buffer.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint16 USBFS_1_GetAll(uint8* pData)
|
||||
{
|
||||
return (USBFS_1_ReadOutEP(USBFS_1_cdc_data_out_ep, pData,
|
||||
USBFS_1_EP[USBFS_1_cdc_data_out_ep].bufferSize));
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetChar
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Reads one byte of received data from the buffer.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Received one character.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_cdc_data_out_ep: CDC OUT endpoint number used.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_GetChar(void)
|
||||
{
|
||||
uint8 rxData;
|
||||
|
||||
(void) USBFS_1_ReadOutEP(USBFS_1_cdc_data_out_ep, &rxData, 1u);
|
||||
|
||||
return(rxData);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_IsLineChanged
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* This function returns clear on read status of the line.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* If SET_LINE_CODING or CDC_SET_CONTROL_LINE_STATE request received then not
|
||||
* zero value returned. Otherwise zero is returned.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_transferState - it is checked to be sure then OUT data
|
||||
* phase has been complete, and data written to the lineCoding or Control
|
||||
* Bitmap buffer.
|
||||
* USBFS_1_lineChanged: used as a flag to be aware that Host has been
|
||||
* sent request for changing Line Coding or Control Bitmap.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_IsLineChanged(void)
|
||||
{
|
||||
uint8 state = 0u;
|
||||
|
||||
/* transferState is checked to be sure then OUT data phase has been complete */
|
||||
if(USBFS_1_transferState == USBFS_1_TRANS_STATE_IDLE)
|
||||
{
|
||||
if(USBFS_1_lineChanged != 0u)
|
||||
{
|
||||
state = USBFS_1_lineChanged;
|
||||
USBFS_1_lineChanged = 0u;
|
||||
}
|
||||
}
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetDTERate
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Returns the data terminal rate set for this port in bits per second.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns a uint32 value of the data rate in bits per second.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_lineCoding: First four bytes converted to uint32
|
||||
* depend on compiler, and returned as a data rate.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint32 USBFS_1_GetDTERate(void)
|
||||
{
|
||||
uint32 rate;
|
||||
|
||||
rate = USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE + 3u];
|
||||
rate = (rate << 8u) | USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE + 2u];
|
||||
rate = (rate << 8u) | USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE + 1u];
|
||||
rate = (rate << 8u) | USBFS_1_lineCoding[USBFS_1_LINE_CODING_RATE];
|
||||
|
||||
return(rate);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetCharFormat
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Returns the number of stop bits.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns the number of stop bits.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_lineCoding: used to get a parameter.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_GetCharFormat(void)
|
||||
{
|
||||
return(USBFS_1_lineCoding[USBFS_1_LINE_CODING_STOP_BITS]);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetParityType
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Returns the parity type for the CDC port.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns the parity type.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_lineCoding: used to get a parameter.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_GetParityType(void)
|
||||
{
|
||||
return(USBFS_1_lineCoding[USBFS_1_LINE_CODING_PARITY]);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetDataBits
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Returns the number of data bits for the CDC port.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns the number of data bits.
|
||||
* The number of data bits can be 5, 6, 7, 8 or 16.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_lineCoding: used to get a parameter.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_GetDataBits(void)
|
||||
{
|
||||
return(USBFS_1_lineCoding[USBFS_1_LINE_CODING_DATA_BITS]);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_GetLineControl
|
||||
********************************************************************************
|
||||
*
|
||||
* Summary:
|
||||
* Returns Line control bitmap.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* Returns Line control bitmap.
|
||||
*
|
||||
* Global variables:
|
||||
* USBFS_1_lineControlBitmap: used to get a parameter.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint16 USBFS_1_GetLineControl(void)
|
||||
{
|
||||
return(USBFS_1_lineControlBitmap);
|
||||
}
|
||||
|
||||
#endif /* End USBFS_1_ENABLE_CDC_CLASS_API*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Additional user functions supporting CDC Requests
|
||||
********************************************************************************/
|
||||
|
||||
/* `#START CDC_FUNCTIONS` Place any additional functions here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
#endif /* End USBFS_1_ENABLE_CDC_CLASS*/
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,92 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_cdc.h
|
||||
* Version 2.60
|
||||
*
|
||||
* Description:
|
||||
* Header File for the USFS component.
|
||||
* Contains CDC class prototypes and constant values.
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2012-2013, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#if !defined(CY_USBFS_USBFS_1_cdc_H)
|
||||
#define CY_USBFS_USBFS_1_cdc_H
|
||||
|
||||
#include "cytypes.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
* Prototypes of the USBFS_1_cdc API.
|
||||
***************************************/
|
||||
|
||||
#if (USBFS_1_ENABLE_CDC_CLASS_API != 0u)
|
||||
void USBFS_1_CDC_Init(void) ;
|
||||
void USBFS_1_PutData(const uint8* pData, uint16 length) ;
|
||||
void USBFS_1_PutString(const char8 string[]) ;
|
||||
void USBFS_1_PutChar(char8 txDataByte) ;
|
||||
void USBFS_1_PutCRLF(void) ;
|
||||
uint16 USBFS_1_GetCount(void) ;
|
||||
uint8 USBFS_1_CDCIsReady(void) ;
|
||||
uint8 USBFS_1_DataIsReady(void) ;
|
||||
uint16 USBFS_1_GetData(uint8* pData, uint16 length) ;
|
||||
uint16 USBFS_1_GetAll(uint8* pData) ;
|
||||
uint8 USBFS_1_GetChar(void) ;
|
||||
uint8 USBFS_1_IsLineChanged(void) ;
|
||||
uint32 USBFS_1_GetDTERate(void) ;
|
||||
uint8 USBFS_1_GetCharFormat(void) ;
|
||||
uint8 USBFS_1_GetParityType(void) ;
|
||||
uint8 USBFS_1_GetDataBits(void) ;
|
||||
uint16 USBFS_1_GetLineControl(void) ;
|
||||
#endif /* End USBFS_1_ENABLE_CDC_CLASS_API*/
|
||||
|
||||
|
||||
/***************************************
|
||||
* Constants for USBFS_1_cdc API.
|
||||
***************************************/
|
||||
|
||||
/* CDC Class-Specific Request Codes (CDC ver 1.2 Table 19) */
|
||||
#define USBFS_1_CDC_SET_LINE_CODING (0x20u)
|
||||
#define USBFS_1_CDC_GET_LINE_CODING (0x21u)
|
||||
#define USBFS_1_CDC_SET_CONTROL_LINE_STATE (0x22u)
|
||||
|
||||
#define USBFS_1_LINE_CODING_CHANGED (0x01u)
|
||||
#define USBFS_1_LINE_CONTROL_CHANGED (0x02u)
|
||||
|
||||
#define USBFS_1_1_STOPBIT (0x00u)
|
||||
#define USBFS_1_1_5_STOPBITS (0x01u)
|
||||
#define USBFS_1_2_STOPBITS (0x02u)
|
||||
|
||||
#define USBFS_1_PARITY_NONE (0x00u)
|
||||
#define USBFS_1_PARITY_ODD (0x01u)
|
||||
#define USBFS_1_PARITY_EVEN (0x02u)
|
||||
#define USBFS_1_PARITY_MARK (0x03u)
|
||||
#define USBFS_1_PARITY_SPACE (0x04u)
|
||||
|
||||
#define USBFS_1_LINE_CODING_SIZE (0x07u)
|
||||
#define USBFS_1_LINE_CODING_RATE (0x00u)
|
||||
#define USBFS_1_LINE_CODING_STOP_BITS (0x04u)
|
||||
#define USBFS_1_LINE_CODING_PARITY (0x05u)
|
||||
#define USBFS_1_LINE_CODING_DATA_BITS (0x06u)
|
||||
|
||||
#define USBFS_1_LINE_CONTROL_DTR (0x01u)
|
||||
#define USBFS_1_LINE_CONTROL_RTS (0x02u)
|
||||
|
||||
|
||||
/***************************************
|
||||
* External data references
|
||||
***************************************/
|
||||
|
||||
extern volatile uint8 USBFS_1_lineCoding[USBFS_1_LINE_CODING_SIZE];
|
||||
extern volatile uint8 USBFS_1_lineChanged;
|
||||
extern volatile uint16 USBFS_1_lineControlBitmap;
|
||||
extern volatile uint8 USBFS_1_cdc_data_in_ep;
|
||||
extern volatile uint8 USBFS_1_cdc_data_out_ep;
|
||||
|
||||
#endif /* End CY_USBFS_USBFS_1_cdc_H */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
|
@ -1,122 +0,0 @@
|
|||
;******************************************************************************
|
||||
; File Name: USBFS_1_cdc.inf
|
||||
; Version 2.60
|
||||
;
|
||||
; Description:
|
||||
; Windows USB CDC setup file for USBUART Device.
|
||||
;
|
||||
;******************************************************************************
|
||||
; Copyright 2007-2013, Cypress Semiconductor Corporation. All rights reserved.
|
||||
; You may use this file only in accordance with the license, terms, conditions,
|
||||
; disclaimers, and limitations in the end user license agreement accompanying
|
||||
; the software package with which this file was provided.
|
||||
;******************************************************************************
|
||||
|
||||
[Version]
|
||||
Signature="$Windows NT$"
|
||||
Class=Ports
|
||||
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
|
||||
Provider=%PROVIDER%
|
||||
LayoutFile=layout.inf
|
||||
DriverVer=03/05/2007,2.0.0000.0
|
||||
|
||||
[Manufacturer]
|
||||
%MFGNAME%=DeviceList, NTx86, NTia64, NTamd64
|
||||
|
||||
[DestinationDirs]
|
||||
DefaultDestDir=12
|
||||
|
||||
[SourceDisksFiles]
|
||||
|
||||
[SourceDisksNames]
|
||||
|
||||
[DeviceList.NTx86]
|
||||
%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232
|
||||
|
||||
[DeviceList.NTia64]
|
||||
%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232
|
||||
|
||||
[DeviceList.NTamd64]
|
||||
%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; 32 bit section for Windows 2000/2003/XP/Vista
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
[DriverInstall.NTx86]
|
||||
include=mdmcpq.inf
|
||||
CopyFiles=DriverCopyFiles
|
||||
AddReg=DriverInstall.NTx86.AddReg
|
||||
|
||||
[DriverCopyFiles]
|
||||
usbser.sys,,,0x20
|
||||
|
||||
[DriverInstall.NTx86.AddReg]
|
||||
HKR,,DevLoader,,*ntkern
|
||||
HKR,,NTMPDriver,,usbser.sys
|
||||
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
|
||||
|
||||
[DriverInstall.NTx86.Services]
|
||||
AddService=usbser, 0x00000002, DriverService
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; 64 bit section for Intel Itanium based systems
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
[DriverInstall.NTia64]
|
||||
include=mdmcpq.inf
|
||||
CopyFiles=DriverCopyFiles
|
||||
AddReg=DriverInstall.NTia64.AddReg
|
||||
|
||||
[DriverCopyFiles]
|
||||
usbser.sys,,,0x20
|
||||
|
||||
[DriverInstall.NTia64.AddReg]
|
||||
HKR,,DevLoader,,*ntkern
|
||||
HKR,,NTMPDriver,,usbser.sys
|
||||
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
|
||||
|
||||
[DriverInstall.NTia64.Services]
|
||||
AddService=usbser, 0x00000002, DriverService
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; 64 bit section for AMD64 and Intel EM64T based systems
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
[DriverInstall.NTamd64]
|
||||
include=mdmcpq.inf
|
||||
CopyFiles=DriverCopyFiles
|
||||
AddReg=DriverInstall.NTamd64.AddReg
|
||||
|
||||
[DriverCopyFiles]
|
||||
usbser.sys,,,0x20
|
||||
|
||||
[DriverInstall.NTamd64.AddReg]
|
||||
HKR,,DevLoader,,*ntkern
|
||||
HKR,,NTMPDriver,,usbser.sys
|
||||
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
|
||||
|
||||
[DriverInstall.NTamd64.Services]
|
||||
AddService=usbser, 0x00000002, DriverService
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
;
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
[DriverService]
|
||||
DisplayName=%SERVICE%
|
||||
ServiceType=1
|
||||
StartType=3
|
||||
ErrorControl=1
|
||||
ServiceBinary=%12%\usbser.sys
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; String Definitions
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
[Strings]
|
||||
PROVIDER="Cypress"
|
||||
MFGNAME="Cypress Semiconductor Corporation"
|
||||
DESCRIPTION="Cypress USB UART"
|
||||
SERVICE="USB UART"
|
|
@ -1,107 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* File Name: USBFS_1_cls.c
|
||||
* Version 2.60
|
||||
*
|
||||
* Description:
|
||||
* USB Class request handler.
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
********************************************************************************
|
||||
* Copyright 2008-2013, Cypress Semiconductor Corporation. All rights reserved.
|
||||
* You may use this file only in accordance with the license, terms, conditions,
|
||||
* disclaimers, and limitations in the end user license agreement accompanying
|
||||
* the software package with which this file was provided.
|
||||
*******************************************************************************/
|
||||
|
||||
#include "USBFS_1.h"
|
||||
|
||||
#if(USBFS_1_EXTERN_CLS == USBFS_1_FALSE)
|
||||
|
||||
#include "USBFS_1_pvt.h"
|
||||
|
||||
|
||||
/***************************************
|
||||
* User Implemented Class Driver Declarations.
|
||||
***************************************/
|
||||
/* `#START USER_DEFINED_CLASS_DECLARATIONS` Place your declaration here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name: USBFS_1_DispatchClassRqst
|
||||
********************************************************************************
|
||||
* Summary:
|
||||
* This routine dispatches class specific requests depend on interface class.
|
||||
*
|
||||
* Parameters:
|
||||
* None.
|
||||
*
|
||||
* Return:
|
||||
* requestHandled.
|
||||
*
|
||||
* Reentrant:
|
||||
* No.
|
||||
*
|
||||
*******************************************************************************/
|
||||
uint8 USBFS_1_DispatchClassRqst(void)
|
||||
{
|
||||
uint8 requestHandled = USBFS_1_FALSE;
|
||||
uint8 interfaceNumber = 0u;
|
||||
|
||||
switch(CY_GET_REG8(USBFS_1_bmRequestType) & USBFS_1_RQST_RCPT_MASK)
|
||||
{
|
||||
case USBFS_1_RQST_RCPT_IFC: /* Class-specific request directed to an interface */
|
||||
interfaceNumber = CY_GET_REG8(USBFS_1_wIndexLo); /* wIndexLo contain Interface number */
|
||||
break;
|
||||
case USBFS_1_RQST_RCPT_EP: /* Class-specific request directed to the endpoint */
|
||||
/* Find related interface to the endpoint, wIndexLo contain EP number */
|
||||
interfaceNumber =
|
||||
USBFS_1_EP[CY_GET_REG8(USBFS_1_wIndexLo) & USBFS_1_DIR_UNUSED].interface;
|
||||
break;
|
||||
default: /* RequestHandled is initialized as FALSE by default */
|
||||
break;
|
||||
}
|
||||
/* Handle Class request depend on interface type */
|
||||
switch(USBFS_1_interfaceClass[interfaceNumber])
|
||||
{
|
||||
case USBFS_1_CLASS_HID:
|
||||
#if defined(USBFS_1_ENABLE_HID_CLASS)
|
||||
requestHandled = USBFS_1_DispatchHIDClassRqst();
|
||||
#endif /* USBFS_1_ENABLE_HID_CLASS */
|
||||
break;
|
||||
case USBFS_1_CLASS_AUDIO:
|
||||
#if defined(USBFS_1_ENABLE_AUDIO_CLASS)
|
||||
requestHandled = USBFS_1_DispatchAUDIOClassRqst();
|
||||
#endif /* USBFS_1_ENABLE_HID_CLASS */
|
||||
break;
|
||||
case USBFS_1_CLASS_CDC:
|
||||
#if defined(USBFS_1_ENABLE_CDC_CLASS)
|
||||
requestHandled = USBFS_1_DispatchCDCClassRqst();
|
||||
#endif /* USBFS_1_ENABLE_CDC_CLASS */
|
||||
break;
|
||||
default: /* requestHandled is initialized as FALSE by default */
|
||||
break;
|
||||
}
|
||||
|
||||
/* `#START USER_DEFINED_CLASS_CODE` Place your Class request here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
return(requestHandled);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Additional user functions supporting Class Specific Requests
|
||||
********************************************************************************/
|
||||
|
||||
/* `#START CLASS_SPECIFIC_FUNCTIONS` Place any additional functions here */
|
||||
|
||||
/* `#END` */
|
||||
|
||||
#endif /* USBFS_1_EXTERN_CLS */
|
||||
|
||||
|
||||
/* [] END OF FILE */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user