TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
Loading...
Searching...
No Matches
uart.h
Go to the documentation of this file.
1
9
10
#ifndef INCLUDE_INCLUDE_UART_H_
11
#define INCLUDE_INCLUDE_UART_H_
12
13
#include <stdint.h>
14
22
struct
USART_config
{
23
int16_t
baud
;
24
long
fosc
;
25
char
recieve_buffer
;
26
};
27
36
int
USART_init
(
struct
USART_config
*
config
);
37
43
int
USART_endl
(
void
);
44
53
int
USART_Transmit
(
unsigned
char
data);
54
63
int
USART_SendString
(
char
data[]);
64
72
int
USART_Receive
(
void
);
73
81
int
USART_ReceiveHandler
(
void
);
82
83
#endif
// INCLUDE_INCLUDE_UART_H_
84
USART_endl
int USART_endl(void)
Transmit CRLF as end-of-line.
Definition
uart.c:32
USART_Transmit
int USART_Transmit(unsigned char data)
Transmit a single byte via USART0.
Definition
uart.c:39
USART_SendString
int USART_SendString(char data[])
Send a zero-terminated string over USART0.
USART_init
int USART_init(struct USART_config *config)
Initialize USART0 with the given configuration.
Definition
uart.c:15
USART_Receive
int USART_Receive(void)
Receive one byte from USART0. (Minimal implementation.).
Definition
uart.c:66
USART_ReceiveHandler
int USART_ReceiveHandler(void)
Handle incoming received bytes and simple command echoing.
Definition
uart.c:73
config
struct USART_config config
Definition
main.c:49
USART_config
USART configuration structure.
Definition
uart.h:22
USART_config::fosc
long fosc
Definition
uart.h:24
USART_config::baud
int16_t baud
Definition
uart.h:23
USART_config::recieve_buffer
char recieve_buffer
Definition
uart.h:25
include
uart.h
Generated by
1.15.0