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.1 Enumerations
enum CORCON_MODE_TYPE { CORCON_MODE_PORVALUES = 0x0020, CORCON_MODE_ENABLEALLSATNORMAL_ROUNDBIASED = 0x00E2, CORCON_MODE_ENABLEALLSATNORMAL_ROUNDUNBIASED = 0x00E0, CORCON_MODE_DISABLEALLSAT_ROUNDBIASED = 0x0022, CORCON_MODE_DISABLEALLSAT_ROUNDUNBIASED = 0x0020, CORCON_MODE_ENABLEALLSATSUPER_ROUNDBIASED = 0x00F2, CORCON_MODE_ENABLEALLSATSUPER_ROUNDUNBIASED = 0x00F0 }
CORCON initialization type enumerator.
3.1.2.1.1.2 Functions
void SYSTEM_Initialize (void)
Initializes the System module.
static void SYSTEM_CORCONInitialize ()
Initializes the CPU core control register.
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.
static void SYSTEM_CORCONRegisterValueSet (uint16_t value)
This inline function sets the value of CPU core control register.
static uint16_t SYSTEM_CORCONRegisterValueGet (void)
This inline function gets the value of CPU core control register.
static uint32_t SYSTEM_DeviceIdRegisterAddressGet (void)
This inline function gets the base address of the DEVID register for the currently selected device.
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.
none |
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.
in | modeValue |
- SYSTEM_CORCON_MODES initialization mode specifier |
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.
none |
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.
in | value |
- value that needs to be written to the CPU core control register |
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.
none |
base address of the DEVID register |
3.1.2.1.2.6 SYSTEM_Initialize()
void SYSTEM_Initialize (void )
Initializes the System module.
none |
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
void SYSTEM_Initialize (void)
Initializes the System module.
static void SYSTEM_CORCONInitialize ()
Initializes the CPU core control register.
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.
static void SYSTEM_CORCONRegisterValueSet (uint16_t value)
This inline function sets the value of CPU core control register.
static uint16_t SYSTEM_CORCONRegisterValueGet (void)
This inline function gets the value of CPU core control register.
static uint32_t SYSTEM_DeviceIdRegisterAddressGet (void)
This inline function gets the base address of the DEVID register for the currently selected device.
3.1.3.1.2 Macros
#define SYSTEM_H
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.1 Typedefs
typedef enum CORCON_MODE_TYPE SYSTEM_CORCON_MODES
3.1.3.2.2 Enumerations
enum CORCON_MODE_TYPE { CORCON_MODE_PORVALUES = 0x0020, CORCON_MODE_ENABLEALLSATNORMAL_ROUNDBIASED = 0x00E2, CORCON_MODE_ENABLEALLSATNORMAL_ROUNDUNBIASED = 0x00E0, CORCON_MODE_DISABLEALLSAT_ROUNDBIASED = 0x0022, CORCON_MODE_DISABLEALLSAT_ROUNDUNBIASED = 0x0020, CORCON_MODE_ENABLEALLSATSUPER_ROUNDBIASED = 0x00F2, CORCON_MODE_ENABLEALLSATSUPER_ROUNDUNBIASED = 0x00F0 }
CORCON initialization type enumerator.
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