This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Header files for Cypress EZ-USB

Hi there!

I am totally new to the 8051 and the Keil compiler, my problem lies with the header files for the EZ-USB FX device from Cypress. Could sombody please explain how the compiler interprets the BYTE, WORD and EPIOC types? The examples shown below are taken from the 'ezregs.h' and 'fx.h' files. I have looked at the example files and there does not appear to be any #define BYTE ... anywhere.


EXTERN xdata volatile EPIOC EPIO[16] _AT_ 0x7FB4;
EXTERN xdata volatile BYTE SUDPTRH _AT_ 0x7FD4;
EXTERN xdata volatile WORD DMADEST _AT_ 0x7851;

Thanks in advance, and sorry if this is a really obvious problem!

Richard

Parents Reply Children
  • Hello again,

    I would have expected there to be a #define or typedef, but if there is, it is not at the top of the file, and there is no mention of any other files that have to be included (in fact, they state that there isnt). At the top of the file is the following statement:-

    #ifdef ALLOCATE_EXTERN
    #define EXTERN
    #define _AT_ _at_
    #else
    #define EXTERN extern
    #define _AT_ ;/ ## /
    #endif

    The documentation says to define ALLOCATE_EXTERN in the main file of your code, so EXTERN is ignored and _AT_ becomes _at_. There is no mention of BYTE, WORD or EPIOC anywhere. I can presumably define these myself (BYTE as an unsigned char, WORD as an unsigned int, not sure about EPIOC) but this does not seem to make much sence, as I would expect this to be done in a supplied file.

    Any suggestions as to what is wrong would be much appreciated.

    Thanks

    Richard

  • Thanks for your help people!

    The definitions of the different types are located in another file ('ezusb.h'), which I have just found (no mention of this anywhere useful!). Everything appears to be correct now!

    Thanks again

    Richard