• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ sFLASH_CS_LOW函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中sFLASH_CS_LOW函数的典型用法代码示例。如果您正苦于以下问题:C++ sFLASH_CS_LOW函数的具体用法?C++ sFLASH_CS_LOW怎么用?C++ sFLASH_CS_LOW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了sFLASH_CS_LOW函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sFLASH_SoftReset

/**
* @brief	Enables the write access to the FLASH.
* @param	None
* @retval None
*/
void sFLASH_SoftReset(void)
{
	/*!< Select the FLASH: Chip Select low */
	sFLASH_CS_LOW();

	/*!< Send "Write Enable" instruction */
	sFLASH_SendByte(sFLASH_CMD_RST0);

	/*!< Deselect the FLASH: Chip Select high */
	sFLASH_CS_HIGH();

	//delay	
	//sFLASH_SendByte(sFLASH_DUMMY_BYTE);


	/*!< Select the FLASH: Chip Select low */
	sFLASH_CS_LOW();

	/*!< Send "Write Enable" instruction */
	sFLASH_SendByte(sFLASH_CMD_RST1);

	/*!< Deselect the FLASH: Chip Select high */
	sFLASH_CS_HIGH();

	sFLASH_WaitForWriteEnd(0);
}
开发者ID:bearxiong99,项目名称:lamp_project_master,代码行数:31,代码来源:spi_flash.c


示例2: sFLASH_WriteStatusForWrite

/**
* @brief	Enables the write access to the FLASH.
* @param	None
* @retval None
*/
void sFLASH_WriteStatusForWrite(void)
{  
#if 1
        /*!< Enable the write access to the FLASH */
        sFLASH_WriteEnable(0);

        /*!< Select the FLASH: Chip Select low */
        sFLASH_CS_LOW();

        /*!< Send "Write Enable" instruction */
        sFLASH_SendByte(sFLASH_CMD_WRSR);
        /*!< Send "Write Enable" instruction */
        sFLASH_SendByte(0x00);
        sFLASH_SendByte(0x02);

        /*!< Deselect the FLASH: Chip Select high */
        sFLASH_CS_HIGH();

        sFLASH_WaitForWriteEnd(0);

#endif	
	/*!< Select the FLASH: Chip Select low */
	sFLASH_CS_LOW();
	/*!< Send "Write Enable" instruction */
	sFLASH_SendByte(sFLASH_CMD_RDCR);
	/*!< Send "Write Enable" instruction */
	sFLASH_SendByte(sFLASH_DUMMY_BYTE);
	/*!< Deselect the FLASH: Chip Select hig */
	sFLASH_CS_HIGH();
}
开发者ID:bearxiong99,项目名称:lamp_project_master,代码行数:35,代码来源:spi_flash.c


示例3: sFLASH_WritePage

/**
  * @brief  Writes more than one byte to the FLASH with a single WRITE cycle 
  *         (Page WRITE sequence).
  * @note   The number of byte can't exceed the FLASH page size.
  * @param  pBuffer: pointer to the buffer  containing the data to be written
  *         to the FLASH.
  * @param  WriteAddr: FLASH's internal address to write to.
  * @param  NumByteToWrite: number of bytes to write to the FLASH, must be equal
  *         or less than "sFLASH_PAGESIZE" value.
  * @retval None
  */
void sFLASH_WritePage(uint8_t* pBuffer, uint32_t WriteAddr, uint16_t NumByteToWrite)
{
  /*!< Enable the write access to the FLASH */
  sFLASH_WriteEnable();

  /*!< Select the FLASH: Chip Select low */
  sFLASH_CS_LOW();
  /*!< Send "Write to Memory " instruction */
  sFLASH_SendByte(sFLASH_CMD_WRITE);
  /*!< Send WriteAddr high nibble address byte to write to */
  sFLASH_SendByte((WriteAddr & 0xFF0000) >> 16);
  /*!< Send WriteAddr medium nibble address byte to write to */
  sFLASH_SendByte((WriteAddr & 0xFF00) >> 8);
  /*!< Send WriteAddr low nibble address byte to write to */
  sFLASH_SendByte(WriteAddr & 0xFF);

  /*!< while there is data to be written on the FLASH */
  while (NumByteToWrite--)
  {
    /*!< Send the current byte */
    sFLASH_SendByte(*pBuffer);
    /*!< Point on the next byte to be written */
    pBuffer++;
  }

  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();

  /*!< Wait the end of Flash writing */
  sFLASH_WaitForWriteEnd();
}
开发者ID:vincentwilliam,项目名称:STM32F4XX_User_Lib,代码行数:42,代码来源:spi_flash.c


