Exemplo n.º 1
0
uint16_t tc_write_rc(volatile avr32_tc_t *tc, unsigned int channel, uint16_t value)
{
  // Check for valid input.
  if (channel >= TC_NUMBER_OF_CHANNELS)
    return TC_INVALID_ARGUMENT;

  // This function is only available in WAVEFORM mode.
  if (Tst_bits(tc->channel[channel].cmr, AVR32_TC_WAVE_MASK))
    Wr_bitfield(tc->channel[channel].rc, AVR32_TC_RC_MASK, value);

  return value;
}
Exemplo n.º 2
0
//!
//! This function returns a free navigator id.
//!
//! @return long : Id navigator allocated or -1 if none free
//!
long fsaccess_alloc_nav_id( void )
{
    unsigned int j;
    // get a free nav id
    // NOTE: we start at FS_NB_RESERVED_NAV, because 2 is usually used as
    // the navigator for file copy. 0 & 1 may be used independently of the fsaccess module.
    for (j = FS_NB_RESERVED_NAV ; j < FS_NB_NAVIGATOR ; j++)
    {
        if (!Tst_bits(pvNavUsed, (1 << j)))
        {
            Set_bits(pvNavUsed, (1 << j));
            return (j);
        }
    }
    // no nav free for now
    return(-1);
}
Exemplo n.º 3
0
Arquivo: led.c Projeto: InSoonPark/asf
bool LED_Test(U32 leds)
{
  return Tst_bits(LED_State, leds);
}
Exemplo n.º 4
0
Arquivo: led.c Projeto: Mazetti/asf
bool LED_Test(uint32_t leds)
{
  return Tst_bits(LED_State, leds);
}