Activity 10.3.7. Finish the Driver and Show ES.28.
You’ll work in
SevenSegPartial.c. Its header file defines everything you need. HT16K33_ADDR is the display’s I2C address, and the command names are the ones we derived from the command table. HT16K33_ADDR_PTR is the address of the first byte of the display RAM, which is where a full write starts. HT16K33_NBUF is the number of digit-and-colon positions on the display, which is five; since each position takes two bytes, the buffer you send is 2*HT16K33_NBUF bytes long.
(a)
Write
SevenSeg_blink() and SevenSeg_dim(). Each should be one line, namely one call to i2c1_byteWrite(), sending the display-setup and dimming commands you derived earlier with the desired dimming/blink rate option bits ORed in. Mask the argument to the bits the command actually has (0x6 for the two blink bits, 0xf for the four brightness bits), so an out-of-range argument cannot corrupt the command itself.
(b)
Complete
SevenSeg_write(). It needs one call to i2c1_memWrite().
(c)
In a new
main() (you might start a new file for this and exclude writeFirstDigit.c from the resource configuration), declare uint8_t display_buffer[2*HT16K33_NBUF];, fill it so the display reads ES.28, and call SevenSeg_write(). For the 2 and the 8 use numbertable[].
