Microchip® Advanced Software Framework

cmcc_example.c File Reference

CMCC example for SAM.

This file defines a useful set of functions for the CMCC on SAM devices.

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

#include <asf.h>

Macros

#define CMCC_BASE   CMCC
 Define CMCC Base. More...
 
#define FIBONACCI_NUM   30
 Fibonacci number. More...
 

Functions

static void configure_console (void)
 Configure serial console. More...
 
int main (void)
 The main function. More...
 
static uint32_t recfibo (uint32_t n)
 Recursively calculate the nth Fibonacci number. More...
 

Variables

struct cmcc_config g_cmcc_cfg
 CMCC configuration. More...
 

#define CMCC_BASE   CMCC

Define CMCC Base.

Referenced by main().

#define FIBONACCI_NUM   30

Fibonacci number.

Referenced by main().

static void configure_console ( void  )
static

Configure serial console.

References uart_rs232_options::baudrate, CONF_UART, CONF_UART_BAUDRATE, CONF_UART_PARITY, and stdio_serial_init().

Referenced by main().

static uint32_t recfibo ( uint32_t  n)
static

Recursively calculate the nth Fibonacci number.

Parameters
nIndicates which (positive) Fibonacci number to compute.
Returns
The nth Fibonacci number.

Referenced by main().

struct cmcc_config g_cmcc_cfg

CMCC configuration.

Referenced by main().