Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Distributed Autonomous Networked Control Lab
MicroCART
Commits
0fb5286f
Commit
0fb5286f
authored
7 years ago
by
dawehr
Browse files
Options
Downloads
Patches
Plain Diff
wip: new uart now passes the uart hw test
parent
7005bd84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
quad/xsdk_workspace/real_quad/src/hw_impl_zybo.h
+1
-0
1 addition, 0 deletions
quad/xsdk_workspace/real_quad/src/hw_impl_zybo.h
quad/xsdk_workspace/real_quad/src/hw_impl_zybo_uart.c
+7
-8
7 additions, 8 deletions
quad/xsdk_workspace/real_quad/src/hw_impl_zybo_uart.c
with
8 additions
and
8 deletions
quad/xsdk_workspace/real_quad/src/hw_impl_zybo.h
+
1
−
0
View file @
0fb5286f
...
...
@@ -34,6 +34,7 @@ struct ZyboI2CState {
struct
ZyboUARTState
{
struct
Queue
*
queue
;
XUartPs
*
inst
;
XScuGic
xscugic
;
int
devId
;
};
...
...
This diff is collapsed.
Click to expand it.
quad/xsdk_workspace/real_quad/src/hw_impl_zybo_uart.c
+
7
−
8
View file @
0fb5286f
...
...
@@ -4,7 +4,7 @@
int
XUartPs_SetBaudRate_ours
(
XUartPs
*
InstancePtr
,
u32
BaudRate
);
int
SetupInterruptSystem
(
XUartPs
*
UartInstancePtr
,
u16
UartIntrId
,
Xil_ExceptionHandler
handler
,
struct
ZyboUARTState
*
state
);
int
SetupInterruptSystem
(
struct
ZyboUARTState
*
state
,
u16
UartIntrId
,
Xil_ExceptionHandler
handler
);
void
uart_interrupt_handler
(
struct
ZyboUARTState
*
state
);
int
zybo_uart_reset
(
struct
UARTDriver
*
self
)
{
...
...
@@ -32,7 +32,7 @@ int zybo_uart_reset(struct UARTDriver *self) {
*
uart_ctrl_reg
|=
0x00000003
;
// clear TX & RX
// Setup Interrupts
if
(
SetupInterruptSystem
(
in
st
,
XPAR_PS7_UART_0_INTR
,
(
Xil_ExceptionHandler
)
uart_interrupt_handler
,
state
)
!=
XST_SUCCESS
)
{
if
(
SetupInterruptSystem
(
st
ate
,
XPAR_PS7_UART_0_INTR
,
(
Xil_ExceptionHandler
)
uart_interrupt_handler
)
!=
XST_SUCCESS
)
{
return
-
1
;
}
...
...
@@ -234,10 +234,9 @@ void uart_interrupt_handler(struct ZyboUARTState *state) {
* @note None.
*
****************************************************************************/
int
SetupInterruptSystem
(
XUartPs
*
UartInstancePtr
,
u16
UartIntrId
,
Xil_ExceptionHandler
handler
,
struct
ZyboUARTState
*
state
)
int
SetupInterruptSystem
(
struct
ZyboUARTState
*
state
,
u16
UartIntrId
,
Xil_ExceptionHandler
handler
)
{
int
Status
;
XScuGic
xscugic
;
XScuGic_Config
*
IntcConfig
;
/* Config for interrupt controller */
/* Initialize the interrupt controller driver */
...
...
@@ -246,7 +245,7 @@ int SetupInterruptSystem(XUartPs *UartInstancePtr, u16 UartIntrId, Xil_Exception
return
XST_FAILURE
;
}
Status
=
XScuGic_CfgInitialize
(
&
xscugic
,
IntcConfig
,
Status
=
XScuGic_CfgInitialize
(
&
state
->
xscugic
,
IntcConfig
,
IntcConfig
->
CpuBaseAddress
);
if
(
Status
!=
XST_SUCCESS
)
{
return
XST_FAILURE
;
...
...
@@ -258,14 +257,14 @@ int SetupInterruptSystem(XUartPs *UartInstancePtr, u16 UartIntrId, Xil_Exception
*/
Xil_ExceptionRegisterHandler
(
XIL_EXCEPTION_ID_INT
,
(
Xil_ExceptionHandler
)
XScuGic_InterruptHandler
,
&
xscugic
);
&
state
->
xscugic
);
/*
* Connect a device driver handler that will be called when an
* interrupt for the device occurs, the device driver handler
* performs the specific interrupt processing for the device
*/
Status
=
XScuGic_Connect
(
&
xscugic
,
UartIntrId
,
Status
=
XScuGic_Connect
(
&
state
->
xscugic
,
UartIntrId
,
handler
,
(
void
*
)
state
);
if
(
Status
!=
XST_SUCCESS
)
{
...
...
@@ -273,7 +272,7 @@ int SetupInterruptSystem(XUartPs *UartInstancePtr, u16 UartIntrId, Xil_Exception
}
/* Enable the interrupt for the device */
XScuGic_Enable
(
&
xscugic
,
UartIntrId
);
XScuGic_Enable
(
&
state
->
xscugic
,
UartIntrId
);
/* Enable interrupts */
Xil_ExceptionEnable
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment