Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include #include #include #include #include inc / hw _ ints.h #include inc / hw _ memmap.h #include inc / hw _ types.h
#include
#include
#include
#include
#include "inchwints.h
#include "inchwmemmap.h
#include "inchwtypes.h
#include "inchwuart.h
#include "driverlibfpuh
#include "driverlibgpioh
#include "driverlibinterrupth
#include "driverlibpinmap.h
#include "driverlibromh
#include "driverlibrommap.h
#include "driverlibsysctlh
#include "driverlibsystickh
#include "driverlibuarth
#include "driverlibudmah
#include "utilscpuusage.h
#include "utilsuartstdioh
#include "utilsustdlibh
#include "driverlibtimerh
uintt guiSysClock;
bool gledBlinking false;
uintt guiCPUUsage;
#define SYSTICKSPERSECOND
char myname "HELLO";
int currentCharIndex ;
void TimerBegin
SysCtlPeripheralEnableSYSCTLPERIPHTIMER;
TimerConfigureTIMERBASE, TIMERCFGONESHOT;
TimerLoadSetTIMERBASE, TIMERA guiSysClock ;
TimerIntEnableTIMERBASE, TIMERTIMATIMEOUT;
TimerEnableTIMERBASE, TIMERA;
while TimerIntStatusTIMERBASE, false
TimerIntClearTIMERBASE, TIMERTIMATIMEOUT;
GPIOPinWriteGPIOPORTNBASE, GPIOPIN gledBlinking GPIOPIN : ;
if gledBlinking
SysCtlDelayguiSysClock ; Add a ms delay
ndeks artrlr ve eer dizinin sonuna gelinirse tekrar baa dnlr
currentCharIndex currentCharIndex sizeofmyname;
UARTwriteNew Character: ;
UARTwrite&mynamecurrentCharIndex;
UARTwrite
;
Toggle the LED blinking state
gledBlinking gledBlinking;
void PrintAsciiCodeAndNamechar character
UARTprintfc ASCII Code: d
character, character;
void PrintMyNameAsciiconst char name
int i;
for i ; namei; i
char asciiCodeString; Assuming ASCII codes are digits null terminator
usprintfasciiCodeStringd namei;
Print ASCII code and name for the current character
UARTwrite&namei;
UARTwrite ASCII Code: ;
UARTwriteasciiCodeString strlenasciiCodeString;
UARTwrite
;
Add a newline character to the UART data stream
UARTCharPutNonBlockingUARTBASE,
;
void SysTickHandlervoid
void uDMAErrorHandlervoid
void uDMAIntHandlervoid
void UARTIntHandlervoid
void ConfigureUARTvoid
MAPSysCtlPeripheralEnableSYSCTLPERIPHGPIOP;
MAPSysCtlPeripheralEnableSYSCTLPERIPHUART;
MAPSysCtlPeripheralSleepEnableSYSCTLPERIPHTIMER;
MAPGPIOPinConfigureGPIOPPURX;
MAPGPIOPinConfigureGPIOPPUTX;
MAPGPIOPinTypeUARTGPIOPORTPBASE, GPIOPIN GPIOPIN;
Enable UART
UARTEnableUARTBASE;
SysCtlPeripheralSleepEnableSYSCTLPERIPHUART;
Configure UART stdio
UARTStdioConfig guiSysClock;
int mainvoid
guiSysClock MAPSysCtlClockFreqSet
SYSCTLXTALMHZ SYSCTLOSCMAIN SYSCTLUSEPLL SYSCTLCFGVCO
;
MAPSysCtlPeripheralEnableSYSCTLPERIPHGPION;
MAPGPIOPinTypeGPIOOutputGPIOPORTNBASE, GPIOPIN;
ConfigureUART;
MAPSysTickPeriodSetguiSysClock SYSTICKSPERSECOND;
MAPSysTickIntEnable;
MAPSysTickEnable;
while
MAPSysCtlSleep;
The action I tried to do in the code is as follows; In timerbegin, I set it to send a new string from the char array every time the led goes out and create a element array without pointers called char myname. Finally, a new string will be sent as soon as the led goes out in the TimerBegin function and this process will be cyclic, for example, after sending all the elements of a element char array, it will return to the beginning and send the first element.Please do not post artificial intelligence answers, I request
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started