Question: these are the other files timer.c #include timer.h void timer _ init ( void ) { / / Your timer setup code here TCA
these are the other files
timer.c
#include "timer.h
void timerinitvoid
Your timer setup code here
TCASINGLE.CTRLA TCASINGLECLKSELDIVgc TCASINGLEENABLEbm;
TCASINGLE.PERBUF ;
TCASINGLE.CMPBUF ;
timer.h
#ifndef TIMERH
#define TIMERH
#include
void timerinitvoid;
#endif TIMERH
spi.c
#include "spi.h
void spiinitvoid
PORTCDIRSET PINbm PINbm PINbm;
SPICTRLA SPIENABLEbm SPIMASTERbm SPIMODEgc SPIPRESCDIVgc;
SPICTRLB ;
SPIINTCTRL ;
void spitransferuintt data
SPIDATA data;
while SPIINTFLAGS & SPIIFbm;
spi.h
#ifndef SPIH
#define SPIH
#include
void spiinitvoid;
void spitransferuintt data;
#endif SPIH
buzzer.c
#include "buzzer.h
void buzzerinitvoid
PORTADIRSET PINbm;
TCASINGLE.CTRLB TCASINGLEWGMODESINGLESLOPEgc TCASINGLECMPENbm;
TCASINGLE.CTRLA TCASINGLECLKSELDIVgc;
TCASINGLE.PERBUF ;
TCASINGLE.CMPBUF ;
void buzzerplayuintt frequency
uintt compareValue FCPU frequency;
TCASINGLE.PERBUF compareValue;
TCASINGLE.CMPBUF compareValue ;
void buzzerstopvoid
TCASINGLE.PERBUF ;
TCASINGLE.CMPBUF ;
and buzzer.h
#ifndef BUZZERH
#define BUZZERH
#include
#define TONEFREQ Ehigh
#define TONEFREQ C
#define TONEFREQ A
#define TONEFREQ Elow
void buzzerinitvoid;
void buzzerplayuintt frequency;
void buzzerstopvoid;
#endif BUZZERH
main.c
void generateSimonSequencevoid;
void playSequencevoid;
void getUserInputvoid;
void displaySuccessvoid;
void displayFailvoid;
void increaseSequenceLengthvoid;
void resetGamevoid;
void updatescorevoid;
void displayHighScoresvoid;
int mainvoid
Initialize peripherals
timerinit;
spiinit;
buzzerinit;
buzzerstop;
statet state WAIT;
while
switch state
case WAIT:
resetGame;
generateSimonSequence;
state PLAYSIMON;
break;
case PLAYSIMON:
playSequence;
state USERINPUT;
break;
case USERINPUT:
getUserInput;
state CHECKINPUT;
break;
case CHECKINPUT:
if currentStep sequenceLength
displaySuccess;
increaseSequenceLength;
state PLAYSIMON;
else
displayFail;
resetGame;
state WAIT;
break;
void generateSimonSequencevoid
for uintt i ; i ; i
uintt BIT STATELFSR & ;
STATELFSR ;
if BIT
