OpenCores
URL https://opencores.org/ocsvn/pc_fpga_com/pc_fpga_com/trunk

Subversion Repositories pc_fpga_com

[/] [pc_fpga_com/] [trunk/] [PC_FPGA_PLATFPORM/] [SOFTWARE/] [fpga_com.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 NikosAl
/*
2
 * Copyright (C) 2011 Simon A. Berger
3
 *
4
 *  This program is free software; you may redistribute it and/or modify its
5
 *  under the terms of the GNU Lesser General Public License as published by the Free
6
 *  Software Foundation; either version 2 of the License, or (at your option)
7
 *  any later version.
8
 *
9
 *  This program is distributed in the hope that it will be useful, but
10
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11
 *  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
 *  for more details.
13
 */
14
 
15
#include <arpa/inet.h>
16
#include <stdint.h>
17
 
18
#ifdef __cplusplus
19
extern "C" {
20
#endif
21
 
22
 
23
const static int FPC_CODE_CHAR = 1;
24
const static int FPC_CODE_SHORT = 2;
25
const static int FPC_CODE_INT = 3;
26
const static int FPC_CODE_LONG = 5;
27
const static int FPC_CODE_FLOAT = 4;
28
const static int FPC_CODE_DOUBLE = 6;
29
 
30
typedef struct {
31
    /* local and remote socket addresses */
32
    struct sockaddr_in l_sockaddr;
33
    struct sockaddr_in d_sockaddr;
34
 
35
    /* my socket */
36
    int s;
37
    size_t mtu;
38
} fpga_con_t;
39
 
40
 
41
void fpga_con_init( fpga_con_t *con, const void *daddr, int lport, int dport );
42
ssize_t fpga_con_send( fpga_con_t *con, const void *buf, size_t len );
43
void fpga_con_send_init_packet( fpga_con_t *con );
44
ssize_t fpga_con_block_recv( fpga_con_t *con, void *dbuf, size_t dsize );
45
 
46
 
47
 
48
int fpga_con_send_charv( fpga_con_t *con, char *buf, size_t n );
49
int fpga_con_send_shortv( fpga_con_t *con, int16_t *buf, size_t n );
50
int fpga_con_send_intv( fpga_con_t *con, int32_t *buf, size_t n );
51
int fpga_con_send_longv( fpga_con_t *con, int64_t *buf, size_t n );
52
int fpga_con_send_floatv( fpga_con_t *con, float *buf, size_t n );
53
int fpga_con_send_doublev( fpga_con_t *con, double *buf, size_t n );
54
 
55
 
56
void fpga_con_rpack_char( fpga_con_t *con, int size );
57
void fpga_con_rpack_short( fpga_con_t *con, int size );
58
void fpga_con_rpack_int( fpga_con_t *con, int size );
59
void fpga_con_rpack_long( fpga_con_t *con, int size );
60
void fpga_con_rpack_float( fpga_con_t *con, int size );
61
void fpga_con_rpack_double( fpga_con_t *con, int size );
62
 
63
#ifdef __cplusplus
64
}
65
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.