diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2020-06-02 10:31:46 +0200 |
---|---|---|
committer | Sylvain Munaut <tnt@246tNt.com> | 2021-12-17 19:45:34 +0100 |
commit | 98d8bee04f2d51fa0e9d5804f0525e89618bce96 (patch) | |
tree | c71f596fe35962a7bb623fe115ae25c6e76d104c | |
parent | c5a8beffec05c906b0f3a06eed1f2820d11d8b15 (diff) | |
download | icestorm-98d8bee04f2d51fa0e9d5804f0525e89618bce96.tar.gz icestorm-98d8bee04f2d51fa0e9d5804f0525e89618bce96.tar.bz2 icestorm-98d8bee04f2d51fa0e9d5804f0525e89618bce96.zip |
iceprog: Use open-drain output to drive SS and Reset line
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-rw-r--r-- | iceprog/iceprog.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/iceprog/iceprog.c b/iceprog/iceprog.c index 34245e3..c671ac1 100644 --- a/iceprog/iceprog.c +++ b/iceprog/iceprog.c @@ -96,16 +96,16 @@ enum flash_cmd { static void set_cs_creset(int cs_b, int creset_b) { uint8_t gpio = 0; - uint8_t direction = 0x93; + uint8_t direction = 0x03; - if (cs_b) { + if (!cs_b) { // ADBUS4 (GPIOL0) - gpio |= 0x10; + direction |= 0x10; } - if (creset_b) { + if (!creset_b) { // ADBUS7 (GPIOL3) - gpio |= 0x80; + direction |= 0x80; } mpsse_set_gpio(gpio, direction); |