Skip to content

Commit

Permalink
make SPI to HI-Z when idle
Browse files Browse the repository at this point in the history
  • Loading branch information
DeqingSun committed Dec 14, 2023
1 parent 1f7bfe1 commit e623770
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void setup() {
P1_DIR_PU &= ~( (1 << 5) | (1 << 6) | (1 << 7) );
P1_MOD_OC &= ~( (1 << 5) | (1 << 6) | (1 << 7) );
SPI0_SETUP = 0;
SPI0_CTRL = 0x60; //mode 0
SPI0_CTRL = 0; //mode 0
//RESET P1.1
P1_DIR_PU &= ~( (1 << 1) );
P1_MOD_OC &= ~( (1 << 1) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ uint16_t tinySpiSetupHandler() {
}
// INIT SPI BUS
P1_DIR_PU |= ((1 << 5) | (1 << 7));
SPI0_CTRL = bS0_MOSI_OE|bS0_SCK_OE; //mode 0
P1_DIR_PU |= ((1 << 1));
P1_1 = 0; // Put reset pin to output low
returnLen = 0;
Expand All @@ -101,6 +102,7 @@ uint16_t tinySpiSetupHandler() {
// set all the pins to Hi-Z
// SPI
P1_DIR_PU &= ~((1 << 5) | (1 << 6) | (1 << 7));
SPI0_CTRL = 0;
// RESET
P1_DIR_PU &= ~((1 << 1));
P1_1 = 1;
Expand Down

0 comments on commit e623770

Please sign in to comment.