Skip to content

Commit

Permalink
Update ch341a_bitbang.c
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxproff authored Apr 9, 2023
1 parent a71012c commit d2e9623
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ch341a_bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ bool CH341ChipSelect_bitbang(PROGRAMMER * pgm, unsigned int cs, bool enable) {
if (enable)
//cmd[1] = CH341A_CMD_UIO_STM_OUT | ( 0x37 & ~(1<<cs));
cmd[1] = CH341A_CMD_UIO_STM_OUT | 0x00;
//cmd[1] = CH341A_CMD_UIO_STM_OUT |0x02; //TODO: for use CS1, I don't test it
//cmd[1] = CH341A_CMD_UIO_STM_OUT |0x03; //TODO: for use both CS0+CS1, I don't test it
else
//cmd[1] = CH341A_CMD_UIO_STM_OUT | 0x37;
cmd[1] = CH341A_CMD_UIO_STM_OUT | 0x01;
Expand Down Expand Up @@ -497,7 +499,7 @@ void ch341a_bitbang_initpgm(PROGRAMMER * pgm) {
#endif /* HAVE_LIBUSB */
const char ch341a_bitbang_desc[] = "Driver for \"ch341a_bitbang\"-type programmers";

#define DELAY_US 4
#define DELAY_US 4 //TODO: Edit DELAY_US for tune bitbang speed.

BOOL MegaSpiOutInData(
PROGRAMMER * pgm,
Expand Down Expand Up @@ -784,6 +786,8 @@ ULONG i;
mBuffer[ i++ ] = CH341A_CMD_UIO_STREAM; // ÃüÁîÂë
mBuffer[ i++ ] = CH341A_CMD_UIO_STM_OUT | 0x00; // default status: all 0
mBuffer[ i++ ] = CH341A_CMD_UIO_STM_DIR | 0x29; // D0 & D3 & D5 output, other input
//mBuffer[ i++ ] = CH341A_CMD_UIO_STM_DIR | 0x2A; //TODO: D1 & D3 & D5 output, other input
//mBuffer[ i++ ] = CH341A_CMD_UIO_STM_DIR | 0x2B; //TODO: D0 & D1 & D3 & D5 output, other input
mBuffer[ i++ ] = CH341A_CMD_UIO_STM_US | 32; // ÑÓ?32΢Ãë
mBuffer[ i++ ] = CH341A_CMD_UIO_STM_END; // ??ÃüÁî?üÌáÇ?½áÊø
//return( CH341WriteData( pgm, mBuffer, &i ) ); // Ö´ÐÐÊý¾Ý?ÃüÁî
Expand Down

0 comments on commit d2e9623

Please sign in to comment.