Last active
December 12, 2015 00:39
-
-
Save tcdowney/4685580 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void ds_gyro_read(uint8_t* pBuffer, uint8_t ReadAddr, volatile uint16_t NumByteToRead) { | |
| if (NumByteToRead > 0x01) { | |
| ReadAddr |= (uint8_t)(0x80 | 0x40); // If sending more that one byte set multibyte commands | |
| } | |
| else { | |
| ReadAddr |= (uint8_t) (0x80); // Else just set the read mode | |
| } | |
| GYRO_CS_LOW(); | |
| //GPIO_ResetBits(GPIOE, GPIO_Pin_3); | |
| ds_gyro_sendbyte(ReadAddr); | |
| while(NumByteToRead > 0x00) { | |
| *pBuffer = ds_gyro_sendbyte(((uint8_t)0x00)); | |
| NumByteToRead--; | |
| pBuffer++; | |
| } | |
| GYRO_CS_HIGH(); | |
| //GPIO_SetBits(GPIOE, GPIO_Pin_3); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment