Cookbook - zeptoforth

From Stm32World Wiki
Jump to navigation Jump to search

Useful Forth routines for Colibri family of products, listed in no particular order. This will also act as in informal tutorial in how to program the Colibri System.

All examples assumes `hex` mode, unless otherwise stated or indicated.

(Re)Initialize I2C

(Re)Initialize SPI

Select expansion slot

2 io-slot! ( set the expansion slot multiplexers to IO2

Load and Run program from expansion module's EEPROM

Save new program to expansion module's EEPROM

Get GPIO pin

Set GPIO pin

Set multiple GPIO pins

Write byte to I2C

Write 3 bytes to I2C

Read byte from I2C

Read 5 bytes from I2C

Write byte to SPI

Write 5 bytes to SPI

Read byte from SPI

Read 5 bytes from SPI

Toggle Gpio every 1 second