diff options
author | Piotr Esden-Tempski <piotr@esden.net> | 2018-12-24 09:10:59 +0100 |
---|---|---|
committer | Piotr Esden-Tempski <piotr@esden.net> | 2018-12-24 09:10:59 +0100 |
commit | 61bc31bbdc359571e4315e197dbee9b00d739aac (patch) | |
tree | b41d28c2ea32034cc29d018de0982fc1a80dec20 /iceprog/mpsse.h | |
parent | 9671b760f84ca4006f0ef101a3e3b201df4eabb5 (diff) | |
download | icestorm-61bc31bbdc359571e4315e197dbee9b00d739aac.tar.gz icestorm-61bc31bbdc359571e4315e197dbee9b00d739aac.tar.bz2 icestorm-61bc31bbdc359571e4315e197dbee9b00d739aac.zip |
Factored out mpsse functions for easier reusability.
Diffstat (limited to 'iceprog/mpsse.h')
-rw-r--r-- | iceprog/mpsse.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/iceprog/mpsse.h b/iceprog/mpsse.h new file mode 100644 index 0000000..af8e045 --- /dev/null +++ b/iceprog/mpsse.h @@ -0,0 +1,37 @@ +/* + * iceprog -- simple programming tool for FTDI-based Lattice iCE programmers + * + * Copyright (C) 2015 Clifford Wolf <clifford@clifford.at> + * Copyright (C) 2018 Piotr Esden-Tempski <piotr@esden.net> + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef MPSSE_H +#define MPSSE_H + +void mpsse_check_rx(void); +void mpsse_error(int status); +uint8_t mpsse_recv_byte(void); +void mpsse_send_byte(uint8_t data); +void mpsse_send_spi(uint8_t *data, int n); +void mpsse_xfer_spi(uint8_t *data, int n); +uint8_t mpsse_xfer_spi_bits(uint8_t data, int n); +void mpsse_set_gpio(int slavesel_b, int creset_b); +int mpsse_get_cdone(void); +void mpsse_send_dummy_bytes(uint8_t n); +void mpsse_send_dummy_bit(void); +void mpsse_init(int ifnum, const char *devstr, bool slow_clock); +void mpsse_close(void); + +#endif /* MPSSE_H */
\ No newline at end of file |