tools/lib/: split non-SPI code from atusb.c in preparation for SPI-based driver
- atusb.c (atusb_error, atusb_clear_error, atusb_open, atusb_close,
atusb_reset, atusb_reset_rf, atusb_test_mode, atusb_slp_tr,
atusb_interrupt, atusb_set_clkm, atusb_dev_handle): moved to
atusb-common.c
- atusb-common.c (atusb_set_clkm): pass atusb_reg_write via
atusb_driver.reg_write instead
- atusb.c (FROM_DEV, TO_DEV, struct atusb_dsc): moved to atusb-common.h
- Makefile (OBJS): added atusb-common.o
2011-06-19 20:06:00 +03:00
|
|
|
/*
|
|
|
|
* lib/atusb-common.h - ATUSB access functions shared by all ATUSB drivers
|
|
|
|
*
|
2013-02-12 21:19:09 +02:00
|
|
|
* Written 2010-2011, 2013 by Werner Almesberger
|
|
|
|
* Copyright 2010-2011, 2013 Werner Almesberger
|
tools/lib/: split non-SPI code from atusb.c in preparation for SPI-based driver
- atusb.c (atusb_error, atusb_clear_error, atusb_open, atusb_close,
atusb_reset, atusb_reset_rf, atusb_test_mode, atusb_slp_tr,
atusb_interrupt, atusb_set_clkm, atusb_dev_handle): moved to
atusb-common.c
- atusb-common.c (atusb_set_clkm): pass atusb_reg_write via
atusb_driver.reg_write instead
- atusb.c (FROM_DEV, TO_DEV, struct atusb_dsc): moved to atusb-common.h
- Makefile (OBJS): added atusb-common.o
2011-06-19 20:06:00 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef ATUSB_COMMON_H
|
|
|
|
#define ATUSB_COMMON_H
|
|
|
|
|
|
|
|
|
|
|
|
#define FROM_DEV ATUSB_FROM_DEV(0)
|
|
|
|
#define TO_DEV ATUSB_TO_DEV(0)
|
|
|
|
|
|
|
|
|
|
|
|
struct atusb_dsc {
|
|
|
|
usb_dev_handle *dev;
|
|
|
|
int error;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int atusb_error(void *handle);
|
|
|
|
int atusb_clear_error(void *handle);
|
|
|
|
void *atusb_open(const char *arg);
|
|
|
|
void atusb_close(void *handle);
|
|
|
|
void atusb_reset(void *handle);
|
|
|
|
void atusb_reset_rf(void *handle);
|
|
|
|
void atusb_test_mode(void *handle);
|
|
|
|
void atusb_slp_tr(void *handle, int on, int pulse);
|
2011-06-20 22:06:51 +03:00
|
|
|
int atusb_interrupt_wait(void *handle, int timeout_ms);
|
2011-07-12 18:10:48 +03:00
|
|
|
void atusb_rx_mode(void *handle, int on);
|
2013-02-12 21:19:09 +02:00
|
|
|
int atusb_rx(void *handle, void *buf, int size, int timeout_ms, uint8_t *lqi);
|
2011-07-12 18:10:48 +03:00
|
|
|
void atusb_tx(void *handle, const void *buf, int size);
|
2011-06-20 22:06:51 +03:00
|
|
|
|
tools/lib/: split non-SPI code from atusb.c in preparation for SPI-based driver
- atusb.c (atusb_error, atusb_clear_error, atusb_open, atusb_close,
atusb_reset, atusb_reset_rf, atusb_test_mode, atusb_slp_tr,
atusb_interrupt, atusb_set_clkm, atusb_dev_handle): moved to
atusb-common.c
- atusb-common.c (atusb_set_clkm): pass atusb_reg_write via
atusb_driver.reg_write instead
- atusb.c (FROM_DEV, TO_DEV, struct atusb_dsc): moved to atusb-common.h
- Makefile (OBJS): added atusb-common.o
2011-06-19 20:06:00 +03:00
|
|
|
int atusb_set_clkm(void *handle, int mhz);
|
|
|
|
|
|
|
|
#endif /* !ATUSB_COMMON_H */
|