MotorControlModuleSDFM_TMS3.../Projects/epwm_test/src/init_perif.c

103 lines
1.9 KiB
C
Raw Blame History

/*
* init_perif.c
*
* Created on: 21 <20><><EFBFBD>. 2023 <20>.
* Author: seklyuts
*/
#include "pwm_init.h"
#include "f28x_project.h"
#include "pwm_interrupts.h"
#include "sdfm.h"
#include "f2838x_sdfm_drivers.h"
#include "gpio_init.h"
#include "spi_init.h"
#include "i2c_init.h"
#include "frm_uart.h"
#include "BL25CM1A.h"
#include "GD25Q16ETIGR.h"
#include "ZD24C02A.h"
#include "vector.h"
#include "adc_init.h"
#include "biss.h"
void InitPerif(void)
{
GpioDiodInit();
GpioSetGreen();
EALLOW;
ClkCfgRegs.CLKSEM.bit.SEM = 0x1;
ClkCfgRegs.LOSPCP.bit.LSPCLKDIV = 2;
EDIS;
InitSysCtrl();
GpioSetBlue();
// Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;
//
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the f2838x_piectrl.c file.
//
InitPieCtrl();
//
// Disable CPU interrupts and clear all CPU interrupt flags:
//
IER = 0x0000;
IFR = 0x0000;
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table, even if the interrupt
// is not used in this example. This is useful for debug purposes.
// The shell ISR routines are found in f2838x_defaultisr.c.
// This function is found in f2838x_pievect.c.
//
InitPieVectTable();
GpioInit();
SdfmInitEnable();
SdfmInit();
SdfmGpioInit();
SdfmInitInterruptEn();
PWMInitEnable();
PWMAllInit();
PWMGpioInit();
PWMInitInterruptEn();
vectorInitCurrLoop();
SpiCInit();
SpiCGpioInit();
BissGpioInit();
BissInit();
FRMUartInit();
// ConfigureADC();
//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
}