Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
29
Issues
29
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
0d6df9e0
Commit
0d6df9e0
authored
Nov 18, 2020
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: UART control protocol, initial commit
parent
1e05cb70
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
538 additions
and
0 deletions
+538
-0
ertm14-uart-link.c
lib/ertm14-uart-link.c
+489
-0
ertm14-uart-link.h
lib/ertm14-uart-link.h
+49
-0
No files found.
lib/ertm14-uart-link.c
0 → 100644
View file @
0d6df9e0
This diff is collapsed.
Click to expand it.
lib/ertm14-uart-link.h
0 → 100644
View file @
0d6df9e0
#ifndef __ERTM14_UART_LINK_H
#define __ERTM14_UART_LINK_H
#include <stdint.h>
#define ERTM14_MAX_UART_LINK_PAYLOAD 512
struct
simple_uart_device
;
struct
uart_packet
{
uint8_t
ptype
;
uint16_t
length
;
uint8_t
payload
[
ERTM14_MAX_UART_LINK_PAYLOAD
];
};
struct
uart_link
{
int
(
*
send_byte
)(
struct
uart_link
*
link
,
uint8_t
byte
);
int
(
*
recv_byte
)(
struct
uart_link
*
link
);
uint32_t
(
*
get_ms_tics
)(
struct
uart_link
*
link
);
void
*
priv
;
int
state
;
int
rx_count
;
uint16_t
rx_crc
,
check_crc
;
uint32_t
rx_last_tics
;
struct
uart_packet
rx_packet
;
};
#ifdef __linux__
int
uart_link_create_linux
(
struct
uart_link
*
link
,
const
char
*
dev_name
,
int
speed
);
int
uart_link_close_linux
(
struct
uart_link
*
link
);
#endif
#ifdef CONFIG_TARGET_ERTM14
int
uart_link_create_wrpc_console
(
struct
uart_link
*
link
);
int
uart_link_create_wrpc_suart
(
struct
uart_link
*
link
,
struct
simple_uart_device
*
uart_dev
);
#endif
#ifdef MODULE_ERTM14_FPGA_UART // openMMC
#endif
int
uart_link_reset
(
struct
uart_link
*
link
);
int
uart_link_send
(
struct
uart_link
*
link
,
struct
uart_packet
*
pkt
);
int
uart_link_recv
(
struct
uart_link
*
link
,
struct
uart_packet
**
pkt
,
int
timeout_ms
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment