4 Replies Latest reply on Sep 11, 2014 5:16 PM by DaKn_263916

    Device Resources

      We share the same source code over several different PSoC devices (PSoC 3 and PSoC 5) and  use a varying amount of features. For some debug functions, I would like to test (precompiler - #ifdef) if in the current project a given resource is available. For instance, whether Port3 or Port 5 exists (on the package of course, I understand that the registers and hardware might be even there, just not externally connected), would be useful to a debugging tool that displays the status of each port.


      cydevice.h and cypins.h define all the registers, I have checked also in designs that use a package where those pins don't exist.


      I think the fitter must have a knowledge base for each device/package?


      There is CYDEV_SRAM_SIZE and CYDEV_EE_SIZE, so for some resources the software can find the sizes.


      But for instance,


      CYDEV_IO_PC_PRT5_SIZE 0x00000008u


      for a CY8C3866LTI-067, the 48 pin QFP package, that does not have port 5.



        • 1. Re: Device Resources

          You could use something similar to




          #ifdef CYDEV_PRT4_BASE




          which will not be defined when port4 does not exist





          • 2. Re: Device Resources

            Unfortunately, this does not work,


            as for instance for the mentioned device, CY8C2866LTI-067, port 3 does not exist (on the package),


            but CYDEV_IO_PC_PRT3_BASE is defined,


            I guess, you meant that when you wrote "CYDEV_PRT4_BASE"? 


            I did not find CYDEV_PRT1_BASE, for instance in my project with the mentioned device.


            It seems that preprocessor definitions are done on a architecture level (e.g. PSoC 3),


            reflecting the content of the "PSoC x Register TRM" without incorporating the limits of the chosen device.



            • 3. Re: Device Resources

              I was checking a PSoC4-file, sorry, so the name I gave is different for PSoC 3/5.




              Too bad that the generated files do not exclude non-existing ports. I would suggest to file a "MyCase" on this matter, probably there is a way to find out.





              • 4. Re: Device Resources

                To create a technical case at Cypress -








                “Technical Support”


                “Create a Case”




                You have to be registered on Cypress web site first.




                Regards, Dana.