--- /dev/null
+/*******************************************************************************
+* File Name: NOR_RX_DMA_COMPLETE.c
+* Version 1.70
+*
+* Description:
+* API for controlling the state of an interrupt.
+*
+*
+* Note:
+*
+********************************************************************************
+* Copyright 2008-2015, 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 <NOR_RX_DMA_COMPLETE.h>
+
+
+#if !defined(NOR_RX_DMA_COMPLETE__REMOVED) /* Check for removal by optimization */
+
+/*******************************************************************************
+* Place your includes, defines and code here
+********************************************************************************/
+/* `#START NOR_RX_DMA_COMPLETE_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: NOR_RX_DMA_COMPLETE_Start
+********************************************************************************
+*
+* Summary:
+* Set up the interrupt and enable it. This function disables the interrupt,
+* sets the default interrupt vector, sets the priority from the value in the
+* Design Wide Resources Interrupt Editor, then enables the interrupt to the
+* interrupt controller.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_Start(void)
+{
+ /* For all we know the interrupt is active. */
+ NOR_RX_DMA_COMPLETE_Disable();
+
+ /* Set the ISR to point to the NOR_RX_DMA_COMPLETE Interrupt. */
+ NOR_RX_DMA_COMPLETE_SetVector(&NOR_RX_DMA_COMPLETE_Interrupt);
+
+ /* Set the priority. */
+ NOR_RX_DMA_COMPLETE_SetPriority((uint8)NOR_RX_DMA_COMPLETE_INTC_PRIOR_NUMBER);
+
+ /* Enable it. */
+ NOR_RX_DMA_COMPLETE_Enable();
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_StartEx
+********************************************************************************
+*
+* Summary:
+* Sets up the interrupt and enables it. This function disables the interrupt,
+* sets the interrupt vector based on the address passed in, sets the priority
+* from the value in the Design Wide Resources Interrupt Editor, then enables
+* the interrupt to the interrupt controller.
+*
+* When defining ISR functions, the CY_ISR and CY_ISR_PROTO macros should be
+* used to provide consistent definition across compilers:
+*
+* Function definition example:
+* CY_ISR(MyISR)
+* {
+* }
+* Function prototype example:
+* CY_ISR_PROTO(MyISR);
+*
+* Parameters:
+* address: Address of the ISR to set in the interrupt vector table.
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_StartEx(cyisraddress address)
+{
+ /* For all we know the interrupt is active. */
+ NOR_RX_DMA_COMPLETE_Disable();
+
+ /* Set the ISR to point to the NOR_RX_DMA_COMPLETE Interrupt. */
+ NOR_RX_DMA_COMPLETE_SetVector(address);
+
+ /* Set the priority. */
+ NOR_RX_DMA_COMPLETE_SetPriority((uint8)NOR_RX_DMA_COMPLETE_INTC_PRIOR_NUMBER);
+
+ /* Enable it. */
+ NOR_RX_DMA_COMPLETE_Enable();
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_Stop
+********************************************************************************
+*
+* Summary:
+* Disables and removes the interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_Stop(void)
+{
+ /* Disable this interrupt. */
+ NOR_RX_DMA_COMPLETE_Disable();
+
+ /* Set the ISR to point to the passive one. */
+ NOR_RX_DMA_COMPLETE_SetVector(&IntDefaultHandler);
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_Interrupt
+********************************************************************************
+*
+* Summary:
+* The default Interrupt Service Routine for NOR_RX_DMA_COMPLETE.
+*
+* Add custom code between the coments to keep the next version of this file
+* from over writting your code.
+*
+* Parameters:
+*
+* Return:
+* None
+*
+*******************************************************************************/
+CY_ISR(NOR_RX_DMA_COMPLETE_Interrupt)
+{
+ #ifdef NOR_RX_DMA_COMPLETE_INTERRUPT_INTERRUPT_CALLBACK
+ NOR_RX_DMA_COMPLETE_Interrupt_InterruptCallback();
+ #endif /* NOR_RX_DMA_COMPLETE_INTERRUPT_INTERRUPT_CALLBACK */
+
+ /* Place your Interrupt code here. */
+ /* `#START NOR_RX_DMA_COMPLETE_Interrupt` */
+
+ /* `#END` */
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_SetVector
+********************************************************************************
+*
+* Summary:
+* Change the ISR vector for the Interrupt. Note calling NOR_RX_DMA_COMPLETE_Start
+* will override any effect this method would have had. To set the vector
+* before the component has been started use NOR_RX_DMA_COMPLETE_StartEx instead.
+*
+* When defining ISR functions, the CY_ISR and CY_ISR_PROTO macros should be
+* used to provide consistent definition across compilers:
+*
+* Function definition example:
+* CY_ISR(MyISR)
+* {
+* }
+*
+* Function prototype example:
+* CY_ISR_PROTO(MyISR);
+*
+* Parameters:
+* address: Address of the ISR to set in the interrupt vector table.
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_SetVector(cyisraddress address)
+{
+ cyisraddress * ramVectorTable;
+
+ ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
+
+ ramVectorTable[CYINT_IRQ_BASE + (uint32)NOR_RX_DMA_COMPLETE__INTC_NUMBER] = address;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_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 NOR_RX_DMA_COMPLETE_GetVector(void)
+{
+ cyisraddress * ramVectorTable;
+
+ ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
+
+ return ramVectorTable[CYINT_IRQ_BASE + (uint32)NOR_RX_DMA_COMPLETE__INTC_NUMBER];
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_SetPriority
+********************************************************************************
+*
+* Summary:
+* Sets the Priority of the Interrupt.
+*
+* Note calling NOR_RX_DMA_COMPLETE_Start or NOR_RX_DMA_COMPLETE_StartEx will
+* override any effect this API would have had. This API should only be called
+* after NOR_RX_DMA_COMPLETE_Start or NOR_RX_DMA_COMPLETE_StartEx has been called.
+* To set the initial priority for the component, use the Design-Wide Resources
+* Interrupt Editor.
+*
+* Note This API has no effect on Non-maskable interrupt NMI).
+*
+* Parameters:
+* priority: Priority of the interrupt, 0 being the highest priority
+* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
+* PSoC 4: Priority is from 0 to 3.
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_SetPriority(uint8 priority)
+{
+ *NOR_RX_DMA_COMPLETE_INTC_PRIOR = priority << 5;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_GetPriority
+********************************************************************************
+*
+* Summary:
+* Gets the Priority of the Interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* Priority of the interrupt, 0 being the highest priority
+* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
+* PSoC 4: Priority is from 0 to 3.
+*
+*******************************************************************************/
+uint8 NOR_RX_DMA_COMPLETE_GetPriority(void)
+{
+ uint8 priority;
+
+
+ priority = *NOR_RX_DMA_COMPLETE_INTC_PRIOR >> 5;
+
+ return priority;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_Enable
+********************************************************************************
+*
+* Summary:
+* Enables the interrupt to the interrupt controller. Do not call this function
+* unless ISR_Start() has been called or the functionality of the ISR_Start()
+* function, which sets the vector and the priority, has been called.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_Enable(void)
+{
+ /* Enable the general interrupt. */
+ *NOR_RX_DMA_COMPLETE_INTC_SET_EN = NOR_RX_DMA_COMPLETE__INTC_MASK;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_GetState
+********************************************************************************
+*
+* Summary:
+* Gets the state (enabled, disabled) of the Interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* 1 if enabled, 0 if disabled.
+*
+*******************************************************************************/
+uint8 NOR_RX_DMA_COMPLETE_GetState(void)
+{
+ /* Get the state of the general interrupt. */
+ return ((*NOR_RX_DMA_COMPLETE_INTC_SET_EN & (uint32)NOR_RX_DMA_COMPLETE__INTC_MASK) != 0u) ? 1u:0u;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_Disable
+********************************************************************************
+*
+* Summary:
+* Disables the Interrupt in the interrupt controller.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_Disable(void)
+{
+ /* Disable the general interrupt. */
+ *NOR_RX_DMA_COMPLETE_INTC_CLR_EN = NOR_RX_DMA_COMPLETE__INTC_MASK;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_SetPending
+********************************************************************************
+*
+* Summary:
+* Causes the Interrupt to enter the pending state, a software method of
+* generating the interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+* Side Effects:
+* If interrupts are enabled and the interrupt is set up properly, the ISR is
+* entered (depending on the priority of this interrupt and other pending
+* interrupts).
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_SetPending(void)
+{
+ *NOR_RX_DMA_COMPLETE_INTC_SET_PD = NOR_RX_DMA_COMPLETE__INTC_MASK;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_RX_DMA_COMPLETE_ClearPending
+********************************************************************************
+*
+* Summary:
+* Clears a pending interrupt in the interrupt controller.
+*
+* Note Some interrupt sources are clear-on-read and require the block
+* interrupt/status register to be read/cleared with the appropriate block API
+* (GPIO, UART, and so on). Otherwise the ISR will continue to remain in
+* pending state even though the interrupt itself is cleared using this API.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_RX_DMA_COMPLETE_ClearPending(void)
+{
+ *NOR_RX_DMA_COMPLETE_INTC_CLR_PD = NOR_RX_DMA_COMPLETE__INTC_MASK;
+}
+
+#endif /* End check for removal by optimization */
+
+
+/* [] END OF FILE */
--- /dev/null
+/*******************************************************************************
+* File Name: NOR_RX_DMA_COMPLETE.h
+* Version 1.70
+*
+* Description:
+* Provides the function definitions for the Interrupt Controller.
+*
+*
+********************************************************************************
+* Copyright 2008-2015, 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_NOR_RX_DMA_COMPLETE_H)
+#define CY_ISR_NOR_RX_DMA_COMPLETE_H
+
+
+#include <cytypes.h>
+#include <cyfitter.h>
+
+/* Interrupt Controller API. */
+void NOR_RX_DMA_COMPLETE_Start(void);
+void NOR_RX_DMA_COMPLETE_StartEx(cyisraddress address);
+void NOR_RX_DMA_COMPLETE_Stop(void);
+
+CY_ISR_PROTO(NOR_RX_DMA_COMPLETE_Interrupt);
+
+void NOR_RX_DMA_COMPLETE_SetVector(cyisraddress address);
+cyisraddress NOR_RX_DMA_COMPLETE_GetVector(void);
+
+void NOR_RX_DMA_COMPLETE_SetPriority(uint8 priority);
+uint8 NOR_RX_DMA_COMPLETE_GetPriority(void);
+
+void NOR_RX_DMA_COMPLETE_Enable(void);
+uint8 NOR_RX_DMA_COMPLETE_GetState(void);
+void NOR_RX_DMA_COMPLETE_Disable(void);
+
+void NOR_RX_DMA_COMPLETE_SetPending(void);
+void NOR_RX_DMA_COMPLETE_ClearPending(void);
+
+
+/* Interrupt Controller Constants */
+
+/* Address of the INTC.VECT[x] register that contains the Address of the NOR_RX_DMA_COMPLETE ISR. */
+#define NOR_RX_DMA_COMPLETE_INTC_VECTOR ((reg32 *) NOR_RX_DMA_COMPLETE__INTC_VECT)
+
+/* Address of the NOR_RX_DMA_COMPLETE ISR priority. */
+#define NOR_RX_DMA_COMPLETE_INTC_PRIOR ((reg8 *) NOR_RX_DMA_COMPLETE__INTC_PRIOR_REG)
+
+/* Priority of the NOR_RX_DMA_COMPLETE interrupt. */
+#define NOR_RX_DMA_COMPLETE_INTC_PRIOR_NUMBER NOR_RX_DMA_COMPLETE__INTC_PRIOR_NUM
+
+/* Address of the INTC.SET_EN[x] byte to bit enable NOR_RX_DMA_COMPLETE interrupt. */
+#define NOR_RX_DMA_COMPLETE_INTC_SET_EN ((reg32 *) NOR_RX_DMA_COMPLETE__INTC_SET_EN_REG)
+
+/* Address of the INTC.CLR_EN[x] register to bit clear the NOR_RX_DMA_COMPLETE interrupt. */
+#define NOR_RX_DMA_COMPLETE_INTC_CLR_EN ((reg32 *) NOR_RX_DMA_COMPLETE__INTC_CLR_EN_REG)
+
+/* Address of the INTC.SET_PD[x] register to set the NOR_RX_DMA_COMPLETE interrupt state to pending. */
+#define NOR_RX_DMA_COMPLETE_INTC_SET_PD ((reg32 *) NOR_RX_DMA_COMPLETE__INTC_SET_PD_REG)
+
+/* Address of the INTC.CLR_PD[x] register to clear the NOR_RX_DMA_COMPLETE interrupt. */
+#define NOR_RX_DMA_COMPLETE_INTC_CLR_PD ((reg32 *) NOR_RX_DMA_COMPLETE__INTC_CLR_PD_REG)
+
+
+#endif /* CY_ISR_NOR_RX_DMA_COMPLETE_H */
+
+
+/* [] END OF FILE */
--- /dev/null
+/***************************************************************************
+* File Name: NOR_RX_DMA_dma.c
+* Version 1.70
+*
+* Description:
+* Provides an API for the DMAC component. The API includes functions
+* for the DMA controller, DMA channels and Transfer Descriptors.
+*
+*
+* Note:
+* This module requires the developer to finish or fill in the auto
+* generated funcions and setup the dma channel and TD's.
+*
+********************************************************************************
+* Copyright 2008-2010, 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 <CYLIB.H>
+#include <CYDMAC.H>
+#include <NOR_RX_DMA_dma.H>
+
+
+
+/****************************************************************************
+*
+* The following defines are available in Cyfitter.h
+*
+*
+*
+* NOR_RX_DMA__DRQ_CTL_REG
+*
+*
+* NOR_RX_DMA__DRQ_NUMBER
+*
+* Number of TD's used by this channel.
+* NOR_RX_DMA__NUMBEROF_TDS
+*
+* Priority of this channel.
+* NOR_RX_DMA__PRIORITY
+*
+* True if NOR_RX_DMA_TERMIN_SEL is used.
+* NOR_RX_DMA__TERMIN_EN
+*
+* TERMIN interrupt line to signal terminate.
+* NOR_RX_DMA__TERMIN_SEL
+*
+*
+* True if NOR_RX_DMA_TERMOUT0_SEL is used.
+* NOR_RX_DMA__TERMOUT0_EN
+*
+*
+* TERMOUT0 interrupt line to signal completion.
+* NOR_RX_DMA__TERMOUT0_SEL
+*
+*
+* True if NOR_RX_DMA_TERMOUT1_SEL is used.
+* NOR_RX_DMA__TERMOUT1_EN
+*
+*
+* TERMOUT1 interrupt line to signal completion.
+* NOR_RX_DMA__TERMOUT1_SEL
+*
+****************************************************************************/
+
+
+/* Zero based index of NOR_RX_DMA dma channel */
+uint8 NOR_RX_DMA_DmaHandle = DMA_INVALID_CHANNEL;
+
+/*********************************************************************
+* Function Name: uint8 NOR_RX_DMA_DmaInitalize
+**********************************************************************
+* Summary:
+* Allocates and initialises a channel of the DMAC to be used by the
+* caller.
+*
+* Parameters:
+* BurstCount.
+*
+*
+* ReqestPerBurst.
+*
+*
+* UpperSrcAddress.
+*
+*
+* UpperDestAddress.
+*
+*
+* Return:
+* The channel that can be used by the caller for DMA activity.
+* DMA_INVALID_CHANNEL (0xFF) if there are no channels left.
+*
+*
+*******************************************************************/
+uint8 NOR_RX_DMA_DmaInitialize(uint8 BurstCount, uint8 ReqestPerBurst, uint16 UpperSrcAddress, uint16 UpperDestAddress)
+{
+
+ /* Allocate a DMA channel. */
+ NOR_RX_DMA_DmaHandle = (uint8)NOR_RX_DMA__DRQ_NUMBER;
+
+ /* Configure the channel. */
+ (void)CyDmaChSetConfiguration(NOR_RX_DMA_DmaHandle,
+ BurstCount,
+ ReqestPerBurst,
+ (uint8)NOR_RX_DMA__TERMOUT0_SEL,
+ (uint8)NOR_RX_DMA__TERMOUT1_SEL,
+ (uint8)NOR_RX_DMA__TERMIN_SEL);
+
+ /* Set the extended address for the transfers */
+ (void)CyDmaChSetExtendedAddress(NOR_RX_DMA_DmaHandle, UpperSrcAddress, UpperDestAddress);
+
+ /* Set the priority for this channel */
+ (void)CyDmaChPriority(NOR_RX_DMA_DmaHandle, (uint8)NOR_RX_DMA__PRIORITY);
+
+ return NOR_RX_DMA_DmaHandle;
+}
+
+/*********************************************************************
+* Function Name: void NOR_RX_DMA_DmaRelease
+**********************************************************************
+* Summary:
+* Frees the channel associated with NOR_RX_DMA.
+*
+*
+* Parameters:
+* void.
+*
+*
+*
+* Return:
+* void.
+*
+*******************************************************************/
+void NOR_RX_DMA_DmaRelease(void)
+{
+ /* Disable the channel */
+ (void)CyDmaChDisable(NOR_RX_DMA_DmaHandle);
+}
+
--- /dev/null
+/******************************************************************************
+* File Name: NOR_RX_DMA_dma.h
+* Version 1.70
+*
+* Description:
+* Provides the function definitions for the DMA Controller.
+*
+*
+********************************************************************************
+* Copyright 2008-2010, 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_DMA_NOR_RX_DMA_DMA_H__)
+#define CY_DMA_NOR_RX_DMA_DMA_H__
+
+
+
+#include <CYDMAC.H>
+#include <CYFITTER.H>
+
+#define NOR_RX_DMA__TD_TERMOUT_EN (((0 != NOR_RX_DMA__TERMOUT0_EN) ? TD_TERMOUT0_EN : 0) | \
+ (NOR_RX_DMA__TERMOUT1_EN ? TD_TERMOUT1_EN : 0))
+
+/* Zero based index of NOR_RX_DMA dma channel */
+extern uint8 NOR_RX_DMA_DmaHandle;
+
+
+uint8 NOR_RX_DMA_DmaInitialize(uint8 BurstCount, uint8 ReqestPerBurst, uint16 UpperSrcAddress, uint16 UpperDestAddress) ;
+void NOR_RX_DMA_DmaRelease(void) ;
+
+
+/* CY_DMA_NOR_RX_DMA_DMA_H__ */
+#endif
--- /dev/null
+/*******************************************************************************
+* File Name: NOR_TX_DMA_COMPLETE.c
+* Version 1.70
+*
+* Description:
+* API for controlling the state of an interrupt.
+*
+*
+* Note:
+*
+********************************************************************************
+* Copyright 2008-2015, 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 <NOR_TX_DMA_COMPLETE.h>
+
+
+#if !defined(NOR_TX_DMA_COMPLETE__REMOVED) /* Check for removal by optimization */
+
+/*******************************************************************************
+* Place your includes, defines and code here
+********************************************************************************/
+/* `#START NOR_TX_DMA_COMPLETE_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: NOR_TX_DMA_COMPLETE_Start
+********************************************************************************
+*
+* Summary:
+* Set up the interrupt and enable it. This function disables the interrupt,
+* sets the default interrupt vector, sets the priority from the value in the
+* Design Wide Resources Interrupt Editor, then enables the interrupt to the
+* interrupt controller.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_Start(void)
+{
+ /* For all we know the interrupt is active. */
+ NOR_TX_DMA_COMPLETE_Disable();
+
+ /* Set the ISR to point to the NOR_TX_DMA_COMPLETE Interrupt. */
+ NOR_TX_DMA_COMPLETE_SetVector(&NOR_TX_DMA_COMPLETE_Interrupt);
+
+ /* Set the priority. */
+ NOR_TX_DMA_COMPLETE_SetPriority((uint8)NOR_TX_DMA_COMPLETE_INTC_PRIOR_NUMBER);
+
+ /* Enable it. */
+ NOR_TX_DMA_COMPLETE_Enable();
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_StartEx
+********************************************************************************
+*
+* Summary:
+* Sets up the interrupt and enables it. This function disables the interrupt,
+* sets the interrupt vector based on the address passed in, sets the priority
+* from the value in the Design Wide Resources Interrupt Editor, then enables
+* the interrupt to the interrupt controller.
+*
+* When defining ISR functions, the CY_ISR and CY_ISR_PROTO macros should be
+* used to provide consistent definition across compilers:
+*
+* Function definition example:
+* CY_ISR(MyISR)
+* {
+* }
+* Function prototype example:
+* CY_ISR_PROTO(MyISR);
+*
+* Parameters:
+* address: Address of the ISR to set in the interrupt vector table.
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_StartEx(cyisraddress address)
+{
+ /* For all we know the interrupt is active. */
+ NOR_TX_DMA_COMPLETE_Disable();
+
+ /* Set the ISR to point to the NOR_TX_DMA_COMPLETE Interrupt. */
+ NOR_TX_DMA_COMPLETE_SetVector(address);
+
+ /* Set the priority. */
+ NOR_TX_DMA_COMPLETE_SetPriority((uint8)NOR_TX_DMA_COMPLETE_INTC_PRIOR_NUMBER);
+
+ /* Enable it. */
+ NOR_TX_DMA_COMPLETE_Enable();
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_Stop
+********************************************************************************
+*
+* Summary:
+* Disables and removes the interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_Stop(void)
+{
+ /* Disable this interrupt. */
+ NOR_TX_DMA_COMPLETE_Disable();
+
+ /* Set the ISR to point to the passive one. */
+ NOR_TX_DMA_COMPLETE_SetVector(&IntDefaultHandler);
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_Interrupt
+********************************************************************************
+*
+* Summary:
+* The default Interrupt Service Routine for NOR_TX_DMA_COMPLETE.
+*
+* Add custom code between the coments to keep the next version of this file
+* from over writting your code.
+*
+* Parameters:
+*
+* Return:
+* None
+*
+*******************************************************************************/
+CY_ISR(NOR_TX_DMA_COMPLETE_Interrupt)
+{
+ #ifdef NOR_TX_DMA_COMPLETE_INTERRUPT_INTERRUPT_CALLBACK
+ NOR_TX_DMA_COMPLETE_Interrupt_InterruptCallback();
+ #endif /* NOR_TX_DMA_COMPLETE_INTERRUPT_INTERRUPT_CALLBACK */
+
+ /* Place your Interrupt code here. */
+ /* `#START NOR_TX_DMA_COMPLETE_Interrupt` */
+
+ /* `#END` */
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_SetVector
+********************************************************************************
+*
+* Summary:
+* Change the ISR vector for the Interrupt. Note calling NOR_TX_DMA_COMPLETE_Start
+* will override any effect this method would have had. To set the vector
+* before the component has been started use NOR_TX_DMA_COMPLETE_StartEx instead.
+*
+* When defining ISR functions, the CY_ISR and CY_ISR_PROTO macros should be
+* used to provide consistent definition across compilers:
+*
+* Function definition example:
+* CY_ISR(MyISR)
+* {
+* }
+*
+* Function prototype example:
+* CY_ISR_PROTO(MyISR);
+*
+* Parameters:
+* address: Address of the ISR to set in the interrupt vector table.
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_SetVector(cyisraddress address)
+{
+ cyisraddress * ramVectorTable;
+
+ ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
+
+ ramVectorTable[CYINT_IRQ_BASE + (uint32)NOR_TX_DMA_COMPLETE__INTC_NUMBER] = address;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_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 NOR_TX_DMA_COMPLETE_GetVector(void)
+{
+ cyisraddress * ramVectorTable;
+
+ ramVectorTable = (cyisraddress *) *CYINT_VECT_TABLE;
+
+ return ramVectorTable[CYINT_IRQ_BASE + (uint32)NOR_TX_DMA_COMPLETE__INTC_NUMBER];
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_SetPriority
+********************************************************************************
+*
+* Summary:
+* Sets the Priority of the Interrupt.
+*
+* Note calling NOR_TX_DMA_COMPLETE_Start or NOR_TX_DMA_COMPLETE_StartEx will
+* override any effect this API would have had. This API should only be called
+* after NOR_TX_DMA_COMPLETE_Start or NOR_TX_DMA_COMPLETE_StartEx has been called.
+* To set the initial priority for the component, use the Design-Wide Resources
+* Interrupt Editor.
+*
+* Note This API has no effect on Non-maskable interrupt NMI).
+*
+* Parameters:
+* priority: Priority of the interrupt, 0 being the highest priority
+* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
+* PSoC 4: Priority is from 0 to 3.
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_SetPriority(uint8 priority)
+{
+ *NOR_TX_DMA_COMPLETE_INTC_PRIOR = priority << 5;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_GetPriority
+********************************************************************************
+*
+* Summary:
+* Gets the Priority of the Interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* Priority of the interrupt, 0 being the highest priority
+* PSoC 3 and PSoC 5LP: Priority is from 0 to 7.
+* PSoC 4: Priority is from 0 to 3.
+*
+*******************************************************************************/
+uint8 NOR_TX_DMA_COMPLETE_GetPriority(void)
+{
+ uint8 priority;
+
+
+ priority = *NOR_TX_DMA_COMPLETE_INTC_PRIOR >> 5;
+
+ return priority;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_Enable
+********************************************************************************
+*
+* Summary:
+* Enables the interrupt to the interrupt controller. Do not call this function
+* unless ISR_Start() has been called or the functionality of the ISR_Start()
+* function, which sets the vector and the priority, has been called.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_Enable(void)
+{
+ /* Enable the general interrupt. */
+ *NOR_TX_DMA_COMPLETE_INTC_SET_EN = NOR_TX_DMA_COMPLETE__INTC_MASK;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_GetState
+********************************************************************************
+*
+* Summary:
+* Gets the state (enabled, disabled) of the Interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* 1 if enabled, 0 if disabled.
+*
+*******************************************************************************/
+uint8 NOR_TX_DMA_COMPLETE_GetState(void)
+{
+ /* Get the state of the general interrupt. */
+ return ((*NOR_TX_DMA_COMPLETE_INTC_SET_EN & (uint32)NOR_TX_DMA_COMPLETE__INTC_MASK) != 0u) ? 1u:0u;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_Disable
+********************************************************************************
+*
+* Summary:
+* Disables the Interrupt in the interrupt controller.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_Disable(void)
+{
+ /* Disable the general interrupt. */
+ *NOR_TX_DMA_COMPLETE_INTC_CLR_EN = NOR_TX_DMA_COMPLETE__INTC_MASK;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_SetPending
+********************************************************************************
+*
+* Summary:
+* Causes the Interrupt to enter the pending state, a software method of
+* generating the interrupt.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+* Side Effects:
+* If interrupts are enabled and the interrupt is set up properly, the ISR is
+* entered (depending on the priority of this interrupt and other pending
+* interrupts).
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_SetPending(void)
+{
+ *NOR_TX_DMA_COMPLETE_INTC_SET_PD = NOR_TX_DMA_COMPLETE__INTC_MASK;
+}
+
+
+/*******************************************************************************
+* Function Name: NOR_TX_DMA_COMPLETE_ClearPending
+********************************************************************************
+*
+* Summary:
+* Clears a pending interrupt in the interrupt controller.
+*
+* Note Some interrupt sources are clear-on-read and require the block
+* interrupt/status register to be read/cleared with the appropriate block API
+* (GPIO, UART, and so on). Otherwise the ISR will continue to remain in
+* pending state even though the interrupt itself is cleared using this API.
+*
+* Parameters:
+* None
+*
+* Return:
+* None
+*
+*******************************************************************************/
+void NOR_TX_DMA_COMPLETE_ClearPending(void)
+{
+ *NOR_TX_DMA_COMPLETE_INTC_CLR_PD = NOR_TX_DMA_COMPLETE__INTC_MASK;
+}
+
+#endif /* End check for removal by optimization */
+
+
+/* [] END OF FILE */
--- /dev/null
+/*******************************************************************************
+* File Name: NOR_TX_DMA_COMPLETE.h
+* Version 1.70
+*
+* Description:
+* Provides the function definitions for the Interrupt Controller.
+*
+*
+********************************************************************************
+* Copyright 2008-2015, 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_NOR_TX_DMA_COMPLETE_H)
+#define CY_ISR_NOR_TX_DMA_COMPLETE_H
+
+
+#include <cytypes.h>
+#include <cyfitter.h>
+
+/* Interrupt Controller API. */
+void NOR_TX_DMA_COMPLETE_Start(void);
+void NOR_TX_DMA_COMPLETE_StartEx(cyisraddress address);
+void NOR_TX_DMA_COMPLETE_Stop(void);
+
+CY_ISR_PROTO(NOR_TX_DMA_COMPLETE_Interrupt);
+
+void NOR_TX_DMA_COMPLETE_SetVector(cyisraddress address);
+cyisraddress NOR_TX_DMA_COMPLETE_GetVector(void);
+
+void NOR_TX_DMA_COMPLETE_SetPriority(uint8 priority);
+uint8 NOR_TX_DMA_COMPLETE_GetPriority(void);
+
+void NOR_TX_DMA_COMPLETE_Enable(void);
+uint8 NOR_TX_DMA_COMPLETE_GetState(void);
+void NOR_TX_DMA_COMPLETE_Disable(void);
+
+void NOR_TX_DMA_COMPLETE_SetPending(void);
+void NOR_TX_DMA_COMPLETE_ClearPending(void);
+
+
+/* Interrupt Controller Constants */
+
+/* Address of the INTC.VECT[x] register that contains the Address of the NOR_TX_DMA_COMPLETE ISR. */
+#define NOR_TX_DMA_COMPLETE_INTC_VECTOR ((reg32 *) NOR_TX_DMA_COMPLETE__INTC_VECT)
+
+/* Address of the NOR_TX_DMA_COMPLETE ISR priority. */
+#define NOR_TX_DMA_COMPLETE_INTC_PRIOR ((reg8 *) NOR_TX_DMA_COMPLETE__INTC_PRIOR_REG)
+
+/* Priority of the NOR_TX_DMA_COMPLETE interrupt. */
+#define NOR_TX_DMA_COMPLETE_INTC_PRIOR_NUMBER NOR_TX_DMA_COMPLETE__INTC_PRIOR_NUM
+
+/* Address of the INTC.SET_EN[x] byte to bit enable NOR_TX_DMA_COMPLETE interrupt. */
+#define NOR_TX_DMA_COMPLETE_INTC_SET_EN ((reg32 *) NOR_TX_DMA_COMPLETE__INTC_SET_EN_REG)
+
+/* Address of the INTC.CLR_EN[x] register to bit clear the NOR_TX_DMA_COMPLETE interrupt. */
+#define NOR_TX_DMA_COMPLETE_INTC_CLR_EN ((reg32 *) NOR_TX_DMA_COMPLETE__INTC_CLR_EN_REG)
+
+/* Address of the INTC.SET_PD[x] register to set the NOR_TX_DMA_COMPLETE interrupt state to pending. */
+#define NOR_TX_DMA_COMPLETE_INTC_SET_PD ((reg32 *) NOR_TX_DMA_COMPLETE__INTC_SET_PD_REG)
+
+/* Address of the INTC.CLR_PD[x] register to clear the NOR_TX_DMA_COMPLETE interrupt. */
+#define NOR_TX_DMA_COMPLETE_INTC_CLR_PD ((reg32 *) NOR_TX_DMA_COMPLETE__INTC_CLR_PD_REG)
+
+
+#endif /* CY_ISR_NOR_TX_DMA_COMPLETE_H */
+
+
+/* [] END OF FILE */
--- /dev/null
+/***************************************************************************
+* File Name: NOR_TX_DMA_dma.c
+* Version 1.70
+*
+* Description:
+* Provides an API for the DMAC component. The API includes functions
+* for the DMA controller, DMA channels and Transfer Descriptors.
+*
+*
+* Note:
+* This module requires the developer to finish or fill in the auto
+* generated funcions and setup the dma channel and TD's.
+*
+********************************************************************************
+* Copyright 2008-2010, 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 <CYLIB.H>
+#include <CYDMAC.H>
+#include <NOR_TX_DMA_dma.H>
+
+
+
+/****************************************************************************
+*
+* The following defines are available in Cyfitter.h
+*
+*
+*
+* NOR_TX_DMA__DRQ_CTL_REG
+*
+*
+* NOR_TX_DMA__DRQ_NUMBER
+*
+* Number of TD's used by this channel.
+* NOR_TX_DMA__NUMBEROF_TDS
+*
+* Priority of this channel.
+* NOR_TX_DMA__PRIORITY
+*
+* True if NOR_TX_DMA_TERMIN_SEL is used.
+* NOR_TX_DMA__TERMIN_EN
+*
+* TERMIN interrupt line to signal terminate.
+* NOR_TX_DMA__TERMIN_SEL
+*
+*
+* True if NOR_TX_DMA_TERMOUT0_SEL is used.
+* NOR_TX_DMA__TERMOUT0_EN
+*
+*
+* TERMOUT0 interrupt line to signal completion.
+* NOR_TX_DMA__TERMOUT0_SEL
+*
+*
+* True if NOR_TX_DMA_TERMOUT1_SEL is used.
+* NOR_TX_DMA__TERMOUT1_EN
+*
+*
+* TERMOUT1 interrupt line to signal completion.
+* NOR_TX_DMA__TERMOUT1_SEL
+*
+****************************************************************************/
+
+
+/* Zero based index of NOR_TX_DMA dma channel */
+uint8 NOR_TX_DMA_DmaHandle = DMA_INVALID_CHANNEL;
+
+/*********************************************************************
+* Function Name: uint8 NOR_TX_DMA_DmaInitalize
+**********************************************************************
+* Summary:
+* Allocates and initialises a channel of the DMAC to be used by the
+* caller.
+*
+* Parameters:
+* BurstCount.
+*
+*
+* ReqestPerBurst.
+*
+*
+* UpperSrcAddress.
+*
+*
+* UpperDestAddress.
+*
+*
+* Return:
+* The channel that can be used by the caller for DMA activity.
+* DMA_INVALID_CHANNEL (0xFF) if there are no channels left.
+*
+*
+*******************************************************************/
+uint8 NOR_TX_DMA_DmaInitialize(uint8 BurstCount, uint8 ReqestPerBurst, uint16 UpperSrcAddress, uint16 UpperDestAddress)
+{
+
+ /* Allocate a DMA channel. */
+ NOR_TX_DMA_DmaHandle = (uint8)NOR_TX_DMA__DRQ_NUMBER;
+
+ /* Configure the channel. */
+ (void)CyDmaChSetConfiguration(NOR_TX_DMA_DmaHandle,
+ BurstCount,
+ ReqestPerBurst,
+ (uint8)NOR_TX_DMA__TERMOUT0_SEL,
+ (uint8)NOR_TX_DMA__TERMOUT1_SEL,
+ (uint8)NOR_TX_DMA__TERMIN_SEL);
+
+ /* Set the extended address for the transfers */
+ (void)CyDmaChSetExtendedAddress(NOR_TX_DMA_DmaHandle, UpperSrcAddress, UpperDestAddress);
+
+ /* Set the priority for this channel */
+ (void)CyDmaChPriority(NOR_TX_DMA_DmaHandle, (uint8)NOR_TX_DMA__PRIORITY);
+
+ return NOR_TX_DMA_DmaHandle;
+}
+
+/*********************************************************************
+* Function Name: void NOR_TX_DMA_DmaRelease
+**********************************************************************
+* Summary:
+* Frees the channel associated with NOR_TX_DMA.
+*
+*
+* Parameters:
+* void.
+*
+*
+*
+* Return:
+* void.
+*
+*******************************************************************/
+void NOR_TX_DMA_DmaRelease(void)
+{
+ /* Disable the channel */
+ (void)CyDmaChDisable(NOR_TX_DMA_DmaHandle);
+}
+
--- /dev/null
+/******************************************************************************
+* File Name: NOR_TX_DMA_dma.h
+* Version 1.70
+*
+* Description:
+* Provides the function definitions for the DMA Controller.
+*
+*
+********************************************************************************
+* Copyright 2008-2010, 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_DMA_NOR_TX_DMA_DMA_H__)
+#define CY_DMA_NOR_TX_DMA_DMA_H__
+
+
+
+#include <CYDMAC.H>
+#include <CYFITTER.H>
+
+#define NOR_TX_DMA__TD_TERMOUT_EN (((0 != NOR_TX_DMA__TERMOUT0_EN) ? TD_TERMOUT0_EN : 0) | \
+ (NOR_TX_DMA__TERMOUT1_EN ? TD_TERMOUT1_EN : 0))
+
+/* Zero based index of NOR_TX_DMA dma channel */
+extern uint8 NOR_TX_DMA_DmaHandle;
+
+
+uint8 NOR_TX_DMA_DmaInitialize(uint8 BurstCount, uint8 ReqestPerBurst, uint16 UpperSrcAddress, uint16 UpperDestAddress) ;
+void NOR_TX_DMA_DmaRelease(void) ;
+
+
+/* CY_DMA_NOR_TX_DMA_DMA_H__ */
+#endif