-
Notifications
You must be signed in to change notification settings - Fork 0
/
uart.c
33 lines (22 loc) · 1.71 KB
/
uart.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "uart.h"
#include <string.h>
void sendCharToUart(const char inChar, char* address)
{
*address = inChar;
}
void sendStringToUart(const char inStr[], char* address)
{
int len = strlen(inStr);
int index;
for(index = 0; index <= len ; index++)
{
sendCharToUart(inStr[index], address);
}
}
void sendIntToUart(const int num, char* address)
{
(*address) = num >> 24;
(*address) = num >> 16;
(*address) = num >> 8;
(*address) = num;
}