-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DDS over RTIO (batch mode not supported yet)
1 parent
a91bb48
commit a36c51e
Showing
17 changed files
with
200 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,43 @@ | ||
#ifndef __RTIO_H | ||
#define __RTIO_H | ||
|
||
#include <generated/csr.h> | ||
#include "exceptions.h" | ||
|
||
#define RTIO_O_STATUS_FULL 1 | ||
#define RTIO_O_STATUS_UNDERFLOW 2 | ||
#define RTIO_O_STATUS_SEQUENCE_ERROR 4 | ||
#define RTIO_I_STATUS_EMPTY 1 | ||
#define RTIO_I_STATUS_OVERFLOW 2 | ||
|
||
void rtio_init(void); | ||
long long int rtio_get_counter(void); | ||
|
||
static inline void rtio_write_and_process_status(long long int timestamp, int channel) | ||
{ | ||
int status; | ||
|
||
rtio_o_we_write(1); | ||
status = rtio_o_status_read(); | ||
if(status) { | ||
if(status & RTIO_O_STATUS_FULL) | ||
while(rtio_o_status_read() & RTIO_O_STATUS_FULL); | ||
if(status & RTIO_O_STATUS_UNDERFLOW) { | ||
rtio_o_underflow_reset_write(1); | ||
exception_raise_params(EID_RTIO_UNDERFLOW, | ||
timestamp, channel, rtio_get_counter()); | ||
} | ||
if(status & RTIO_O_STATUS_SEQUENCE_ERROR) { | ||
rtio_o_sequence_error_reset_write(1); | ||
exception_raise_params(EID_RTIO_SEQUENCE_ERROR, | ||
timestamp, channel, 0); | ||
} | ||
} | ||
} | ||
|
||
void rtio_set_o(long long int timestamp, int channel, int value); | ||
void rtio_set_oe(long long int timestamp, int channel, int oe); | ||
void rtio_set_sensitivity(long long int timestamp, int channel, int sensitivity); | ||
long long int rtio_get_counter(void); | ||
long long int rtio_get(int channel, long long int time_limit); | ||
|
||
void rtio_fud_sync(void); | ||
void rtio_fud(long long int fud_time); | ||
|
||
#endif /* __RTIO_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters