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

正文內(nèi)容

stm32-i2c-dma-文庫(kù)吧

2025-07-09 08:05 本頁(yè)面


【正文】 GPIO_CLK, ENABLE)。 /*! sEE_I2C Periph clock enable */ RCC_APB1PeriphClockCmd(sEE_I2C_CLK, ENABLE)。 /*! GPIO configuration */ /*! Configure sEE_I2C pins: SCL */ = sEE_I2C_SCL_PIN。 = GPIO_Speed_50MHz。 = GPIO_Mode_AF_OD。 GPIO_Init(sEE_I2C_SCL_GPIO_PORT, amp。GPIO_InitStructure)。 /*! Configure sEE_I2C pins: SDA */ = sEE_I2C_SDA_PIN。 GPIO_Init(sEE_I2C_SDA_GPIO_PORT, amp。GPIO_InitStructure)。 /* Configure and enable I2C DMA TX Channel interrupt */ = sEE_I2C_DMA_TX_IRQn。 = sEE_I2C_DMA_PREPRIO。 = sEE_I2C_DMA_SUBPRIO。 = ENABLE。 NVIC_Init(amp。NVIC_InitStructure)。 /* Configure and enable I2C DMA RX Channel interrupt */ = sEE_I2C_DMA_RX_IRQn。 = sEE_I2C_DMA_PREPRIO。 = sEE_I2C_DMA_SUBPRIO。 NVIC_Init(amp。NVIC_InitStructure)。 /*! I2C DMA TX and RX channels configuration */ /* Enable the DMA clock */ RCC_AHBPeriphClockCmd(sEE_I2C_DMA_CLK, ENABLE)。 /* I2C TX DMA Channel configuration */ DMA_DeInit(sEE_I2C_DMA_CHANNEL_TX)。 = (uint32_t)sEE_I2C_DR_Address。 = (uint32_t)0。 /* This parameter will be configured durig munication */ = DMA_DIR_PeripheralDST。 /* This parameter will be configured durig munication */ = 0xFFFF。 /* This parameter will be configured durig munication */ = DMA_PeripheralInc_Disable。 = DMA_MemoryInc_Enable。 = DMA_MemoryDataSize_Byte。 = DMA_MemoryDataSize_Byte。 = DMA_Mode_Normal。 = DMA_Priority_VeryHigh。 = DMA_M2M_Disable。 DMA_Init(sEE_I2C_DMA_CHANNEL_TX, amp。sEEDMA_InitStructure)。 /* I2C RX DMA Channel configuration */ DMA_DeInit(sEE_I2C_DMA_CHANNEL_RX)。 DMA_Init(sEE_I2C_DMA_CHANNEL_RX, amp。sEEDMA_InitStructure)。 /* Enable the DMA Channels Interrupts */ DMA_ITConfig(sEE_I2C_DMA_CHANNEL_TX, DMA_IT_TC, ENABLE)。 DMA_ITConfig(sEE_I2C_DMA_CHANNEL_RX, DMA_IT_TC, ENABLE)。 }/** * @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_DIR_PeripheralDST。 = (uint32_t)BufferSize。 DMA_Init(sEE_I2C_DMA_CHANNEL_TX, amp。sEEDMA_InitStructure)。 } else { /* Configure the DMA Rx Channel with the buffer address and the buffer size */ = (uint32_t)pBuffer。 = DMA_DIR_PeripheralSRC。 = (uint32_t)BufferSize。 DMA_Init(sEE_I2C_DMA_CHANNEL_RX, amp。sEEDMA_InitStructure)。 }}void sEE_DeInit(void){ sEE_LowLevel_DeInit()。 }/** * @brief Initializes peripherals used by the I2C EEPROM driver. * @param None * @retval None */void sEE_Init(void){ I2C_InitTypeDef I2C_InitStructure。 sEE_LowLevel_Init()。 /*! I2C configuration */ /* sEE_I2C configuration */ = I2C_Mode_I2C。 = I2C_DutyCycle_2。 = I2C_SLAVE_ADDRESS7。 = I2C_Ack_Enable。 = I2C_AcknowledgedAddress_7bit。 = I2C_SPEED。 /* sEE_I2C Peripheral Enable */ I2C_Cmd(sEE_I2C, ENABLE)。 /* Apply sEE_I2C configuration after enabling it */ I2C_Init(sEE_I2C, amp。I2C_InitStructure)。 /* Enable the sEE_I2C peripheral DMA requests */ I2C_DMACmd(sEE_I2C, ENABLE)。}/** * @brief Reads a block of data from the EEPROM. * @param pBuffer : pointer to the buffer that receives the data read from * the EEPROM. * @param ReadAddr : EEPROM39。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。 /*! While the bus is busy */ sEETimeout = sEE_LONG_TIMEOUT。 while(I2C_GetFlagStatus(sEE_I2C, I2C_FLAG_BUSY)) { if((sEETimeout) == 0) return sEE_TIMEOUT_UserCallback()。 } /*! Send START condition */ I2C_GenerateSTART(sEE_I2C, ENABLE)。 /*! Test on EV5 and clear it (cleared by reading SR1 then writing to DR) */ sEETimeout = sEE_FLAG_TIMEOUT。 while(!I2C_CheckEvent(sEE_I2C, I2C_EVENT_MASTER_MODE_SELECT)) { if((sEETimeout) == 0) return sEE_TIMEOUT_UserCallback()。 } /*! Send EEPROM address for write */ I2C_Send7bitAddress(sEE_I2C, sEEAddress, I2C_Direction_Transmitter)。 /*! Test on EV6 and clear it */ sEETimeout = sEE_FLAG_TIMEOUT。 while(!I2C_CheckEvent(sEE_I2C, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED)) { if((sEETimeout) == 0) return sEE_TIMEOUT_UserCallback()。 } ifdef sEE_M24C08 /*! Send the EEPROM39。s internal address to read from: Only one byte address */ I2C_SendData(sEE_I2C,
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1