forked from M-Labs/artiq-zynq
api: add cxp api support for CTRL packet
This commit is contained in:
parent
7fb4b4088e
commit
4a1d41832b
|
@ -0,0 +1,11 @@
|
||||||
|
use libboard_artiq::cxp_proto;
|
||||||
|
|
||||||
|
pub extern "C" fn cxp_readu32(channel: i32, addr: i32) {
|
||||||
|
// TODO: use artiq_raise like i2c?
|
||||||
|
cxp_proto::read_u32(channel as u8, addr as u32).expect("CXP transmission failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
pub extern "C" fn cxp_writeu32(channel: i32, addr: i32, val: i32) {
|
||||||
|
// TODO: use artiq_raise like i2c?
|
||||||
|
cxp_proto::write_u32(channel as u8, addr as u32, val as u32).expect("CXP transmission failed");
|
||||||
|
}
|
|
@ -11,6 +11,8 @@ use super::{cache,
|
||||||
core1::rtio_get_destination_status,
|
core1::rtio_get_destination_status,
|
||||||
dma, linalg,
|
dma, linalg,
|
||||||
rpc::{rpc_recv, rpc_send, rpc_send_async}};
|
rpc::{rpc_recv, rpc_send, rpc_send_async}};
|
||||||
|
#[cfg(has_cxp_phys)]
|
||||||
|
use crate::cxp;
|
||||||
use crate::{eh_artiq, i2c, rtio};
|
use crate::{eh_artiq, i2c, rtio};
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -126,6 +128,12 @@ pub fn resolve(required: &[u8]) -> Option<u32> {
|
||||||
#[cfg(has_drtio)]
|
#[cfg(has_drtio)]
|
||||||
api!(subkernel_await_message = subkernel::await_message),
|
api!(subkernel_await_message = subkernel::await_message),
|
||||||
|
|
||||||
|
// CoaXPress
|
||||||
|
#[cfg(has_cxp_phys)]
|
||||||
|
api!(cxp_readu32 = cxp::cxp_readu32),
|
||||||
|
#[cfg(has_cxp_phys)]
|
||||||
|
api!(cxp_writeu32 = cxp::cxp_writeu32),
|
||||||
|
|
||||||
// Double-precision floating-point arithmetic helper functions
|
// Double-precision floating-point arithmetic helper functions
|
||||||
// RTABI chapter 4.1.2, Table 2
|
// RTABI chapter 4.1.2, Table 2
|
||||||
api!(__aeabi_dadd),
|
api!(__aeabi_dadd),
|
||||||
|
|
|
@ -35,6 +35,8 @@ pub mod rtio;
|
||||||
#[path = "../../../build/pl.rs"]
|
#[path = "../../../build/pl.rs"]
|
||||||
pub mod pl;
|
pub mod pl;
|
||||||
|
|
||||||
|
#[cfg(has_cxp_phys)]
|
||||||
|
pub mod cxp;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct RPCException {
|
pub struct RPCException {
|
||||||
|
|
Loading…
Reference in New Issue