示例4: sFLASH_WaitForWriteEnd

/**
  * @brief  Polls the status of the Write In Progress (WIP) flag in the FLASH's
  *         status register and loop until write opertaion has completed.
  * @param  None
  * @retval None
  */
void sFLASH_WaitForWriteEnd(uint32_t Addr)
{
  uint8_t flashstatus = 0;

  if(Addr >= sFLASH_MEMORYSIZE)  
	  {
		  /*!< Select the FLASH: Chip Select low */
		  sFLASH_CS2_LOW();
	  }
	  else
	  {
		  /*!< Select the FLASH: Chip Select low */
		  sFLASH_CS_LOW();
	  }  

 
  /*!< Send "Read Status Register" instruction */
  sFLASH_SendByte(sFLASH_CMD_RDSR);

  /*!< Loop as long as the memory is busy with a write cycle */
  do
  {
    /*!< Send a dummy byte to generate the clock needed by the FLASH
    and put the value of the status register in FLASH_Status variable */
    flashstatus = sFLASH_SendByte(sFLASH_DUMMY_BYTE);

  }
  while ((flashstatus & sFLASH_WIP_FLAG) == SET); /* Write in progress */

  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();

}
开发者ID:bearxiong99,项目名称:lamp_project_master,代码行数:39,代码来源:spi_flash.c


示例5: sFLASH_ReadBuffer

/**
  * @brief  Reads a block of data from the FLASH.
  * @param  pBuffer: pointer to the buffer that receives the data read from the FLASH.
  * @param  ReadAddr: FLASH's internal address to read from.
  * @param  NumByteToRead: number of bytes to read from the FLASH.
  * @retval None
  */
void sFLASH_ReadBuffer(uint8_t* pBuffer, uint32_t ReadAddr, uint16_t NumByteToRead)
{
  /*!< Select the FLASH: Chip Select low */
  sFLASH_CS_LOW();

  /*!< Send "Read from Memory " instruction */
  sFLASH_SendByte(sFLASH_CMD_READ);

  /*!< Send ReadAddr high nibble address byte to read from */
  sFLASH_SendByte((ReadAddr & 0xFF0000) >> 16);
  /*!< Send ReadAddr medium nibble address byte to read from */
  sFLASH_SendByte((ReadAddr& 0xFF00) >> 8);
  /*!< Send ReadAddr low nibble address byte to read from */
  sFLASH_SendByte(ReadAddr & 0xFF);

  while (NumByteToRead--) /*!< while there is data to be read */
  {
    /*!< Read a byte from the FLASH */
    *pBuffer = sFLASH_SendByte(sFLASH_DUMMY_BYTE);
    /*!< Point to the next location where the byte read will be saved */
    pBuffer++;
  }

  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();
}
开发者ID:vincentwilliam,项目名称:STM32F4XX_User_Lib,代码行数:33,代码来源:spi_flash.c


示例6: sFLASH_ReadID

/**
  * @brief  Reads FLASH identification.
  * @param  None
  * @retval FLASH identification
  */
uint32_t sFLASH_ReadID(void)
{
  uint32_t Temp = 0, Temp0 = 0, Temp1 = 0, Temp2 = 0;

  /*!< Select the FLASH: Chip Select low */
  sFLASH_CS_LOW();

  /*!< Send "RDID " instruction */
  sFLASH_SendByte(0x9F);

  /*!< Read a byte from the FLASH */
  Temp0 = sFLASH_SendByte(sFLASH_DUMMY_BYTE);

  /*!< Read a byte from the FLASH */
  Temp1 = sFLASH_SendByte(sFLASH_DUMMY_BYTE);

  /*!< Read a byte from the FLASH */
  Temp2 = sFLASH_SendByte(sFLASH_DUMMY_BYTE);

  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();

  Temp = (Temp0 << 16) | (Temp1 << 8) | Temp2;

  return Temp;
}
开发者ID:vincentwilliam,项目名称:STM32F4XX_User_Lib,代码行数:31,代码来源:spi_flash.c


