|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | + |
| 3 | +#ifndef GPIB_PROTO_INCLUDED |
| 4 | +#define GPIB_PROTO_INCLUDED |
| 5 | + |
| 6 | +#include <linux/fs.h> |
| 7 | + |
| 8 | +int ibopen(struct inode *inode, struct file *filep); |
| 9 | +int ibclose(struct inode *inode, struct file *file); |
| 10 | +long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg); |
| 11 | +int osInit(void); |
| 12 | +void osReset(void); |
| 13 | +void os_start_timer(gpib_board_t *board, unsigned int usec_timeout); |
| 14 | +void os_remove_timer(gpib_board_t *board); |
| 15 | +void osSendEOI(void); |
| 16 | +void osSendEOI(void); |
| 17 | +void init_gpib_board(gpib_board_t *board); |
| 18 | +static inline unsigned long usec_to_jiffies(unsigned int usec) |
| 19 | +{ |
| 20 | + unsigned long usec_per_jiffy = 1000000 / HZ; |
| 21 | + |
| 22 | + return 1 + (usec + usec_per_jiffy - 1) / usec_per_jiffy; |
| 23 | +}; |
| 24 | + |
| 25 | +int serial_poll_all(gpib_board_t *board, unsigned int usec_timeout); |
| 26 | +void init_gpib_descriptor(gpib_descriptor_t *desc); |
| 27 | +int dvrsp(gpib_board_t *board, unsigned int pad, int sad, |
| 28 | + unsigned int usec_timeout, uint8_t *result); |
| 29 | +int ibAPWait(gpib_board_t *board, int pad); |
| 30 | +int ibAPrsp(gpib_board_t *board, int padsad, char *spb); |
| 31 | +void ibAPE(gpib_board_t *board, int pad, int v); |
| 32 | +int ibcac(gpib_board_t *board, int sync, int fallback_to_async); |
| 33 | +int ibcmd(gpib_board_t *board, uint8_t *buf, size_t length, size_t *bytes_written); |
| 34 | +int ibgts(gpib_board_t *board); |
| 35 | +int ibonline(gpib_board_t *board); |
| 36 | +int iboffline(gpib_board_t *board); |
| 37 | +int iblines(const gpib_board_t *board, short *lines); |
| 38 | +int ibrd(gpib_board_t *board, uint8_t *buf, size_t length, int *end_flag, size_t *bytes_read); |
| 39 | +int ibrpp(gpib_board_t *board, uint8_t *buf); |
| 40 | +int ibrsv2(gpib_board_t *board, uint8_t status_byte, int new_reason_for_service); |
| 41 | +void ibrsc(gpib_board_t *board, int request_control); |
| 42 | +int ibsic(gpib_board_t *board, unsigned int usec_duration); |
| 43 | +int ibsre(gpib_board_t *board, int enable); |
| 44 | +int ibpad(gpib_board_t *board, unsigned int addr); |
| 45 | +int ibsad(gpib_board_t *board, int addr); |
| 46 | +int ibeos(gpib_board_t *board, int eos, int eosflags); |
| 47 | +int ibwait(gpib_board_t *board, int wait_mask, int clear_mask, int set_mask, |
| 48 | + int *status, unsigned long usec_timeout, gpib_descriptor_t *desc); |
| 49 | +int ibwrt(gpib_board_t *board, uint8_t *buf, size_t cnt, int send_eoi, size_t *bytes_written); |
| 50 | +int ibstatus(gpib_board_t *board); |
| 51 | +int general_ibstatus(gpib_board_t *board, const gpib_status_queue_t *device, |
| 52 | + int clear_mask, int set_mask, gpib_descriptor_t *desc); |
| 53 | +int io_timed_out(gpib_board_t *board); |
| 54 | +int ibppc(gpib_board_t *board, uint8_t configuration); |
| 55 | + |
| 56 | +#endif /* GPIB_PROTO_INCLUDED */ |
0 commit comments