Пример #1
0
/*----------------------------------------------------------------------------*/
void pinInput(struct Pin pin)
{
  LPC_GPIO_Type * const reg = calcPort(pin.data);

  commonPinInit(pin);
  reg->DIR &= ~(1 << pin.data.offset);
}
Пример #2
0
/*----------------------------------------------------------------------------*/
void pinOutput(struct Pin pin, bool value)
{
  LPC_GPIO_Type * const reg = calcPort(pin.data);

  commonPinInit(pin);
  reg->DIR |= 1 << pin.data.offset;
  pinWrite(pin, value);
}
Пример #3
0
Файл: pin.c Проект: stxent/halm
/*----------------------------------------------------------------------------*/
void pinOutput(struct Pin pin, bool value)
{
  commonPinInit(pin);
  ((LPC_GPIO_Type *)pin.reg)->DIR |= 1UL << pin.data.offset;
  pinWrite(pin, value);
}
Пример #4
0
Файл: pin.c Проект: stxent/halm
/*----------------------------------------------------------------------------*/
void pinInput(struct Pin pin)
{
  commonPinInit(pin);
  ((LPC_GPIO_Type *)pin.reg)->DIR &= ~(1UL << pin.data.offset);
}