示例7: sFLASH_ReadBuffer

/**
 * @brief  Reads a block of data from the FLASH.
 * @param  pBuffer: pointer to the buffer that receives the data read from the FLASH.
 * @param  ReadAddr: FLASH's internal address to read from.
 * @param  NumByteToRead: number of bytes to read from the FLASH.
 * @retval None
 */
void sFLASH_ReadBuffer(uint8_t* pBuffer, uint32_t ReadAddr, uint32_t NumByteToRead)
{
    /* Select the FLASH: Chip Select low */
    sFLASH_CS_LOW();

    /* Send "Read from Memory " instruction */
    sFLASH_SendByte(sFLASH_CMD_READ);

    /* Send ReadAddr high nibble address byte to read from */
    sFLASH_SendByte((ReadAddr & 0xFF0000) >> 16);
    /* Send ReadAddr medium nibble address byte to read from */
    sFLASH_SendByte((ReadAddr& 0xFF00) >> 8);
    /* Send ReadAddr low nibble address byte to read from */
    sFLASH_SendByte(ReadAddr & 0xFF);

    while (NumByteToRead) /* while there is data to be read */
    {
        /* Read a byte from the FLASH and point to the next location */
        *pBuffer++ = sFLASH_SendByte(sFLASH_DUMMY_BYTE);
        /* Decrement NumByteToRead */
        NumByteToRead--;
    }

    /* Deselect the FLASH: Chip Select high */
    sFLASH_CS_HIGH();
}
开发者ID:spark,项目名称:firmware,代码行数:33,代码来源:spi_flash.c


示例8: sFLASH_ReadStatus

unsigned int sFLASH_ReadStatus(void)
{
	unsigned int Temp0 = 0;
	
	/*!< Select the FLASH: Chip Select low */
	sFLASH_CS_LOW();
	
	/*!< Send "RDID " instruction */
	sFLASH_SendByte(sFLASH_CMD_RDSR);
	
	/*!< Read a byte from the FLASH */
	Temp0 = sFLASH_SendByte(sFLASH_DUMMY_BYTE);
	
	/*!< Read a byte from the FLASH */
	//Temp1 = sFLASH_SendByte(sFLASH_DUMMY_BYTE);
	
	/*!< Read a byte from the FLASH */
	//Temp2 = sFLASH_SendByte(sFLASH_DUMMY_BYTE);
	
	/*!< Deselect the FLASH: Chip Select high */
	sFLASH_CS_HIGH();
	
	//Temp = Temp0;
	
	return Temp0;
}
开发者ID:ADTL,项目名称:AFGUI,代码行数:26,代码来源:at26df.c


示例9: sFLASH_WriteEnable

/**
  * @brief  Enables the write access to the FLASH.
  * @param  None
  * @retval None
  */
void sFLASH_WriteEnable(void)
{
  /*!< Select the FLASH: Chip Select low */
  sFLASH_CS_LOW();

  /*!< Send "Write Enable" instruction */
  sFLASH_SendByte(sFLASH_CMD_WREN);

  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();
}
开发者ID:vincentwilliam,项目名称:STM32F4XX_User_Lib,代码行数:16,代码来源:spi_flash.c


示例10: sFLASH_WriteDisable

/**
 * @brief  Disables the write access to the FLASH.
 * @param  None
 * @retval None
 */
static void sFLASH_WriteDisable(void)
{
    /* Select the FLASH: Chip Select low */
    sFLASH_CS_LOW();

    /* Send "Write Disable" instruction */
    sFLASH_SendByte(sFLASH_CMD_WRDI);

    /* Deselect the FLASH: Chip Select high */
    sFLASH_CS_HIGH();
}
开发者ID:spark,项目名称:firmware,代码行数:16,代码来源:spi_flash.c


示例11: sFLASH_GlobalUnprotect

void sFLASH_GlobalUnprotect(void)
{
	sFLASH_WriteEnable();
	
	sFLASH_CS_LOW();
	
	sFLASH_SendByte(sFLASH_CMD_WRSR);
	
	sFLASH_SendByte(0);

	/*!< Deselect the FLASH: Chip Select high */
	sFLASH_CS_HIGH();
	
}	
开发者ID:ADTL,项目名称:AFGUI,代码行数:14,代码来源:at26df.c


