3.1 System Driver

3.1.1 Introduction

Overview

System Driver is used to initialize various System drivers like Clock, Pin, Interrupt and other Peripheral Drivers which are added to the Project. Initialization is done through SYSTEM_Initialize function which in turn calls the initialization function of all the drivers added in the project. Application(main.c) should call SYSTEM_Initialize.

3.1.2 Module Documentation

3.1.2.1 System Driver

System driver using dsPIC MCUs.

3.1.2.1.1 Module description

System driver using dsPIC MCUs.

3.1.2.1.1.2 Functions

3.1.2.1.2 Function Documentation

3.1.2.1.2.1 SYSTEM_CORCONInitialize()

inline static void SYSTEM_CORCONInitialize ( )

Initializes the CPU core control register.

Parameters:
none
Returns:

none

3.1.2.1.2.2 SYSTEM_CORCONModeOperatingSet()

inline static void SYSTEM_CORCONModeOperatingSet (SYSTEM_CORCON_MODES modeValue)

This inline function sets the CPU core control register operating mode to a value that is decided by the SYSTEM_CORCON_MODES argument.

Parameters:
in modeValue

- SYSTEM_CORCON_MODES initialization mode specifier

Returns:

none

3.1.2.1.2.3 SYSTEM_CORCONRegisterValueGet()

inline static uint16_t SYSTEM_CORCONRegisterValueGet (void )

This inline function gets the value of CPU core control register.

Parameters:
none
Returns:

value of the CPU core control register

3.1.2.1.2.4 SYSTEM_CORCONRegisterValueSet()

inline static void SYSTEM_CORCONRegisterValueSet (uint16_t value)

This inline function sets the value of CPU core control register.

Parameters:
in value

- value that needs to be written to the CPU core control register

Returns:

none

3.1.2.1.2.5 SYSTEM_DeviceIdRegisterAddressGet()

inline static uint32_t SYSTEM_DeviceIdRegisterAddressGet (void )

This inline function gets the base address of the DEVID register for the currently selected device.

Parameters:
none
Returns:

base address of the DEVID register

3.1.2.1.2.6 SYSTEM_Initialize()

void SYSTEM_Initialize (void )

Initializes the System module.

Parameters:
none
Returns:

none

3.1.2.1.3 Enumeration Type Documentation

3.1.2.1.3.1 CORCON_MODE_TYPE

enum CORCON_MODE_TYPE

CORCON initialization type enumerator.

Section: Type defines

CORCON_MODE_PORVALUES

Use POR values of CORCON

CORCON_MODE_ENABLEALLSATNORMAL_ROUNDBIASED

Enable saturation for ACCA, ACCB and Dataspace write, enable normal ACCA/ACCB saturation mode and set rounding to Biased (conventional) mode. Rest of CORCON settings are set to the default POR values.

CORCON_MODE_ENABLEALLSATNORMAL_ROUNDUNBIASED

Enable saturation for ACCA, ACCB and Dataspace write, enable normal ACCA/ACCB saturation mode and set rounding to Unbiased (convergent) mode. Rest of CORCON settings are set to the default POR values.

CORCON_MODE_DISABLEALLSAT_ROUNDBIASED

Disable saturation for ACCA, ACCB and Dataspace write and set rounding to Biased (conventional) mode. Rest of CORCON settings are set to the default POR values.

CORCON_MODE_DISABLEALLSAT_ROUNDUNBIASED

Disable saturation for ACCA, ACCB and Dataspace write and set rounding to Unbiased (convergent) mode. Rest of CORCON settings are set to the default POR values.

CORCON_MODE_ENABLEALLSATSUPER_ROUNDBIASED

Enable saturation for ACCA, ACCB and Dataspace write, enable super ACCA/ACCB saturation mode and set rounding to Biased (conventional) mode. Rest of CORCON settings are set to the default POR values.

CORCON_MODE_ENABLEALLSATSUPER_ROUNDUNBIASED

Enable saturation for ACCA, ACCB and Dataspace write, enable super ACCA/ACCB saturation mode and set rounding to Unbiased (convergent) mode. Rest of CORCON settings are set to the default POR values.

3.1.3 File Documentation

3.1.3.1 source/system.h File Reference

#include "xc.h"
#include "stdint.h"
#include "system_types.h"

3.1.3.1.1 Functions

3.1.3.1.3 Detailed Description

MAIN Generated Driver Header File

3.1.3.1.4 Macro Definition Documentation

3.1.3.1.4.1 SYSTEM_H

#define SYSTEM_H

3.1.3.2 source/system_types.h File Reference

This is the generated driver types header file for the System driver.

3.1.3.2.3 Detailed Description

This is the generated driver types header file for the System driver.

MAIN Generated Driver Types Header File

3.1.3.2.4 Typedef Documentation

3.1.3.2.4.1 SYSTEM_CORCON_MODES

typedef enum CORCON_MODE_TYPE SYSTEM_CORCON_MODES