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 |
Configure serial console.
References uart_rs232_options::baudrate, and stdio_serial_init().
Referenced by main().
int main | ( | void | ) |
The main function.
References board_init(), BOARD_NAME, CMCC_BASE, cmcc_enable(), cmcc_get_config_defaults(), cmcc_get_monitor_cnt(), cmcc_init(), configure_console(), FIBONACCI_NUM, g_cmcc_cfg, recfibo(), and sysclk_init().
|
static |
Recursively calculate the nth Fibonacci number.
n | Indicates which (positive) Fibonacci number to compute. |
Referenced by main().
struct cmcc_config g_cmcc_cfg |
CMCC configuration.