How to change RaspberryPi I2C speed in Simulink generated code?

when generating code from Simulink for RaspberryPi 3, the generated code always sets the I2c speed to 100 kHz. The generated code looks like this:
localDW->obj_gt.BusSpeed = 100000U;
i2cname = 1;
MW_I2C_SetBusSpeed(i2cname, localDW->obj_gt.BusSpeed);
Is there any way for Simulink to automatically generate I2C speed different from '100000U'?

댓글 수: 2

Could you set it up from Hardware Implementation pane > Target Hardware Resources > SPI > SPI0 CE0 Bus Speed (kHz)?
Ricardo Borges
Ricardo Borges 2017년 10월 31일
편집: Ricardo Borges 2017년 10월 31일
Well, I assume that your suggestion is applicable to SPI, not I2C.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

질문:

2017년 9월 12일

편집:

2017년 10월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by