One way to do it with PSoC is to encapsulate your library into a custom component. Inside the component you can have a schematic with stock I2C, named e.g. I2C_1 and API (library code). Then inside component API code you can refer to this I2C unique name like this: `$INSTANCE_NAME`_I2C_1. Whenever the component name is changed, the I2C name will update automatically.
For component creation look into
thank you for your reply. I'm trying to build a custom component integrating a stock I2C in the component schematic, but my doubt is that, doing this, the stock I2C of the custom component cannot be used for other purposes: is it right?
Yes this is the case. Once a component is Incorporated it is no longer useful for other tasks (AFAIK).