transferCtrl.c
Go to the documentation of this file.00001
00010 #include "tRunCtrl.h"
00011 #include "transferCtrl.h"
00012 #include "sh7045lib.h"
00013
00014
00015 static int SciPort = SCI_1;
00016
00017
00018 void trans_setPort(int port) {
00019 SciPort = port;
00020 }
00021
00022
00023
00024 void initTransferCtrl(int port) {
00025 trans_setPort(port);
00026 init_sci(port, INT_SCI_LEVEL);
00027 }
00028
00029
00030 long trans_size(void) {
00031 return get_sciReadable(SciPort);
00032 }
00033
00034
00035
00036 void trans_send(const unsigned char *data, int length) {
00037 sci_write(SciPort, data, length);
00038 }
00039
00040
00041
00042 int trans_recv(unsigned char *data, int length) {
00043 return sci_read(SciPort, data, length);
00044 }
00045
00046
00047
00048 int trans_copy(unsigned char *data, int length) {
00049 return sci_copy(SciPort, data, length);
00050 }
00051
00052
00053
00054 void trans_flush(void) {
00055 flush_sciRecv(SciPort);
00056 }
00057