4.4 CPU - Central Processor Unit

4.4.1 Introduction

The MPLAB® Code Configurator (MCC) Melody Central Processing Unit (CPU) system driver generates APIs to support CPU-specific peripheral functionality on ATmegaxxx target MCUs.

The main function of the CPU core is to ensure correct program execution. The CPU must therefore be able to access memories, perform calculations, control peripherals, and handle interrupts

4.4.2 Supported Device Families

ATmega32x

4.4.3 Required Included Files

#include "mcc_generated_files/system/src/cpu.c"

4.4.4 Module Documentation

4.4.4.1 CPU

This file contains the API Prototypes for the CPU driver.

4.4.4.1.1 Module description

This file contains the API Prototypes for the CPU driver.

Version: CPU Driver Version 1.0.0
Definitions
  • #define F_CPU 8000000

    Defines the system clock frequency.

4.4.4.1.2 Definition Documentation

F_CPU

#define F_CPU 8000000

Defines the system clock frequency.

4.4.4.1.3 Function Documentation

CPU_DisableSleep()

void CPU_DisableSleep (void )

Disables Sleep mode.

Parameters:
None.
Returns:

None.

CPU_EnableLowPower()

void CPU_EnableLowPower (void )

Enables Low-Power and disables all the peripherals. The driver will enable the peripherals when needed.

Parameters:
None.
Returns:

None.

CPU_EnableSleep()

void CPU_EnableSleep (void )

Enables Sleep mode for power management.

Parameters:
None.
Returns:

None.

CPU_Initialize()

void CPU_Initialize (void )

Initializes the CPU module.

Parameters:
None.
Returns:

None.

CPU_SetSleepMode()

void CPU_SetSleepMode (uint8_t mode)

Sets Sleep mode.

Parameters:
uint8_t

mode - Sleep mode for CPU.

Returns:

None.

4.4.5 File Documentation

4.4.5.1 source/cpu.c File Reference

This file contains the API implemenatation for the CPU driver.

#include <avr/io.h>
#include "../cpu.h"

4.4.5.1.2 Detailed Description

This file contains the API implemenatation for the CPU driver.

CPU Generated Driver File

Version: CPU Driver Version 1.0.0

4.4.5.2 source/cpu.h File Reference

4.4.5.2.2 Macros

  • #define F_CPU 8000000

    Defines the system clock frequency.

4.4.5.2.3 Detailed Description

CPU Generated Driver API Header File