Skip to content

Commit

Permalink
Implement get_bits_low.
Browse files Browse the repository at this point in the history
Verified with FT4232H Mini Module.
  • Loading branch information
twasilczyk committed Apr 16, 2021
1 parent 9ea558c commit 97d3437
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/support.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ int set_bits_high(struct mpsse_context *mpsse, int port)
return raw_write(mpsse, (unsigned char *) &buf, sizeof(buf));
}

int get_bits_low(struct mpsse_context *mpsse, uint8_t* value) {
unsigned char buf[] = { GET_BITS_LOW };

int res = raw_write(mpsse, buf, sizeof(buf));
if (res != MPSSE_OK) return res;

if (raw_read(mpsse, value, 1) != 1) return MPSSE_FAIL;
return MPSSE_OK;
}

int get_bits_high(struct mpsse_context *mpsse, uint8_t* value) {
unsigned char buf[] = { GET_BITS_HIGH };

Expand Down
1 change: 1 addition & 0 deletions src/support.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ unsigned char *build_block_buffer(struct mpsse_context *mpsse, uint8_t cmd, cons
int set_bits_high(struct mpsse_context *mpsse, int port);
int set_bits_low(struct mpsse_context *mpsse, int port);
int get_bits_high(struct mpsse_context *mpsse, uint8_t* value);
int get_bits_low(struct mpsse_context *mpsse, uint8_t* value);
int gpio_write(struct mpsse_context *mpsse, int pin, int direction);
int is_valid_context(struct mpsse_context *mpsse);

Expand Down

0 comments on commit 97d3437

Please sign in to comment.