добавлены новые файлы
This commit is contained in:
parent
a4a29dd929
commit
6d0905983f
@ -62,7 +62,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE.2084039298" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE" valueType="definedSymbols">
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE.2084039298" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.C2000_22.6.compilerID.DEFINE" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="${COM_TI_C2000WARE_SOFTWARE_PACKAGE_SYMBOLS}"/>
|
<listOptionValue builtIn="false" value="${COM_TI_C2000WARE_SOFTWARE_PACKAGE_SYMBOLS}"/>
|
||||||
<listOptionValue builtIn="false" value="FREEMASTER"/>
|
<listOptionValue builtIn="false" value="NFREEMASTER"/>
|
||||||
<listOptionValue builtIn="false" value="NRS485"/>
|
<listOptionValue builtIn="false" value="NRS485"/>
|
||||||
<listOptionValue builtIn="false" value="REF1"/>
|
<listOptionValue builtIn="false" value="REF1"/>
|
||||||
<listOptionValue builtIn="false" value="USE_25MHZ_XTAL"/>
|
<listOptionValue builtIn="false" value="USE_25MHZ_XTAL"/>
|
||||||
|
|||||||
Binary file not shown.
100
Projects/epwm_test_biss_c_cpu2/src/SyncPWMFonRun.c
Normal file
100
Projects/epwm_test_biss_c_cpu2/src/SyncPWMFonRun.c
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
/*
|
||||||
|
* SyncPWMFonRun.c
|
||||||
|
*
|
||||||
|
* Created on: 4 сент. 2024 г.
|
||||||
|
* Author: seklyuts
|
||||||
|
*/
|
||||||
|
#include "f28x_project.h"
|
||||||
|
#include "frmmstr_run.h"
|
||||||
|
#include "init_perif.h"
|
||||||
|
#include "gpio_init.h"
|
||||||
|
#include "fault.h"
|
||||||
|
#include "i2c_oled.h"
|
||||||
|
#include "buttons.h"
|
||||||
|
#include "eqep.h"
|
||||||
|
#include "SyncPWMFonRun.h"
|
||||||
|
|
||||||
|
volatile uint16_t counter=0 ;
|
||||||
|
volatile uint16_t counter1=0 ;
|
||||||
|
volatile uint16_t counter2=0 ;
|
||||||
|
|
||||||
|
volatile uint16_t testMode = 0;
|
||||||
|
|
||||||
|
uint16_t BisscPwrOn = 1;
|
||||||
|
uint16_t BrakeOn = 0;
|
||||||
|
|
||||||
|
void SyncPWMFonRun(void)
|
||||||
|
{
|
||||||
|
static uint16_t diod = 0;
|
||||||
|
|
||||||
|
if(SynchPWMFonRunEnable())
|
||||||
|
{
|
||||||
|
#ifdef FREEMASTER
|
||||||
|
frmmstr_run();
|
||||||
|
#endif
|
||||||
|
SynchPWMFonRunEnableClr();
|
||||||
|
if(counter < 100) counter++;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
counter = 0;
|
||||||
|
if(counter1 < 100) counter1++;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
counter1=0;
|
||||||
|
counter2++;
|
||||||
|
diod++;
|
||||||
|
if(diod > 7) diod = 0;
|
||||||
|
Gpio_rainbow(diod);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(BisscPwrOn)
|
||||||
|
{
|
||||||
|
GpioDataRegs.GPADAT.bit.GPIO21 = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GpioDataRegs.GPADAT.bit.GPIO21 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(BrakeOn)
|
||||||
|
{
|
||||||
|
GpioDataRegs.GPADAT.bit.GPIO14 = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GpioDataRegs.GPADAT.bit.GPIO14 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(fault_read_check())
|
||||||
|
{
|
||||||
|
fault_read_clr();
|
||||||
|
fault_read_ports();
|
||||||
|
}else{
|
||||||
|
buttonsDisp();
|
||||||
|
ScreenDisp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint16_t SynchPWMFonRunEn = 0;
|
||||||
|
|
||||||
|
|
||||||
|
uint16_t SynchPWMFonRunEnable(void)
|
||||||
|
{
|
||||||
|
return SynchPWMFonRunEn;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SynchPWMFonRunEnableClr(void)
|
||||||
|
{
|
||||||
|
SynchPWMFonRunEn = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SynchPWMFonRunEnableSet(void)
|
||||||
|
{
|
||||||
|
SynchPWMFonRunEn = 1;
|
||||||
|
}
|
||||||
16
Projects/epwm_test_biss_c_cpu2/src/SyncPWMFonRun.h
Normal file
16
Projects/epwm_test_biss_c_cpu2/src/SyncPWMFonRun.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* SyncPWMFonRun.h
|
||||||
|
*
|
||||||
|
* Created on: 4 сент. 2024 г.
|
||||||
|
* Author: seklyuts
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRC_SYNCPWMFONRUN_H_
|
||||||
|
#define SRC_SYNCPWMFONRUN_H_
|
||||||
|
|
||||||
|
void SyncPWMFonRun(void);
|
||||||
|
uint16_t SynchPWMFonRunEnable(void);
|
||||||
|
void SynchPWMFonRunEnableClr(void);
|
||||||
|
void SynchPWMFonRunEnableSet(void);
|
||||||
|
|
||||||
|
#endif /* SRC_SYNCPWMFONRUN_H_ */
|
||||||
78
Projects/epwm_test_biss_c_cpu2/src/uart_4Mbit.c
Normal file
78
Projects/epwm_test_biss_c_cpu2/src/uart_4Mbit.c
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* uart_4Mbit.c
|
||||||
|
*
|
||||||
|
* Created on: 4 сент. 2024 г.
|
||||||
|
* Author: seklyuts
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "f28x_project.h"
|
||||||
|
#include "uart_4Mbit.h"
|
||||||
|
|
||||||
|
#define LSPCLK_HZ 50000000.0
|
||||||
|
#define BAUD 4000000.0
|
||||||
|
#define BRR LSPCLK_HZ/(BAUD*8) + 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void UartInit(void)
|
||||||
|
{
|
||||||
|
EALLOW;
|
||||||
|
CpuSysRegs.PCLKCR7.bit.SCI_A = 1;
|
||||||
|
EDIS;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef REF0
|
||||||
|
EALLOW;
|
||||||
|
GpioDataRegs.GPADAT.bit.GPIO21 = 1;
|
||||||
|
GpioDataRegs.GPCDAT.bit.GPIO83 = 0;
|
||||||
|
EDIS;
|
||||||
|
#else
|
||||||
|
EALLOW;
|
||||||
|
GpioDataRegs.GPEDAT.bit.GPIO133 = 1;
|
||||||
|
GpioDataRegs.GPEDAT.bit.GPIO145 = 0;
|
||||||
|
EDIS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
EALLOW;
|
||||||
|
SciaRegs.SCICCR.all = 0x0007; // 1 stop bit, No loopback
|
||||||
|
// No parity,8 char bits,
|
||||||
|
// async mode, idle-line protocol
|
||||||
|
SciaRegs.SCICTL1.all = 0x0003; // enable TX, RX, internal SCICLK,
|
||||||
|
// Disable RX ERR, SLEEP, TXWAKE
|
||||||
|
SciaRegs.SCICTL2.all = 0x0003;
|
||||||
|
SciaRegs.SCICTL2.bit.TXINTENA = 0;
|
||||||
|
SciaRegs.SCICTL2.bit.RXBKINTENA = 0;
|
||||||
|
|
||||||
|
uint16_t Brr = BRR;
|
||||||
|
|
||||||
|
SciaRegs.SCIHBAUD.all = 0xFF & (Brr>>8);//0x0002;
|
||||||
|
SciaRegs.SCILBAUD.all = 0xFF & Brr;//0x008B;
|
||||||
|
|
||||||
|
SciaRegs.SCICTL1.all = 0x0023; // Relinquish SCI from Reset
|
||||||
|
|
||||||
|
SciaRegs.SCICTL1.bit.RXENA = 1;
|
||||||
|
SciaRegs.SCICTL1.bit.TXENA = 1;
|
||||||
|
|
||||||
|
EDIS;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UartErrorReset(void)
|
||||||
|
{
|
||||||
|
if(SciaRegs.SCIRXST.bit.RXERROR)
|
||||||
|
{
|
||||||
|
EALLOW;
|
||||||
|
SciaRegs.SCICTL1.bit.SWRESET = 0;
|
||||||
|
EDIS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EALLOW;
|
||||||
|
SciaRegs.SCICTL1.bit.SWRESET = 1;
|
||||||
|
EDIS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
14
Projects/epwm_test_biss_c_cpu2/src/uart_4Mbit.h
Normal file
14
Projects/epwm_test_biss_c_cpu2/src/uart_4Mbit.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/*
|
||||||
|
* uart_4Mbit.h
|
||||||
|
*
|
||||||
|
* Created on: 4 сент. 2024 г.
|
||||||
|
* Author: seklyuts
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SRC_UART_4MBIT_H_
|
||||||
|
#define SRC_UART_4MBIT_H_
|
||||||
|
|
||||||
|
void UartInit(void);
|
||||||
|
void UartErrorReset(void);
|
||||||
|
|
||||||
|
#endif /* SRC_UART_4MBIT_H_ */
|
||||||
Loading…
Reference in New Issue
Block a user