示例12: sFLASH_Init

/**
 * @brief Initializes SPI Flash
 * @param void
 * @return void
 */
void sFLASH_Init(void)
{
    /* Initializes the peripherals used by the SPI FLASH driver */
    sFLASH_SPI_Init();

    /* Disable the write access to the FLASH */
    sFLASH_WriteDisable();

    /* Select the FLASH: Chip Select low */
    sFLASH_CS_LOW();
    /* Send "Write Enable Status" instruction */
    sFLASH_SendByte(sFLASH_CMD_EWSR);
    /* Deselect the FLASH: Chip Select high */
    sFLASH_CS_HIGH();

    /* Select the FLASH: Chip Select low */
    sFLASH_CS_LOW();
    /* Send "Write Status Register" instruction */
    sFLASH_SendByte(sFLASH_CMD_WRSR);
    sFLASH_SendByte(0);
    /* Deselect the FLASH: Chip Select high */
    sFLASH_CS_HIGH();
}
开发者ID:spark,项目名称:firmware,代码行数:28,代码来源:spi_flash.c


示例13: sFLASH_WriteEnable

/**
  * @brief  Enables the write access to the FLASH.
  * @param  None
  * @retval None
  */
void sFLASH_WriteEnable(uint32_t WriteAddr)
{
	if(WriteAddr >= sFLASH_MEMORYSIZE)
		/*!< Select the FLASH: Chip Select low */
		sFLASH_CS2_LOW();
	else
		/*!< Select the FLASH: Chip Select low */
		sFLASH_CS_LOW();

  /*!< Send "Write Enable" instruction */
  sFLASH_SendByte(sFLASH_CMD_WREN);

  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();
}
开发者ID:bearxiong99,项目名称:lamp_project_master,代码行数:20,代码来源:spi_flash.c


示例14: sFLASH_StartReadSequence

/**
  * @brief  Initiates a read data byte (READ) sequence from the Flash.
  *   This is done by driving the /CS line low to select the device, then the READ
  *   instruction is transmitted followed by 3 bytes address. This function exit
  *   and keep the /CS line low, so the Flash still being selected. With this
  *   technique the whole content of the Flash is read with a single READ instruction.
  * @param  ReadAddr: FLASH's internal address to read from.
  * @retval None
  */
void sFLASH_StartReadSequence(uint32_t ReadAddr)
{
  /*!< Select the FLASH: Chip Select low */
  sFLASH_CS_LOW();

  /*!< Send "Read from Memory " instruction */
  sFLASH_SendByte(sFLASH_CMD_READ);

  /*!< Send the 24-bit address of the address to read from -------------------*/
  /*!< Send ReadAddr high nibble address byte */
  sFLASH_SendByte((ReadAddr & 0xFF0000) >> 16);
  /*!< Send ReadAddr medium nibble address byte */
  sFLASH_SendByte((ReadAddr& 0xFF00) >> 8);
  /*!< Send ReadAddr low nibble address byte */
  sFLASH_SendByte(ReadAddr & 0xFF);
}
开发者ID:vincentwilliam,项目名称:STM32F4XX_User_Lib,代码行数:25,代码来源:spi_flash.c


示例15: sFLASH_EraseBulk

/**
 * @brief  Erases the entire FLASH.
 * @param  None
 * @retval None
 */
void sFLASH_EraseBulk(void)
{
    /* Enable the write access to the FLASH */
    sFLASH_WriteEnable();

    /* Bulk Erase */
    /* Select the FLASH: Chip Select low */
    sFLASH_CS_LOW();
    /* Send Bulk Erase instruction  */
    sFLASH_SendByte(sFLASH_CMD_BE);
    /* Deselect the FLASH: Chip Select high */
    sFLASH_CS_HIGH();

    /* Wait till the end of Flash writing */
    sFLASH_WaitForWriteEnd();
}
开发者ID:spark,项目名称:firmware,代码行数:21,代码来源:spi_flash.c


示例16: sFLASH_EraseBulk

/**
  * @brief  Erases the entire FLASH.
  * @param  None
  * @retval None
  */
