Beispiel #1
0
void main(void)
{
  /* disable all interrupts before peripherals are initialized */
  __disable_irq();
  
  /* init application ports */  
  InitPORT();  
  InitPWM();    
  InitADC();
  //Init_PIT();
  
  int i = 0;
  for(i = 0; i < 1000; i++){};
  ADC_WR_CTRL1_START0(ADC, 1);
    
  /* LED for test */ 
  PORT_WR_PCR_MUX(PORTB, 22, 1); 
  GPIO_SET_PDDR(PTB, 1<<22);
  GPIO_WR_PSOR(PTB, 1<<22);

  /* enable interrupts  */
  __enable_irq();

  /* infinite loop */
  while(1){}
}
/*FUNCTION**********************************************************************
 *
 * Function Name : GPIO_HAL_WritePinOutput
 * Description   : Set output level of individual gpio pin to logic 1 or 0.
 *
 *END**************************************************************************/
void GPIO_HAL_WritePinOutput(GPIO_Type * base, uint32_t pin, uint32_t output)
{
    assert(pin < 32);

    if (output != 0U)
    {
        GPIO_WR_PSOR(base, 1U << pin); /* Set pin output to high level.*/
    }
    else
    {
        GPIO_WR_PCOR(base, 1U << pin); /* Set pin output to low level.*/
    }
}
Beispiel #3
0
void PWMA_RERR_IRQHandler(void)
{
  GPIO_WR_PSOR(PTB, 1<<22);
}