get i2c slave address top design get from source code

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
zapa_4736586
Level 1
Level 1
10 sign-ins 5 sign-ins First reply posted

i want to find  where  in the code   i could see slave address   

the slave  address  set i n  top design    i m review the code but didn't find   file header or source    where  defines  i2c slave address 

Q1 :  where in the source i could see  slave address ?

Q2:  it is possible  to change top design parameters  ( i2c slave address  )  from  command line  

when run .\cyprjmgr.exe -wrk "xxx.cywrk" -build  

Q3:   

0 Likes
1 Solution
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

Q1: slave address for I2C is stored in <instance_name>_I2C.h file in generated resources under <instance_name>_I2C_SLAVE_ADDRESS macro.

Q2: It is possible to change design parameters from command line.

You can use 
cyprjmgr.exe –w workspace –build –m params_file 

command where params_file is a text file in following format,

"The params file accepts parameters and their values as name=value pairs. The name of the instance must be
given as inst_name=value"

for example if I2C instance name is I2C_1 then,

inst_name=I2C_1
I2cSlaveAddress= 0x66

This will change slave address to 0x66 from command line. 

Please refer to page no. 373 of PSoC Creator User Guide (https://www.cypress.com/file/137441/download) for more information.

Best regards,
Pranava

View solution in original post

1 Reply
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

Q1: slave address for I2C is stored in <instance_name>_I2C.h file in generated resources under <instance_name>_I2C_SLAVE_ADDRESS macro.

Q2: It is possible to change design parameters from command line.

You can use 
cyprjmgr.exe –w workspace –build –m params_file 

command where params_file is a text file in following format,

"The params file accepts parameters and their values as name=value pairs. The name of the instance must be
given as inst_name=value"

for example if I2C instance name is I2C_1 then,

inst_name=I2C_1
I2cSlaveAddress= 0x66

This will change slave address to 0x66 from command line. 

Please refer to page no. 373 of PSoC Creator User Guide (https://www.cypress.com/file/137441/download) for more information.

Best regards,
Pranava