Esempio n. 1
0
/*---------------------------------------------------------------------------*/
void
leds_arch_set(unsigned char leds)
{
  if (leds & LEDS_GREEN)
    {
      GPIOB_PSOR = GPIO_PSOR_PTSO(0x00080000);
    }
  else
    {
      GPIOB_PCOR |= GPIO_PCOR_PTCO(0x00080000);
    }
  if (leds & LEDS_RED)
    {
      GPIOB_PSOR = GPIO_PSOR_PTSO(0x00040000);
    }
  else
    {
      GPIOB_PCOR |= GPIO_PCOR_PTCO(0x00040000);
    }
  if (leds & LEDS_BLUE)
    {
      GPIOD_PSOR = GPIO_PSOR_PTSO(0x02);
    }
  else
    {
      GPIOD_PCOR |= GPIO_PCOR_PTCO(0x02);
    }
}
Esempio n. 2
0
/*
** ===================================================================
**     Method      :  PTC_Init (component Init_GPIO)
**     Description :
**         This method initializes registers of the GPIO module
**         according to the Peripheral Initialization settings.
**         Call this method in user code to initialize the module. By
**         default, the method is called by PE automatically; see "Call
**         Init method" property of the component for more details.
**     Parameters  : None
**     Returns     : Nothing
** ===================================================================
*/
void PTC_Init(void)
{
  /* GPIOC_PSOR: PTSO|=0x10 */
  GPIOC_PSOR |= GPIO_PSOR_PTSO(0x10);
  /* GPIOC_PCOR: PTCO&=~0x10 */
  GPIOC_PCOR &= (uint32_t)~(uint32_t)(GPIO_PCOR_PTCO(0x10));
  /* GPIOC_PDDR: PDD&=~0x62,PDD|=0x10 */
  GPIOC_PDDR = (uint32_t)((GPIOC_PDDR & (uint32_t)~(uint32_t)(
                GPIO_PDDR_PDD(0x62)
               )) | (uint32_t)(
                GPIO_PDDR_PDD(0x10)
               ));
}
Esempio n. 3
0
void display_7segments_displayOff(display_position_e eDispPos)
{
	// Disables display cDispNum
	switch(eDispPos)
	{
		case DS1:
			GPIOC_PCOR = GPIO_PCOR_PTCO(DS1_EN_PIN);
			break;
		case DS2:
			GPIOC_PCOR = GPIO_PCOR_PTCO(DS2_EN_PIN);
			break;
		case DS3:
			GPIOC_PCOR = GPIO_PCOR_PTCO(DS3_EN_PIN);
			break;
		case DS4:
			GPIOC_PCOR = GPIO_PCOR_PTCO(DS4_EN_PIN);
			break;
		case ALL:
			GPIOC_PCOR = GPIO_PCOR_PTCO(DS1_EN_PIN | DS2_EN_PIN | DS3_EN_PIN | DS4_EN_PIN);
			break;
	}
}