8 Replies Latest reply on Dec 13, 2015 11:47 AM by user_78878863

    PSoC4: Library Building

    user_350540870

      Hi All

         

      I am working in a direction to build a library project in Creator. I have placed a default UART SCB and a Timer component in my schematic of the library project. I want to configure ISR handlers for both. But I do not know how to declare those ISR handlers because the standard "CY_PROTO_ISR (HandlerName);" format gives an error during compilation. Is there any method to declare and define ISR Handlers in a library project?

         

       

         

      Thanks in advance.

         

       

         

      Regards

         

      Shaunak

        • 1. Re: PSoC4: Library Building
          user_1377889

          A "Library" offers something to read, in terms of programming it contains C-code functions.

             

          When (as in PSoC quite usual) some hardware is involved you should start creating a component.

             

          This ensures, that the declared hardware and the associated software (APIs) work together.

             

           

             

          Bob

          • 2. Re: PSoC4: Library Building
            user_78878863

            "CY_PROTO_ISR (HandlerName);" only defines the function prototype so the compiler knows about it. You also need to define the actual ISR function (with "CY_ISR (HandlerName);"), and then make it known to the component (which then has a "X_StartEx(&HandlerName)" function).

            • 3. Re: PSoC4: Library Building
              user_350540870

              hli: I have already applied the same method described by you, but I am still getting errors. I want to use the inbuilt UART and Timer components and create some user defined header and C files supporting them. As per my requirement, I went through the Component Author Guide and they are recommending to create a library project for this purpose. My need is: I want a plug and play library project of GSM that I can link with my new project anytime I want and get the things done fast with using the defined GSM library. For doing so, I need to configure two interrupts: 1. UART Rx 2. Timer. I am already done with all the defining header and C files related. I want to create a dedicated C file that has my ISR definitions. But I am still not able to integrate the two ISRs library within my project.

                 

               

                 

              Regards

                 

              Shaunak

              • 4. Re: PSoC4: Library Building
                user_342122993
                        Shaunak, For better response please post your project (or better a small demo exemplifying the problem).   
                • 5. Re: PSoC4: Library Building
                  user_350540870

                  odissey1: Please find attached the library project. The CY_ISR_PROTO method is not working. I am not able to use cycode and cystatus related to EEPROM component because I can't find Em_EEPROM component in the Component List. By the time I have come to know that I am not able to generate application for the predefined components of Creator. That is why I am not able to use the Start_Ex API of the ISR component.

                     

                  Regards

                     

                  Shaunak

                  • 6. Re: PSoC4: Library Building
                    user_78878863
                          
                    • it is good (and essential practice) to make sure header files get included only once (by having at the to a #IFNDEF __myheader #DEFINE __myheader ..... #ENDIF
                    •     
                    • in your UART_Timer.h you declare the prototype of ISRUARTRxHandler (which is correct), but never implement this function (this would need a CY_ISR(ISRUARTRxHandler) somewhere)
                    •     
                    • in UART_Timer.h you declare the prototype of ISRTimerHandler, but UART_Timer.c uses MyTimerHandler
                    •     
                    • _StartEx must get the address of the function (as in _StartEx(&MyTimerHandler) )
                    •    
                    • 7. Re: PSoC4: Library Building
                      user_350540870

                      hli: I am writing to you again. The CY_ISR_PROTO method is not working. I am not able to use cycode and cystatus related to EEPROM component because I can't find Em_EEPROM component in the Component List. By the time I have come to know that I am not able to generate application for the predefined components of Creator. That is why I am not able to use the Start_Ex API of the ISR component. I already know how to use the Start_Ex API. I haven't included the "CY_ISR" thing in the project as it gives error.

                         

                      Regards

                         

                      Shaunak

                      • 8. Re: PSoC4: Library Building
                        user_78878863

                        If you woul tell what exactly "is not working" means maybe we could help. Same with your CY_ISR issues. Both are that methods everybody else uses, so they work.

                           

                        When you don't find an emulated EEPROM component, the device you have selected doesn't support it. In that case, its normal that you can 't use it - there is nothing we can do about it (and surely you can't use the code from component).