Microchip® Advanced Software Framework

sleepmgr_example_megarf.c File Reference

Sleep manager example for MegaRF.

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

#include <asf.h>
#include "conf_example.h"

Functions

 ISR (BUTTON_vect)
 
int main (void)
 Main function. More...
 

ISR ( BUTTON_vect  )

References delay_ms, and ioport_get_pin_level().

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.

Returns
Nothing.

Main function.

Main function.

Initializes the clock system, board and serial output, then sets up the Sleep Manager unit test suite and runs it.

The SAM3X_EK, SAM3X Arduino board and SAM4C_EK use two bytes length internal address EEPROM.

References board_init(), delay_init, delay_ms, Enable_global_interrupt, ioport_init(), ioport_set_pin_sense_mode(), LED_Off, LED_On, SLEEPMGR_ACTIVE, sleepmgr_enter_sleep(), sleepmgr_init(), sleepmgr_lock_mode(), SLEEPMGR_NR_OF_MODES, sleepmgr_unlock_mode(), sysclk_get_cpu_hz(), and sysclk_init().