void sFLASH_EraseBulk(void)
{
  /*!< Send write enable instruction */
  sFLASH_WriteEnable();

  /*!< Bulk Erase */
  /*!< Select the FLASH: Chip Select low */
  sFLASH_CS_LOW();
  /*!< Send Bulk Erase instruction  */
  sFLASH_SendByte(sFLASH_CMD_BE);
  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();

  /*!< Wait the end of Flash writing */
  sFLASH_WaitForWriteEnd();
}
开发者ID:vincentwilliam,项目名称:STM32F4XX_User_Lib,代码行数:21,代码来源:spi_flash.c


示例17: sFLASH_EraseSector

/**
  * @brief  Erases the specified FLASH sector.
  * @param  SectorAddr: address of the sector to erase.
  * @retval None
  */
void sFLASH_EraseSector(uint32_t SectorAddr)
{
  /*!< Send write enable instruction */
  sFLASH_WriteEnable();

  /*!< Sector Erase */
  /*!< Select the FLASH: Chip Select low */
  sFLASH_CS_LOW();
  /*!< Send Sector Erase instruction */
  sFLASH_SendByte(sFLASH_CMD_SE);
  /*!< Send SectorAddr high nibble address byte */
  sFLASH_SendByte((SectorAddr & 0xFF0000) >> 16);
  /*!< Send SectorAddr medium nibble address byte */
  sFLASH_SendByte((SectorAddr & 0xFF00) >> 8);
  /*!< Send SectorAddr low nibble address byte */
  sFLASH_SendByte(SectorAddr & 0xFF);
  /*!< Deselect the FLASH: Chip Select high */
  sFLASH_CS_HIGH();

  /*!< Wait the end of Flash writing */
  sFLASH_WaitForWriteEnd();
}
开发者ID:vincentwilliam,项目名称:STM32F4XX_User_Lib,代码行数:27,代码来源:spi_flash.c


示例18: sFLASH_EraseBlock32k

void sFLASH_EraseBlock32k(unsigned int SectorAddr)
{
	__IO unsigned int status;
	/*!< Send write enable instruction */
	sFLASH_WriteEnable();
	/*!< Sector Erase */
	/*!< Select the FLASH: Chip Select low */
	sFLASH_CS_LOW();
	/*!< Send Sector Erase instruction */
	sFLASH_SendByte(sFLASH_CMD_32K_ERASE);
	/*!< Send SectorAddr high nibble address byte */
	sFLASH_SendByte((SectorAddr & 0xFF0000) >> 16);
	/*!< Send SectorAddr medium nibble address byte */
	sFLASH_SendByte((SectorAddr & 0xFF00) >> 8);
	/*!< Send SectorAddr low nibble address byte */
	sFLASH_SendByte(SectorAddr & 0xFF);
	/*!< Deselect the FLASH: Chip Select high */
	sFLASH_CS_HIGH();

	/*!< Wait the end of Flash writing */
	sFLASH_WaitForWriteEnd();
}
开发者ID:ADTL,项目名称:AFGUI,代码行数:22,代码来源:at26df.c


示例19: sFLASH_ReadID

/**
 * @brief  Reads FLASH identification.
 * @param  None
 * @retval FLASH identification
 */
uint32_t sFLASH_ReadID(void)
{
    uint8_t byte[3];

    /* Select the FLASH: Chip Select low */
    sFLASH_CS_LOW();

    /* Send "JEDEC ID Read" instruction */
    sFLASH_SendByte(sFLASH_CMD_RDID);

    /* Read a byte from the FLASH */
    byte[0] = sFLASH_SendByte(sFLASH_DUMMY_BYTE);

    /* Read a byte from the FLASH */
    byte[1] = sFLASH_SendByte(sFLASH_DUMMY_BYTE);

    /* Read a byte from the FLASH */
    byte[2] = sFLASH_SendByte(sFLASH_DUMMY_BYTE);

    /* Deselect the FLASH: Chip Select high */
    sFLASH_CS_HIGH();

    return (byte[0] << 16) | (byte[1] << 8) | byte[2];
}
开发者ID:spark,项目名称:firmware,代码行数:29,代码来源:spi_flash.c



注:本文中的sFLASH_CS_LOW函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sFLASH_SendByte函数代码示例发布时间:2022-05-30
下一篇:
C++ sFLASH_CS_HIGH函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap