freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

stm32-i2c-dma-文庫吧在線文庫

2025-08-26 08:05上一頁面

下一頁面
  

【正文】 if((sEETimeout) == 0) return sEE_TIMEOUT_UserCallback()。s internal address to start reading from. * param NumByteToRead : pointer to the variable holding number of bytes to * be read from the EEPROM. * * note The variable pointed by NumByteToRead is reset to 0 when all the * data are read from the EEPROM. Application should monitor this * variable in order know when the transfer is plete. * * note When number of data to be read is higher than 1, this function just * configures the munication and enable the DMA channel to transfer data. * Meanwhile, the user application may perform other tasks. * When number of data to be read is 1, then the DMA is not used. The byte * is read in polling mode. * * retval sEE_OK (0) if operation is correctly performed, else return value * different from sEE_OK (0) or the timeout user callback. */uint32_t sEE_ReadBuffer(uint8_t* pBuffer, uint16_t ReadAddr, uint16_t* NumByteToRead){ /* Set the pointer to the Number of data to be read. This pointer will be used by the DMA Transfer Completer interrupt Handler in order to reset the variable to 0. User should check on this variable in order to know if the DMA transfer has been plete or not. */ sEEDataReadPointer = NumByteToRead。 = I2C_Ack_Enable。 DMA_Init(sEE_I2C_DMA_CHANNEL_RX, amp。 }/** * brief Initializes DMA channel used by the I2C EEPROM driver. * param None * retval None */void sEE_LowLevel_DMAConfig(uint32_t pBuffer, uint32_t BufferSize, uint32_t Direction){ /* Initialize the DMA with the new parameters */ if (Direction == sEE_DIRECTION_TX) { /* Configure the DMA Tx Channel with the buffer address and the buffer size */ = (uint32_t)pBuffer。 = DMA_M2M_Disable。 /* This parameter will be configured durig munication */ = DMA_DIR_PeripheralDST。 = sEE_I2C_DMA_PREPRIO。GPIO_InitStructure)。 /*! sEE_I2C Periph clock enable */ RCC_APB1PeriphClockCmd(sEE_I2C_CLK, ENABLE)。NVIC_InitStructure)。 = sEE_I2C_DMA_SUBPRIO。 = GPIO_Mode_IN_FLOATING。 __IO uint8_t sEEDataNum。/* USER Callbacks: These are functions for which prototypes only are declared in EEPROM driver and that should be implemented into user applicaiton. */ /* sEE_TIMEOUT_UserCallback() function is called whenever a timeout condition occure during munication (waiting on an event that doesn39。void sEE_Init(void)。void sEE_ExitCriticalSection_UserCallback(void)。 NVIC_InitTypeDef NVIC_InitStructure。 /*! Configure sEE_I2C pins: SDA */ = sEE_I2C_SDA_PIN。NVIC_InitStructure)。 DMA_DeInit(sEE_I2C_DMA_CHANNEL_TX)。 = GPIO_Mode_AF_OD。 = sEE_I2C_DMA_SUBPRIO。NVIC_InitStructure)。 = DMA_MemoryInc_Enable。 /* I2C RX DMA Channel configuration */ DMA_DeInit(sEE_I2C_DMA_CHANNEL_RX)。 DMA_Init(sEE_I2C_DMA_CHANNEL_TX, amp。 }/** * brief Initializes peripherals used by the I2C EEPROM driver. * param None * retval None */void sEE_Init(void){ I2C_InitTypeDef I2C_InitStructure。 /* sEE_I2C Peripheral Enable */ I2C_Cmd(sEE_I2C, ENABLE)。 } /*! Send START condition */ I2C_GenerateSTART(sEE_I2C, ENABLE)。 elif defined (sEE_M24C64_32) /*! Send the EEPROM39。 //發(fā)送低位地址 endif /*! sEE_M24C08 */ /*! Test on EV8 and clear it */ sEETimeout = sEE_FLAG_TIMEOUT。 while(I2C_GetFlagStatus(sEE_I2C, I2C_FLAG_ADDR) == RESET) { if((sEETimeout) == 0) return sEE_TIMEOUT_UserCallback()。 } /*! Read the byte received from the EEPROM */ *pBuffer = I2C_ReceiveData(sEE_I2C)。 } /* Configure the DMA Rx Channel with the buffer address and the buffer size */ sEE_LowLevel_DMAConfig((uint32_t)pBuffer, (uint16_t)(*NumByteToRead), sEE_DIRECTION_RX)。 while(I2C_GetFlagStatus(sEE_I2C, I2C_FLAG_BUSY)) { if((sEETimeout) == 0) return sEE_TIMEOUT_UserCallback()。 }ifdef sEE_M24C08 /*! Send the EEPROM39。s internal address to write to : LSB of the address */ I2C_SendData(sEE_I2C, (uint8_t)(WriteAddr amp。s internal address to write to. * param NumByteToWrite : number of bytes to write to the EEPROM. * retval None */void sEE_WriteBuffer(uint8_t* pBuffer, uint16_t WriteAddr, uint16_t NumByteToWrite){ uint8_t NumOfPage = 0, NumOfSingle = 0, count = 0。sEEDataNum))。sEEDataNum))。 } if(NumOfSingle!=0) { /* Store the number of data to be written */ sEEDataNum = NumOfSingle。 } } } /*! If WriteAddr is not sEE_PAGESIZE aligned */ else { /*! If NumByteToWrite sEE_PAGESIZE */ if(NumOfPage== 0) { /*! If the number of data to be written is more than the remaining space in the current page: */ if (NumByteToWrite count) { /* Store the number of data to be written */ sEEDataNum = count。 /* Store the number of data to be written */ sEEDataNum = (NumByteToWrite count)。 } else { /* Store the number of data to be written */ sEEDataNum = NumOfSingle。 } } /*! If NumByteToWrite sEE_PAGESIZE */ else { NumByteToWrite = count。 return。 /* Wait transfer through DMA to be plete */ sEETimeout = sEE_LONG_TIMEOUT。 sEE_WritePage(pBuffer, WriteAddr, (uint8_t*)(amp。t answer to I2C packets addressed to it. Once the write operation * is plete the EEPROM responds to its address. * * note It is not necessary to call this function after sEE_WriteBuffer() * function (sEE_WriteBuffer() already calls this function after each * write page operation). * * param None * retval sEE_OK (0) i
點擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1