本文整理汇总了C++中LCD_CS_HIGH函数的典型用法代码示例。如果您正苦于以下问题:C++ LCD_CS_HIGH函数的具体用法?C++ LCD_CS_HIGH怎么用?C++ LCD_CS_HIGH使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LCD_CS_HIGH函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: LCD_IO_ReadData
/**
* @brief Read register value.
* @param Reg
* @retval None
*/
uint16_t LCD_IO_ReadData(uint16_t Reg)
{
uint32_t readvalue = 0;
/* Change BaudRate Prescaler 8 for Read */
/* Mean SPI baudrate is set to 72/8 = 9 MHz */
heval_Spi.Instance->CR1 &= 0xFFC7;
heval_Spi.Instance->CR1 |= SPI_BAUDRATEPRESCALER_8;
/* Send Reg value to Read */
LCD_IO_WriteReg(Reg);
/* Reset LCD control line(/CS) and Send command */
LCD_CS_LOW();
/* Send Start Byte */
SPIx_Write(START_BYTE | LCD_READ_REG);
/* Read Upper Byte */
SPIx_Write(0xFF);
readvalue = SPIx_Read();
readvalue = readvalue << 8;
readvalue |= SPIx_Read();
/* Recover Baud Rate initial value */
heval_Spi.Instance->CR1 &= 0xFFC7;
heval_Spi.Instance->CR1 |= heval_Spi.Init.BaudRatePrescaler;
HAL_Delay(10);
/* Deselect : Chip Select high */
LCD_CS_HIGH();
return readvalue;
}
开发者ID:afconsult-south,项目名称:dragonfly-fcb,代码行数:39,代码来源:stm32303e_eval.c
示例2: LCD_IO_Init
/**
* @brief Initialize the LCD
* @retval None
*/
void LCD_IO_Init(void)
{
GPIO_InitTypeDef gpioinitstruct = {0};
/* LCD_CS_GPIO and LCD_DC_GPIO Periph clock enable */
LCD_CS_GPIO_CLK_ENABLE();
LCD_DC_GPIO_CLK_ENABLE();
/* Configure LCD_CS_PIN pin: LCD Card CS pin */
gpioinitstruct.Pin = LCD_CS_PIN;
gpioinitstruct.Mode = GPIO_MODE_OUTPUT_PP;
gpioinitstruct.Pull = GPIO_NOPULL;
gpioinitstruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(SD_CS_GPIO_PORT, &gpioinitstruct);
/* Configure LCD_DC_PIN pin: LCD Card DC pin */
gpioinitstruct.Pin = LCD_DC_PIN;
HAL_GPIO_Init(LCD_DC_GPIO_PORT, &gpioinitstruct);
/* LCD chip select high */
LCD_CS_HIGH();
/* LCD SPI Config */
SPIx_Init();
}
开发者ID:LedgerHQ,项目名称:blue-nonsecure-firmware,代码行数:29,代码来源:stm32l4xx_nucleo.c
示例3: LCDInit
void LCDInit(void)
{
// Initialize SPI Interface
Initialize_SPI();
// set pin directions
LCD_CS_MAKE_OUT();
LCD_CS_HIGH();
LCD_DC_MAKE_OUT();
LCD_RES_MAKE_OUT();
// Toggle reset pin
LCD_RES_LOW();
Delay(1000);
LCD_RES_HIGH();
Delay(1000);
// Send sequence of command
LCDSend(0x21, SEND_CMD); // LCD Extended Commands.
LCDSend(0xC8, SEND_CMD); // Set LCD Vop (Contrast). 0xC8
LCDSend(0x04 | !!(LCD_START_LINE_ADDR & (1u << 6)), SEND_CMD); // Set Temp S6 for start line
LCDSend(0x40 | (LCD_START_LINE_ADDR & ((1u << 6) - 1)), SEND_CMD); // Set Temp S[5:0] for start line
//LCDSend( 0x13, SEND_CMD ); // LCD bias mode 1:48.
LCDSend(0x12, SEND_CMD); // LCD bias mode 1:68.
LCDSend(0x20, SEND_CMD); // LCD Standard Commands, Horizontal addressing mode.
//LCDSend( 0x22, SEND_CMD ); // LCD Standard Commands, Vertical addressing mode.
LCDSend(0x08, SEND_CMD); // LCD blank
LCDSend(0x0C, SEND_CMD); // LCD in normal mode.
// Clear and Update
LCDClear();
LCDUpdate();
}
开发者ID:SleepyJack,项目名称:UEXT-MODULES,代码行数:33,代码来源:lcd3310_GPIO.c
示例4: LCD_IO_WriteData
/**
* @brief Write register value.
* @param pData Pointer on the register value
* @param Size Size of byte to transmit to the register
* @retval None
*/
void LCD_IO_WriteData(uint8_t *pData, uint32_t Size)
{
uint32_t counter = 0;
/* Reset LCD control line CS */
LCD_CS_LOW();
/* Send Start Byte */
SPIx_Write(START_BYTE | LCD_WRITE_REG);
for (counter = Size; counter != 0; counter--)
{
while(((heval_Spi.Instance->SR) & SPI_FLAG_TXE) != SPI_FLAG_TXE)
{
}
/* Need to invert bytes for LCD*/
*((__IO uint8_t*)&heval_Spi.Instance->DR) = *(pData+1);
while(((heval_Spi.Instance->SR) & SPI_FLAG_TXE) != SPI_FLAG_TXE)
{
}
*((__IO uint8_t*)&heval_Spi.Instance->DR) = *pData;
counter--;
pData += 2;
}
/* Wait until the bus is ready before releasing Chip select */
while(((heval_Spi.Instance->SR) & SPI_FLAG_BSY) != RESET)
{
}
/* Deselect : Chip Select high */
LCD_CS_HIGH();
}
开发者ID:afconsult-south,项目名称:dragonfly-fcb,代码行数:40,代码来源:stm32303e_eval.c
示例5: LCD_IO_ReadData
/**
* @brief Read register value.
* @param Reg
* @retval None
*/
uint16_t LCD_IO_ReadData(uint16_t Reg)
{
uint32_t readvalue = 0;
/* Send Reg value to Read */
LCD_IO_WriteReg(Reg);
/* Reset LCD control line(/CS) and Send command */
LCD_CS_LOW();
/* Send Start Byte */
SPIx_Write(START_BYTE | LCD_READ_REG);
/* Read Upper Byte */
SPIx_Write(0xFF);
readvalue = SPIx_Read();
readvalue = readvalue << 8;
readvalue |= SPIx_Read();
HAL_Delay(10);
/* Deselect : Chip Select high */
LCD_CS_HIGH();
return readvalue;
}
开发者ID:S4mw1s3,项目名称:Nucleo32,代码行数:30,代码来源:stm32l073z_eval.c
示例6: LCD_IO_WriteData
/**
* @brief Writes register value.
*/
void LCD_IO_WriteData(uint16_t RegValue)
{
/* Set WRX to send data */
LCD_WRX_HIGH();
/* Reset LCD control line(/CS) and Send data */
LCD_CS_LOW();
SPIx_Write(RegValue);
/* Deselect: Chip Select high */
LCD_CS_HIGH();
}
开发者ID:bresch,项目名称:STM32F29Discovery_Hello_World_SW4_IDE,代码行数:15,代码来源:stm32f429i_discovery.c
示例7: LCD_IO_WriteReg
/**
* @brief Writes register address.
*/
void LCD_IO_WriteReg(uint8_t Reg)
{
/* Reset WRX to send command */
LCD_WRX_LOW();
/* Reset LCD control line(/CS) and Send command */
LCD_CS_LOW();
SPIx_Write(Reg);
/* Deselect: Chip Select high */
LCD_CS_HIGH();
}
开发者ID:bresch,项目名称:STM32F29Discovery_Hello_World_SW4_IDE,代码行数:15,代码来源:stm32f429i_discovery.c
示例8: LCD_IO_WriteMultipleData
/**
* @brief Write register value.
* @param pData Pointer on the register value
* @param Size Size of byte to transmit to the register
* @retval None
*/
void LCD_IO_WriteMultipleData(uint8_t *pData, uint32_t Size)
{
uint32_t counter = 0;
__IO uint32_t data = 0;
/* Reset LCD control line CS */
LCD_CS_LOW();
/* Set LCD data/command line DC to High */
LCD_DC_HIGH();
if (Size == 1)
{
/* Only 1 byte to be sent to LCD - general interface can be used */
/* Send Data */
SPIx_Write(*pData);
}
else
{
/* Several data should be sent in a raw */
/* Direct SPI accesses for optimization */
for (counter = Size; counter != 0; counter--)
{
while(((hnucleo_Spi.Instance->SR) & SPI_FLAG_TXE) != SPI_FLAG_TXE)
{
}
/* Need to invert bytes for LCD*/
*((__IO uint8_t*)&hnucleo_Spi.Instance->DR) = *(pData+1);
while(((hnucleo_Spi.Instance->SR) & SPI_FLAG_TXE) != SPI_FLAG_TXE)
{
}
*((__IO uint8_t*)&hnucleo_Spi.Instance->DR) = *pData;
counter--;
pData += 2;
}
/* Wait until the bus is ready before releasing Chip select */
while(((hnucleo_Spi.Instance->SR) & SPI_FLAG_BSY) != RESET)
{
}
}
/* Empty the Rx fifo */
data = *(&hnucleo_Spi.Instance->DR);
UNUSED(data); /* Remove GNU warning */
/* Deselect : Chip Select high */
LCD_CS_HIGH();
}
开发者ID:LedgerHQ,项目名称:blue-nonsecure-firmware,代码行数:56,代码来源:stm32l4xx_nucleo.c
示例9: lcd_write_data
void lcd_write_data(unsigned char data)
{
OS_CPU_SR_ALLOC();
OS_ENTER_CRITICAL();
LCD_RS_HIGH();
LCD_CS_LOW();
lcd_send_byte(data);
LCD_CS_HIGH();
OS_EXIT_CRITICAL();
}
开发者ID:bearxiong99,项目名称:gas-flow-meter,代码行数:14,代码来源:lcd.c
示例10: lcd_write_cmd
void lcd_write_cmd(unsigned char cmd)
{
OS_CPU_SR_ALLOC();
OS_ENTER_CRITICAL();
LCD_RS_LOW();
LCD_CS_LOW();
lcd_send_byte(cmd);
LCD_CS_HIGH();
OS_EXIT_CRITICAL();
}
开发者ID:bearxiong99,项目名称:gas-flow-meter,代码行数:14,代码来源:lcd.c
示例11: LCD_IO_WriteReg
/**
* @brief Writes command to select the LCD register.
* @param LCDReg: Address of the selected register.
* @retval None
*/
void LCD_IO_WriteReg(uint8_t LCDReg)
{
/* Reset LCD control line CS */
LCD_CS_LOW();
/* Set LCD data/command line DC to Low */
LCD_DC_LOW();
/* Send Command */
SPIx_Write(LCDReg);
/* Deselect : Chip Select high */
LCD_CS_HIGH();
}
开发者ID:cnoviello,项目名称:stm32-nucleof1,代码行数:19,代码来源:stm32f1xx_nucleo.c
示例12: LCD_IO_WriteData
/**
* @brief Writes data to select the LCD register.
* This function must be used after st7735_WriteReg() function
* @param Data: data to write to the selected register.
* @retval None
*/
void LCD_IO_WriteData(uint8_t Data)
{
/* Reset LCD control line CS */
LCD_CS_LOW();
/* Set LCD data/command line DC to High */
LCD_DC_HIGH();
/* Send Data */
SPIx_Write(Data);
/* Deselect : Chip Select high */
LCD_CS_HIGH();
}
开发者ID:birdyou,项目名称:Balance_Car_STM32,代码行数:20,代码来源:stm32f4xx_cannon_v2.c
示例13: LCD_IO_WriteReg
/**
* @brief register address.
* @param Reg
* @retval None
*/
void LCD_IO_WriteReg(uint8_t Reg)
{
/* Reset LCD control line(/CS) and Send command */
LCD_CS_LOW();
/* Send Start Byte */
SPIx_Write(START_BYTE | SET_INDEX);
/* Write 16-bit Reg Index (High Byte is 0) */
SPIx_Write(0x00);
SPIx_Write(Reg);
/* Deselect : Chip Select high */
LCD_CS_HIGH();
}
开发者ID:S4mw1s3,项目名称:Nucleo32,代码行数:20,代码来源:stm32l073z_eval.c
示例14: LCD_IO_WriteMultipleData
/**
* @brief Write register value.
* @param pData Pointer on the register value
* @param Size Size of byte to transmit to the register
* @retval None
*/
void LCD_IO_WriteMultipleData(uint8_t *pData, uint32_t Size)
{
uint32_t counter = 0;
__IO uint32_t data = 0;
/* Reset LCD control line(/CS) and Send data */
LCD_CS_LOW();
/* Send Start Byte */
SPIx_Write(START_BYTE | LCD_WRITE_REG);
if (Size == 1)
{
/* Only 1 byte to be sent to LCD - general interface can be used */
/* Send Data */
SPIx_Write(*pData);
}
else
{
for (counter = Size; counter != 0; counter--)
{
while(((heval_Spi.Instance->SR) & SPI_FLAG_TXE) != SPI_FLAG_TXE)
{
}
/* Need to invert bytes for LCD*/
*((__IO uint8_t*)&heval_Spi.Instance->DR) = *(pData+1);
while(((heval_Spi.Instance->SR) & SPI_FLAG_TXE) != SPI_FLAG_TXE)
{
}
*((__IO uint8_t*)&heval_Spi.Instance->DR) = *pData;
counter--;
pData += 2;
}
/* Wait until the bus is ready before releasing Chip select */
while(((heval_Spi.Instance->SR) & SPI_FLAG_BSY) != RESET)
{
}
}
/* Empty the Rx fifo */
data = *(&heval_Spi.Instance->DR);
UNUSED(data); /* Remove GNU warning */
/* Reset LCD control line(/CS) and Send data */
LCD_CS_HIGH();
}
开发者ID:S4mw1s3,项目名称:Nucleo32,代码行数:54,代码来源:stm32l073z_eval.c
示例15: LCDSend
void LCDSend(unsigned char data, unsigned char cd)
{
LCD_CS_LOW();
if (cd == SEND_CHR)
{
LCD_DC_HIGH();
}
else
{
LCD_DC_LOW();
}
// send data over SPI
SEND_BYTE_SPI();
LCD_CS_HIGH();
}
开发者ID:SleepyJack,项目名称:UEXT-MODULES,代码行数:18,代码来源:lcd3310_GPIO.c
示例16: LCD_SendByte
void LCD_SendByte(unsigned char a)
{
unsigned char i,d;
LCD_CS_HIGH();
LCD_SIO_OUT();
for(i=0;i<8;i++)
{
LCD_SCK_LOW(); //clrbit(LCD_CTRL,E);
d = a&0x80;
if(d)
LCD_SIO_HIGH(); //setbit(LCD_CTRL,RW);
else
LCD_SIO_LOW(); //clrbit(LCD_CTRL,RW);
a<<=1;
LCD_SCK_HIGH(); //setbit(LCD_CTRL,E); //上升弦发送
}
LCD_CS_LOW();
}
开发者ID:haoozi,项目名称:SIM900A-py,代码行数:18,代码来源:ST7920.c
示例17: SD_IO_Init
/**
* @brief Initializes the SD Card and put it into StandBy State (Ready for
* data transfer).
* @param None
* @retval None
*/
void SD_IO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
uint8_t counter;
/* SD_CS_GPIO Periph clock enable */
SD_CS_GPIO_CLK_ENABLE();
/* Configure SD_CS_PIN pin: SD Card CS pin */
GPIO_InitStruct.Pin = SD_CS_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(SD_CS_GPIO_PORT, &GPIO_InitStruct);
/* LCD chip select line perturbs SD also when the LCD is not used */
/* this is a workaround to avoid sporadic failures during r/w operations */
LCD_CS_GPIO_CLK_ENABLE();
GPIO_InitStruct.Pin = LCD_CS_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(LCD_CS_GPIO_PORT, &GPIO_InitStruct);
LCD_CS_HIGH();
/*------------Put SD in SPI mode--------------*/
/* SD SPI Config */
SPIx_Init();
/* SD chip select high */
SD_CS_HIGH();
/* Send dummy byte 0xFF, 10 times with CS high */
/* Rise CS and MOSI for 80 clocks cycles */
for (counter = 0; counter <= 9; counter++)
{
/* Send dummy byte 0xFF */
SD_IO_WriteByte(SD_DUMMY_BYTE);
}
}
开发者ID:PaxInstruments,项目名称:STM32CubeF2,代码行数:48,代码来源:stm32f2xx_nucleo_144.c
示例18: LCD_IO_Init
/**
* @brief Configures the LCD_SPI interface.
* @param None
* @retval None
*/
void LCD_IO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
/* Configure the LCD Control pins ------------------------------------------*/
LCD_NCS_GPIO_CLK_ENABLE();
/* Configure NCS in Output Push-Pull mode */
GPIO_InitStruct.Pin = LCD_NCS_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW ;
HAL_GPIO_Init(LCD_NCS_GPIO_PORT, &GPIO_InitStruct);
/* Set or Reset the control line */
LCD_CS_LOW();
LCD_CS_HIGH();
SPIx_Init();
}
开发者ID:S4mw1s3,项目名称:Nucleo32,代码行数:25,代码来源:stm32l073z_eval.c
示例19: LCD_IO_Init
/**
* @brief Configures the LCD_SPI interface.
*/
void LCD_IO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
if(Is_LCD_IO_Initialized == 0)
{
Is_LCD_IO_Initialized = 1;
/* Configure NCS in Output Push-Pull mode */
LCD_WRX_GPIO_CLK_ENABLE();
GPIO_InitStructure.Pin = LCD_WRX_PIN;
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Speed = GPIO_SPEED_FAST;
HAL_GPIO_Init(LCD_WRX_GPIO_PORT, &GPIO_InitStructure);
LCD_RDX_GPIO_CLK_ENABLE();
GPIO_InitStructure.Pin = LCD_RDX_PIN;
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Speed = GPIO_SPEED_FAST;
HAL_GPIO_Init(LCD_RDX_GPIO_PORT, &GPIO_InitStructure);
/* Configure the LCD Control pins ----------------------------------------*/
LCD_NCS_GPIO_CLK_ENABLE();
/* Configure NCS in Output Push-Pull mode */
GPIO_InitStructure.Pin = LCD_NCS_PIN;
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Speed = GPIO_SPEED_FAST;
HAL_GPIO_Init(LCD_NCS_GPIO_PORT, &GPIO_InitStructure);
/* Set or Reset the control line */
LCD_CS_LOW();
LCD_CS_HIGH();
SPIx_Init();
}
}
开发者ID:bresch,项目名称:STM32F29Discovery_Hello_World_SW4_IDE,代码行数:43,代码来源:stm32f429i_discovery.c
示例20: SD_IO_Init
/**
* @brief Initializes the SD Card and put it into StandBy State (Ready for
* data transfer).
* @param None
* @retval None
*/
void SD_IO_Init(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
uint8_t counter;
/* SD_CS_GPIO Periph clock enable */
SD_CS_GPIO_CLK_ENABLE();
/* Configure SD_CS_PIN pin: SD Card CS pin */
GPIO_InitStruct.Pin = SD_CS_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(SD_CS_GPIO_PORT, &GPIO_InitStruct);
/* Configure LCD_CS_PIN pin: LCD Card CS pin */
GPIO_InitStruct.Pin = LCD_CS_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(SD_CS_GPIO_PORT, &GPIO_InitStruct);
LCD_CS_HIGH();
/*------------Put SD in SPI mode--------------*/
/* SD SPI Config */
SPIx_Init();
/* SD chip select high */
SD_CS_HIGH();
/* Send dummy byte 0xFF, 10 times with CS high */
/* Rise CS and MOSI for 80 clocks cycles */
for (counter = 0; counter <= 9; counter++)
{
/* Send dummy byte 0xFF */
SD_IO_WriteByte(SD_DUMMY_BYTE);
}
}
开发者ID:jecaille,项目名称:package_hal_L0,代码行数:45,代码来源:stm32l0xx_nucleo.c
注:本文中的LCD_CS_HIGH函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论