PSoC Creator allows you to create your own (or edit existing) components, a powerful feature which allows you to capture both hardware (VHDL hardware) and software and package it into a reusable “block” which can be dropped into other projects.
PSoC components can be created from the PSoC Creator IDE. If you are looking for a very comprehensive and detailed tutorial on how to create your own components, I would recommend the Cypress Component Author Guide. This page serves only to highlight the important bits and the things you will typically struggle with when creating your own components.
Component File Structure
|File Extension||File Format||Description|
|text, C# language||Contains C# code for the component settings GUI. Uses Microsoft WinForms. Usually has a seperate file for each tab element in the settings GUI.|
|.cystate||text-xml||Contains component state rules for different PSoC chip families.|
|.cysym||?||Contains the schematic symbol of the component (the one the user sees when they drop it onto a project schematic). This is also where you specify component parameters and any associated validators (right-click on the schematic and select Symbol Parameters).|
|.cycdx||text-xml||Contains an xml listing of the individual components used to build up your custom component (which are in the .cysch file).|
|.cysch||?||Contains the internals (guts) of the component. This is where you can design the hardware for your custom component in just the same way you would design the hardware for a PSoC component.|
|./API/.c||text, C language||Contains source code that will from the API for the component. This is added to the users project when they use this component in their design.|
|./API/.h||text, C language||Header files for the source code.|
'$INSTANCE_NAME' – The name of the component in the schematic editor (e.g UartCpDebug). This is user editable. All component API is typically prefixed with this name and an underscore (e.g. UartCpDebug_Start();, UartCpDebug_PutChar();).
Building The Component
The build menu for components is hidden by default, right-click on the PSoC taskbar and click “Build Customizer” to show this. The component can be built by clicking the “Build All Customizers” button.
Editing Existing Components
Make sure to rename the component in the Workspace Explorer, otherwise the name will clash with the existing component. Once you have done this, make sure to change the namespace name in all of the .cs files to the same name, as well as any other references to the project name that you find (use find/replace for this to make sure you don’t miss any!).
Watch out for validators which check inputs. These could end up excluding your custom changes which use different input ranges/values.
Posted: June 28th, 2013 at 3:50 pm
Last Updated on: April 5th, 2016 at 10:13 pm