megaAVR Timer/Counter (TC) Timeout Driver Example 1
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | LED0_MASK (1 << 0) |
#define | LED1_MASK (1 << 1) |
Enumerations | |
enum | { EXAMPLE_TIMEOUT_SLOW, EXAMPLE_TIMEOUT_FAST } |
Functions | |
int | main (void) |
Main function. More... | |
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().
int main | ( | void | ) |
Main function.
Main function.
This function initializes the MAC, initiates a MLME reset request (wpan_mlme_reset_req()), and implements a the main loop.
Main function.
The master example begins by initializing required board resources. The system clock, basic GPIO pin mapping, and interrupt vectors are established.
A memory location on a TWI slave is written with a fixed test pattern which is then read back into a separate buffer. As a basic sanity check, the original write-buffer values are compared with values read from the slave to a separate buffer. An LED on the development board is illuminated when there is a match between the written and read data.
Main function.
Main function.
Initializes the clock system, board and serial output, then sets up the Sleep Manager unit test suite and runs it.
Main function.
Initializes the clock system, board and serial output, then sets up the IOPORT Service unit test suite and runs it.
The SAM3X_EK, SAM3X Arduino board and SAM4C_EK use two bytes length internal address EEPROM.
References EXAMPLE_TIMEOUT_FAST, EXAMPLE_TIMEOUT_SLOW, LED0_MASK, LED1_MASK, tc_timeout_init(), tc_timeout_start_periodic(), tc_timeout_test_and_clear_expired(), TC_TIMEOUT_TICK_HZ, and toggle_led().
|
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.
mask | Mask of port LEDs to toggle |
Referenced by main().