Esempio n. 1
0
/**
  @brief Port initialization

  @return none

**/
static void Port_Init(void)
{
   if (GPIO_PINS == GPIO0) { /* Check if Port 0 is tested as GPIO */
      DioCfg(pADI_GP0, 0x4000);     /* Port 0 configured to GPIO */
      DioPul(pADI_GP0, 0);        /* Disables all pull-up resistors */
      DioOen(pADI_GP0, 0xFF);       /* Sets Port 0 to be outputs */
      DioClr(pADI_GP0, 0xFF);       /* Clear Port 0 outputs */

   } else if (GPIO_PINS == GPIO1) { /* Check if Port 1 is tested as GPIO */
      DioCfg(pADI_GP1, 0x0000);     /* Port 1 configured to GPIO */
      DioPul(pADI_GP1, 0);        /* Disables all pull-up resistors */
      DioOen(pADI_GP1, 0xFF);       /* Sets Port 1 to be outputs */
      DioClr(pADI_GP1, 0xFF);       /* Clear Port 1 outputs */

   } else if (GPIO_PINS == GPIO2) { /* Check if Port 2 is tested as GPIO */
      DioCfg(pADI_GP2, 0xAA80);     /* Port 2 configured to GPIO */
      DioPul(pADI_GP2, 0);        /* Disables all pull-up resistors */
      DioOen(pADI_GP2, 0x07);       /* Sets Port 2 to be outputs */
      DioClr(pADI_GP2, 0x07);       /* Clear Port 2 outputs */
   }
}
Esempio n. 2
0
//p1.4   config pin gpio 
static void _pwm_heat_pins_disable(void)
{
    pADI_GP1->GPCON = ((pADI_GP1->GPCON)&(~(BIT8|BIT9)));
    DioOen(pADI_GP1, (pADI_GP1->GPOEN)|BIT(4));
}
Esempio n. 3
0
//p1.2
static void _pwm_rhref_pins_disable(void)
{
    pADI_GP1->GPCON = ((pADI_GP1->GPCON)&(~(BIT4|BIT5)));
    DioOen(pADI_GP1,(pADI_GP1->GPOEN)|BIT(2));
}
/*
* inicializovanie portu na ktorom je pripojena user specified led
*/
void led_init(void) {
    // P4.2  as output
    DioCfg(pADI_GP4,0x10);
    DioOen(pADI_GP4, BIT2);
}