Ejemplo n.º 1
0
/*
 *  This routine read multiple bytes from display controller using SPI bus,
 *  with A0 = 1.
 *
 */
void GUI_SEGGERLIBRARY_ReadMultipleBytes(uint8_t *data, int numitems)
{
#if (!USER_DEFINED_LCD && SPI_INTERFACE == 1)
  XMC_GPIO_SetOutputHigh(IOHandle.portNo,IOHandle.pinNo);
#endif

  SPI_MASTER_Receive(&SPI_INSTANCE, data, numitems);
}
Ejemplo n.º 2
0
/*
 *  This routine writes to display controller using SPI bus, with A0 = 1
 *
 */
void GUI_SEGGERLIBRARY_WriteDataByte(uint8_t data)
{
#if (!USER_DEFINED_LCD && SPI_INTERFACE == 1)
    /* Set the A0 pin*/
  XMC_GPIO_SetOutputHigh(IOHandle.portNo,IOHandle.pinNo);
#endif

  XMC_SPI_CH_EnableSlaveSelect(SPI_INSTANCE.channel, SPI_INSTANCE.config->slave_select_pin_config[0]->slave_select_ch);

  GUI_SEGGERLIBRARY_SendByte(data);

  XMC_SPI_CH_DisableSlaveSelect(SPI_INSTANCE.channel);
}
Ejemplo n.º 3
0
/*
 *  This routine writes multiple bytes to display controller using SPI bus,
 *  with A0 = 1.
 *
 */
void GUI_SEGGERLIBRARY_WriteMultipleBytes(uint8_t *data, int numitems)
{
  uint8_t datacopy;

#if (!USER_DEFINED_LCD && SPI_INTERFACE == 1)
  /* Set the A0 pin*/
  XMC_GPIO_SetOutputHigh(IOHandle.portNo,IOHandle.pinNo);
#endif

  XMC_SPI_CH_EnableSlaveSelect(SPI_INSTANCE.channel, SPI_INSTANCE.config->slave_select_pin_config[0]->slave_select_ch);

  do
  {
    datacopy = *data;
    GUI_SEGGERLIBRARY_SendByte(datacopy);
	data++;
  }while(--numitems);

  XMC_SPI_CH_DisableSlaveSelect(SPI_INSTANCE.channel);
}
Ejemplo n.º 4
0
void _error()
{
	XMC_GPIO_SetOutputHigh(LED_ERROR);
	while (1 == 1)
		;
}