Skip to content

Instantly share code, notes, and snippets.

@RickKimball
Last active December 11, 2015 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RickKimball/4565318 to your computer and use it in GitHub Desktop.
Save RickKimball/4565318 to your computer and use it in GitHub Desktop.
forum comment
uint32_t max31855::memory_read(void)
{
uint32_t mask = 0x80000000;
uint32_t data = 0;
digitalWrite(_cs,LOW);
do {
digitalWrite(_sclk, HIGH);
if (digitalRead(_so)) {
data |= mask;
}
digitalWrite(_sclk,LOW);
mask >>= 1;
} while(mask);
digitalWrite(_cs, HIGH);
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment