© Sridhar Anandakrishnan 2018
Sridhar AnandakrishnanPropeller Programminghttps://doi.org/10.1007/978-1-4842-3354-2_15

15. Hardware I/O with C

Sridhar Anandakrishnan1 
(1)
Department of Geosciences, University Park, Pennsylvania, USA
 

We can work with the hardware in C (setting and reading pins and counters) in one of three ways: using direct calls to the registers (INA, DIRA, etc.), using the simpletools utility library, and using C code and injecting PASM code in critical sections. This is known as inline assembler mode.

Let’s begin with the simpler library method and then move on to the others.

We will write an SPI master and slave and put each in its own cog (see Section 7.1 for details on SPI). The SPI slave stands in for a data acquisition device ...

Get Propeller Programming: Using Assembler, Spin, and C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.