You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
4 weeks ago
|
/*
|
||
|
* MultiPhase.cpp
|
||
|
*
|
||
|
* Author: Aleksey Gerasimenko
|
||
|
* gerasimenko.aleksey.n@gmail.com
|
||
|
*/
|
||
|
|
||
|
#include "RUDRIVEFRAMEWORK/MultiPhase.h"
|
||
|
|
||
|
namespace RUDRIVEFRAMEWORK
|
||
|
{
|
||
|
//CONSTRUCTOR
|
||
|
MultiPhase::MultiPhase(uint16_t *memzone):
|
||
|
PhaseBase(memzone),
|
||
|
periphery(),
|
||
|
crc(),
|
||
|
modbus_port(cpu.scib, cpu.interval_measure, crc)
|
||
|
{}//CONSTRUCTOR
|
||
|
|
||
|
|
||
|
void MultiPhase::setup(MultiPhaseSetup& setup)
|
||
|
{
|
||
|
cpu.setup(setup.cpu);
|
||
|
periphery.setup(m_memzone);
|
||
|
modbus_port.setup(setup.modbus);
|
||
|
//
|
||
|
}//
|
||
|
//
|
||
|
|
||
|
void MultiPhase::get_hard_code_setup(MultiPhaseSetup& hsetup)
|
||
|
{
|
||
|
cpu.get_hard_code_setup(hsetup.cpu);
|
||
|
// hsetup.cpu.epwm.parameters.fpwm = MULTI_PHASE_PWM_FREQUENCY;
|
||
|
// hsetup.cpu.epwm.parameters.adc_soc_quantity = MULTI_PHASE_ADC_ISR_QUANTITY;
|
||
|
// hsetup.cpu.epwm.parameters.adc_soc_offset = MULTI_PHASE_ADC_ISR_OFFSET_RELATIVE;
|
||
|
//
|
||
|
periphery.get_hard_code_setup(hsetup.periphery);
|
||
|
//
|
||
|
hsetup.modbus.gpio_re_de_setup = &DSP28335::GPIO::gpio_scib_re_de_setup;
|
||
|
hsetup.modbus.gpio_driver_enable = &DSP28335::GPIO::gpio_scib_re_de_set;
|
||
|
hsetup.modbus.gpio_receiver_enable = &DSP28335::GPIO::gpio_scib_re_de_clear;
|
||
|
//
|
||
|
}//
|
||
|
//
|
||
|
} /* namespace RUDRIVEFRAMEWORK */
|