API Reference
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
neorv32_slink.h
Go to the documentation of this file.
1// ================================================================================ //
2// The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 //
3// Copyright (c) NEORV32 contributors. //
4// Copyright (c) 2020 - 2026 Stephan Nolting. All rights reserved. //
5// Licensed under the BSD-3-Clause license, see LICENSE for details. //
6// SPDX-License-Identifier: BSD-3-Clause //
7// ================================================================================ //
8
14#ifndef NEORV32_SLINK_H
15#define NEORV32_SLINK_H
16
17#include <neorv32.h>
18#include <stdint.h>
19
20/**********************************************************************/
25typedef volatile struct __attribute__((packed,aligned(4))) {
26 uint32_t CTRL;
27 uint32_t ROUTE;
28 uint32_t DATA;
29 uint32_t DATA_LAST;
31
33#define NEORV32_SLINK ((neorv32_slink_t*) (NEORV32_SLINK_BASE))
34
58/**********************************************************************/
63void neorv32_slink_setup(uint32_t irq_mask);
67int neorv32_slink_rx_full(void);
69int neorv32_slink_tx_full(void);
73/**********************************************************************/
77static inline uint32_t __attribute__((always_inline)) neorv32_slink_get(void) {
78 return NEORV32_SLINK->DATA;
79}
80
81/**********************************************************************/
86static inline int __attribute__((always_inline)) neorv32_slink_check_last(void) {
87 return (int)(NEORV32_SLINK->CTRL & (1 << SLINK_CTRL_RX_LAST));
88}
89
90/**********************************************************************/
95static inline void __attribute__((always_inline)) neorv32_slink_set_dst(uint32_t dst) {
96 NEORV32_SLINK->ROUTE = dst;
97}
98
99/**********************************************************************/
104static inline uint32_t __attribute__((always_inline)) neorv32_slink_get_src(void) {
105 return NEORV32_SLINK->ROUTE;
106}
107
108/**********************************************************************/
112static inline void __attribute__((always_inline)) neorv32_slink_put(uint32_t tx_data) {
113 NEORV32_SLINK->DATA = tx_data;
114}
115
116/**********************************************************************/
120static inline void __attribute__((always_inline)) neorv32_slink_put_last(uint32_t tx_data) {
121 NEORV32_SLINK->DATA_LAST = tx_data;
122}
123
124#endif // NEORV32_SLINK_H
Main NEORV32 core library / driver / HAL include file.