endpoint.h 1 KB
Newer Older
Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
1 2 3
#ifndef __ENDPOINT_H
#define __ENDPOINT_H

Grzegorz Daniluk's avatar
Grzegorz Daniluk committed
4 5 6
#define DMTD_AVG_SAMPLES 256
#define DMTD_MAX_PHASE 16384

7 8
#include <stdint.h>

9 10 11 12 13 14 15 16 17 18 19
typedef enum {
AND=0,
NAND=4,
OR=1,
NOR=5,
XOR=2,
XNOR=6,
MOV=3,
NOT=7
} pfilter_op_t;

Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
20
void ep_init(uint8_t mac_addr[]);
Grzegorz Daniluk's avatar
Grzegorz Daniluk committed
21
void get_mac_addr(uint8_t dev_addr[]);
22
void set_mac_addr(uint8_t dev_addr[]);
Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
23
int ep_enable(int enabled, int autoneg);
24
int ep_link_up(uint16_t *lpa);
Grzegorz Daniluk's avatar
Grzegorz Daniluk committed
25 26 27 28
int ep_get_deltas(uint32_t *delta_tx, uint32_t *delta_rx);
int ep_get_psval(int32_t *psval);
int ep_cal_pattern_enable();
int ep_cal_pattern_disable();
29 30 31 32 33 34 35 36 37 38

void pfilter_new();
void pfilter_cmp(int offset, int value, int mask, pfilter_op_t op, int rd);
void pfilter_btst(int offset, int bit_index, pfilter_op_t op, int rd);
void pfilter_nop();
void pfilter_logic2(int rd, int ra, pfilter_op_t op, int rb);
static void pfilter_logic3(int rd, int ra, pfilter_op_t op, int rb, pfilter_op_t op2, int rc);
void pfilter_load();
void pfilter_init_default();

39 40 41
uint16_t pcs_read(int location);
void pcs_write(int location, int value);

Tomasz Wlostowski's avatar
Tomasz Wlostowski committed
42
#endif