How to change RaspberryPi I2C speed in Simulink generated code?

1 Ansicht (letzte 30 Tage)
Ricardo Borges
Ricardo Borges am 12 Sep. 2017
Bearbeitet: Ricardo Borges am 31 Okt. 2017
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 Kommentare
Madhu Govindarajan
Madhu Govindarajan am 31 Okt. 2017
Could you set it up from Hardware Implementation pane > Target Hardware Resources > SPI > SPI0 CE0 Bus Speed (kHz)?
Ricardo Borges
Ricardo Borges am 31 Okt. 2017
Bearbeitet: Ricardo Borges am 31 Okt. 2017
Well, I assume that your suggestion is applicable to SPI, not I2C.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Embedded Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by