Microchip® Advanced Software Framework

tc_timeout_example1.c File Reference

megaAVR Timer/Counter (TC) Timeout Driver Example 1

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "tc_timeout.h"

Macros

#define LED0_MASK   (1 << 0)
 
#define LED1_MASK   (1 << 1)
 

Enumerations

enum  {
  EXAMPLE_TIMEOUT_SLOW,
  EXAMPLE_TIMEOUT_FAST
}
 

Functions

int main (void)
 
static void toggle_led (uint8_t mask)
 Toggle LED. More...
 

#define LED0_MASK   (1 << 0)

Referenced by main().

#define LED1_MASK   (1 << 1)

Referenced by main().

anonymous enum
Enumerator
EXAMPLE_TIMEOUT_SLOW 
EXAMPLE_TIMEOUT_FAST 

static void toggle_led ( uint8_t  mask)
inlinestatic

Toggle LED.

Newer megaAVR devices can toggle a I/O pin by writing to PIN register, while on older ones this needs to be done by a read-modify-write operation. This function abstract these differences.

Parameters
maskMask of port LEDs to toggle

Referenced by main().