diff options
author | Martin Braun <martin.braun@ettus.com> | 2014-10-07 11:32:14 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2014-10-07 12:09:33 +0200 |
commit | 1b149f561370687ad65e3aa644a402f00dbd16ea (patch) | |
tree | ab86042840fa1369d64bca56c5f3a64d1a4f1f72 /firmware/e300/rev_c/io.h | |
parent | fd3e84941de463fa1a7ebab0a69515b4bf2614cd (diff) | |
download | uhd-1b149f561370687ad65e3aa644a402f00dbd16ea.tar.gz uhd-1b149f561370687ad65e3aa644a402f00dbd16ea.tar.bz2 uhd-1b149f561370687ad65e3aa644a402f00dbd16ea.zip |
Initial commit E300 support.
Diffstat (limited to 'firmware/e300/rev_c/io.h')
-rw-r--r-- | firmware/e300/rev_c/io.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/firmware/e300/rev_c/io.h b/firmware/e300/rev_c/io.h new file mode 100644 index 000000000..7eea8f0a3 --- /dev/null +++ b/firmware/e300/rev_c/io.h @@ -0,0 +1,31 @@ +/* + * Copyright 2009 Ettus Research LLC + */ + +#ifndef IO_H +#define IO_H + +#include <stdint.h> +#include <stdbool.h> + +#define IO_PX(port, pin) ((uint8_t)(((port - 'A') << 4) + pin)) +#define IO_PA(pin) IO_PX('A', pin) +#define IO_PB(pin) IO_PX('B', pin) +#define IO_PC(pin) IO_PX('C', pin) +#define IO_PD(pin) IO_PX('D', pin) + +typedef const uint8_t io_pin_t; + +void io_output_pin(io_pin_t pin); +void io_input_pin(io_pin_t pin); +bool io_is_output(io_pin_t pin); +bool io_is_input(io_pin_t pin); + +void io_set_pin(io_pin_t pin); +void io_clear_pin(io_pin_t pin); +void io_enable_pin(io_pin_t pin, bool enable); +bool io_is_pin_set(io_pin_t pin); + +bool io_test_pin(io_pin_t pin); + +#endif /* IO_H */ |