Question: / * * EX: 9 . 2 Create two new files: src / spi . c include / spi . h TASK: 1 . In

/** EX: 9.2
Create two new files:
src/spi.c
include/spi.h
TASK:
1. In "spi.c", declare and implement a function "spi_init" that will
initialise SPI0 in unbuffered mode, such that data can be written
to the shift register that controls the 7-segment display.
This function should also enable the SPI interrupt via the IE bit
in INTCTRL.
2. Declare and implement the function spi_write(uint8_t b) which
will write the byte b out via the SPI interface.
3. Declare and implement an ISR that handles the SPI interrupt, and
also creates a rising edge on the DISP LATCH net.
You will need to add some code to spi_init() to enable the
required pins as outputs.
Declare prototypes for these functions in "spi.h" and include
"spi.h" at the top of this file.
Once this exercise is complete, uncomment the lines below. The
7-segment display should be blank after this code executes.
*/
/** CODE: Write your code for Ex 9.2 in spi.c and spi.h.*/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!