|
本帖最后由 xhzheng 于 2016-11-9 08:30 编辑 ( B- _7 [# D& w! o' F7 v' }2 b /*/ e7 z( A, L1 t- A/ l Send Data:0x03,AddrH,AddrM,AddrL,Length; */ void MX25L_Flash_ReadData(uint8_t *pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead) {* [9 a) ?+ u7 @2 e& ~/ @3 Q uint8_t data=MX25L_ReadData; 7 E( X& o' i! b$ x( k5 g5 t HAL_GPIO_WritePin(GPIOC,GPIO_PIN_8,GPIO_PIN_RESET);8 U. a% K5 y% t- N/ n HAL_SPI_Transmit(&hspi6,&data,sizeof(data),1000);: D1 b/ j1 J! M6 w ReadAddr=ReadAddr*4096;, _! e! P) o( y uint8_t Address=(ReadAddr>>16); HAL_SPI_Transmit(&hspi6,&Address,sizeof(Address),1000);7 {" q) s4 I9 P/ G* ^- N" E/ {7 L Address=(ReadAddr>>8); HAL_SPI_Transmit(&hspi6,&Address,sizeof(Address),1000);; t2 u7 K3 k0 P5 [+ S Address=ReadAddr; HAL_SPI_Transmit(&hspi6,&Address,sizeof(Address),1000); HAL_GPIO_WritePin(GPIOC,GPIO_PIN_8,GPIO_PIN_SET);2 a% h$ n6 h% z. G. K6 z, e, i }6 @) }2 `, [" q/ i8 ? 8 r+ m' s, D& |+ X+ `& L |
| 已经测试过了,没有问题的; |
| 谢楼主分享 |
|
谢谢分享 % B' ]- [9 ^: z8 j |
| 感谢楼主分享 |
| 学习了 |
| 感谢分享。 |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() :) |
微信公众号
手机版