Line 1... |
Line 1... |
/*!
|
/*!
|
ZTEX Firmware Kit for EZ-USB Microcontrollers
|
ZTEX Firmware Kit for EZ-USB FX2 Microcontrollers
|
Copyright (C) 2009-2010 ZTEX e.K.
|
Copyright (C) 2009-2011 ZTEX GmbH.
|
http://www.ztex.de
|
http://www.ztex.de
|
|
|
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
it under the terms of the GNU General Public License version 3 as
|
it under the terms of the GNU General Public License version 3 as
|
published by the Free Software Foundation.
|
published by the Free Software Foundation.
|
Line 30... |
Line 30... |
#define[bmBIT4][16]
|
#define[bmBIT4][16]
|
#define[bmBIT5][32]
|
#define[bmBIT5][32]
|
#define[bmBIT6][64]
|
#define[bmBIT6][64]
|
#define[bmBIT7][128]
|
#define[bmBIT7][128]
|
|
|
#define[NOP;][_asm
|
#define[NOP;][__asm
|
nop
|
nop
|
_endasm;
|
__endasm;
|
]
|
]
|
|
|
#define[MSB(][)][((BYTE)((((unsigned short)($0)) >> 8) & 0xff)) ]
|
#define[MSB(][)][((BYTE)((((unsigned short)($0)) >> 8) & 0xff)) ]
|
#define[LSB(][)][((BYTE)($0))]
|
#define[LSB(][)][((BYTE)($0))]
|
#define[HI(][)][((BYTE)((((unsigned short)($0)) >> 8) & 0xff)) ]
|
#define[HI(][)][((BYTE)((((unsigned short)($0)) >> 8) & 0xff)) ]
|
Line 61... |
Line 61... |
ep0_payload_remaining. For Vendor Commands HSNAK bit is cleared
|
ep0_payload_remaining. For Vendor Commands HSNAK bit is cleared
|
automatically (at the end of EP0OUT_ISR) ifep0_payload_remaining == 0.
|
automatically (at the end of EP0OUT_ISR) ifep0_payload_remaining == 0.
|
For Vendor Requests HSNAK bit is always cleared at the end of SUDAV_ISR.
|
For Vendor Requests HSNAK bit is always cleared at the end of SUDAV_ISR.
|
*/
|
*/
|
|
|
xdata WORD ep0_payload_remaining = 0; // remaining amount of ep0 payload data (excluding the data of the current transfer)
|
__xdata WORD ep0_payload_remaining = 0; // remaining amount of ep0 payload data (excluding the data of the current transfer)
|
xdata BYTE ep0_payload_transfer = 0; // transfer
|
__xdata BYTE ep0_payload_transfer = 0; // transfer
|
|
|
/* *********************************************************************
|
/* *********************************************************************
|
*********************************************************************
|
*********************************************************************
|
***** basic functions ***********************************************
|
***** basic functions ***********************************************
|
*********************************************************************
|
*********************************************************************
|
Line 94... |
Line 94... |
|
|
/* *********************************************************************
|
/* *********************************************************************
|
***** MEM_COPY ******************************************************
|
***** MEM_COPY ******************************************************
|
********************************************************************* */
|
********************************************************************* */
|
// copies 1..256 bytes
|
// copies 1..256 bytes
|
void MEM_COPY1_int() __naked {
|
void MEM_COPY1_int() // __naked
|
_asm
|
{
|
|
__asm
|
020001$:
|
020001$:
|
mov _AUTOPTRSETUP,#0x07
|
mov _AUTOPTRSETUP,#0x07
|
mov dptr,#_XAUTODAT1
|
mov dptr,#_XAUTODAT1
|
movx a,@dptr
|
movx a,@dptr
|
mov dptr,#_XAUTODAT2
|
mov dptr,#_XAUTODAT2
|
movx @dptr,a
|
movx @dptr,a
|
djnz r2, 020001$
|
djnz r2, 020001$
|
ret
|
ret
|
_endasm;
|
__endasm;
|
}
|
}
|
|
|
/*
|
/*
|
! no spaces before/after commas allowed !
|
! no spaces before/after commas allowed !
|
|
|
Line 119... |
Line 120... |
#define[MEM_COPY1(][,$1,$2);][{
|
#define[MEM_COPY1(][,$1,$2);][{
|
AUTOPTRL1=LO(&($0));
|
AUTOPTRL1=LO(&($0));
|
AUTOPTRH1=HI(&($0));
|
AUTOPTRH1=HI(&($0));
|
AUTOPTRL2=LO(&($1));
|
AUTOPTRL2=LO(&($1));
|
AUTOPTRH2=HI(&($1));
|
AUTOPTRH2=HI(&($1));
|
_asm
|
__asm
|
push ar2
|
push ar2
|
mov r2,#($2);
|
mov r2,#($2);
|
lcall _MEM_COPY1_int
|
lcall _MEM_COPY1_int
|
pop ar2
|
pop ar2
|
_endasm;
|
__endasm;
|
}]
|
}]
|
|
|
|
|
#endif // ZTEX_UTILS_H
|
#endif // ZTEX_UTILS_H
|
|
|
No newline at end of file
|
No newline at end of file
|