Skip to content

Commit

Permalink
HW OVP
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Sep 26, 2019
1 parent 2f92e8a commit 7c05ea7
Show file tree
Hide file tree
Showing 11 changed files with 424 additions and 421 deletions.
2 changes: 1 addition & 1 deletion src/eez/apps/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void Channel::set(uint8_t slotIndex_, uint8_t subchannelIndex_, uint8_t boardRev
boardRevision = boardRevision_;
subchannelIndex = subchannelIndex_;

channelInterface = g_modules[g_slots[slotIndex].moduleType].channelInterface[slotIndex];
channelInterface = g_modules[g_slots[slotIndex].moduleType].channelInterfaces ? g_modules[g_slots[slotIndex].moduleType].channelInterfaces[slotIndex] : nullptr;

params = &CH_BOARD_REVISION_PARAMS[boardRevision];

Expand Down
6 changes: 3 additions & 3 deletions src/eez/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,19 @@ ModuleInfo g_modules[] = {
406,
CH_BOARD_REVISION_DCP405_R2B5,
1,
dcpX05::g_channelInterface
dcpX05::g_channelInterfaces
},
{
220,
CH_BOARD_REVISION_DCM220_R1B1,
2,
dcm220::g_channelInterface
dcm220::g_channelInterfaces
},
{
505,
CH_BOARD_REVISION_DCP505_R1B3,
1,
dcpX05::g_channelInterface
dcpX05::g_channelInterfaces
},
};

Expand Down
2 changes: 1 addition & 1 deletion src/eez/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct ModuleInfo {
uint16_t moduleId;
uint8_t lasestBoardRevision; // TODO should be lasestModuleRevision
uint8_t numChannels;
ChannelInterface **channelInterface;
ChannelInterface **channelInterfaces;
};

extern ModuleInfo g_modules[];
Expand Down
4 changes: 2 additions & 2 deletions src/eez/modules/dcm220/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,15 @@ struct Channel : ChannelInterface {
static Channel g_channel0(0);
static Channel g_channel1(1);
static Channel g_channel2(2);
ChannelInterface *g_channelInterface[NUM_SLOTS] = { &g_channel0, &g_channel1, &g_channel2 };
ChannelInterface *g_channelInterfaces[NUM_SLOTS] = { &g_channel0, &g_channel1, &g_channel2 };

#if defined(EEZ_PLATFORM_STM32)

float readTemperature(int channelIndex) {
psu::Channel& channel = psu::Channel::get(channelIndex);
int slotIndex = channel.slotIndex;
int subchannelIndex = channel.subchannelIndex;
Channel *dcm220Channel = (Channel *)g_channelInterface[slotIndex];
Channel *dcm220Channel = (Channel *)g_channelInterfaces[slotIndex];
return dcm220Channel->temperature[subchannelIndex];
}

Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/dcm220/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace eez {
namespace dcm220 {

extern ChannelInterface *g_channelInterface[NUM_SLOTS];
extern ChannelInterface *g_channelInterfaces[NUM_SLOTS];

#if defined(EEZ_PLATFORM_STM32)
float readTemperature(int channelIndex);
Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/dcpX05/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ struct Channel : ChannelInterface {
static Channel g_channel0(0);
static Channel g_channel1(1);
static Channel g_channel2(2);
ChannelInterface *g_channelInterface[NUM_SLOTS] = { &g_channel0, &g_channel1, &g_channel2 };
ChannelInterface *g_channelInterfaces[NUM_SLOTS] = { &g_channel0, &g_channel1, &g_channel2 };

} // namespace dcpX05
} // namespace eez
2 changes: 1 addition & 1 deletion src/eez/modules/dcpX05/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace eez {
namespace dcpX05 {

extern ChannelInterface *g_channelInterface[NUM_SLOTS];
extern ChannelInterface *g_channelInterfaces[NUM_SLOTS];

} // namespace dcpX05
} // namespace eez
808 changes: 404 additions & 404 deletions src/third_party/stm32_r1b5/.cproject

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/third_party/stm32_r1b5/.mxproject
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[PreviousGenFiles]
HeaderPath=C:/Users/Martin/Dropbox/Code/EEZ/modular-psu-firmware/src/third_party/stm32_r1b5/Inc
HeaderPath=C:/Users/mvladic/Dropbox/Code/EEZ/modular-psu-firmware/src/third_party/stm32_r1b5/Inc
HeaderFiles=gpio.h;adc.h;crc.h;dac.h;dma.h;dma2d.h;fmc.h;FreeRTOSConfig.h;i2c.h;ltdc.h;lwip.h;lwipopts.h;ethernetif.h;rng.h;rtc.h;sdmmc.h;spi.h;tim.h;usb_device.h;usbd_conf.h;usbd_desc.h;usbd_cdc_if.h;stm32f7xx_it.h;stm32f7xx_hal_conf.h;main.h;ffconf.h;bsp_driver_sd.h;sd_diskio.h;fatfs.h;fatfs_platform.h;eth.h;usart.h;
SourcePath=C:/Users/Martin/Dropbox/Code/EEZ/modular-psu-firmware/src/third_party/stm32_r1b5/Src
SourcePath=C:/Users/mvladic/Dropbox/Code/EEZ/modular-psu-firmware/src/third_party/stm32_r1b5/Src
SourceFiles=gpio.c;adc.c;crc.c;dac.c;dma.c;dma2d.c;fmc.c;freertos.c;i2c.c;ltdc.c;lwip.c;ethernetif.c;syscalls.c;rng.c;rtc.c;sdmmc.c;spi.c;tim.c;usb_device.c;usbd_conf.c;usbd_desc.c;usbd_cdc_if.c;stm32f7xx_it.c;stm32f7xx_hal_msp.c;stm32f7xx_hal_timebase_TIM.c;main.c;bsp_driver_sd.c;sd_diskio.c;fatfs.c;fatfs_platform.c;stm32f7xx_hal_timebase_tim.c;eth.c;usart.c;

[PreviousLibFiles]
Expand Down
4 changes: 2 additions & 2 deletions src/third_party/stm32_r1b5/Src/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void MX_GPIO_Init(void)
/*Configure GPIO pins : PAPin PAPin */
GPIO_InitStruct.Pin = SPI2_IRQ_Pin|SPI5_IRQ_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

/*Configure GPIO pin : PA10 */
Expand Down Expand Up @@ -181,7 +181,7 @@ void MX_GPIO_Init(void)
/*Configure GPIO pin : PtPin */
GPIO_InitStruct.Pin = SPI4_IRQ_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Pull = GPIO_PULLUP;
HAL_GPIO_Init(SPI4_IRQ_GPIO_Port, &GPIO_InitStruct);

/*Configure GPIO pin : PtPin */
Expand Down
9 changes: 6 additions & 3 deletions src/third_party/stm32_r1b5/h25005.ioc
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,9 @@ PA13.Mode=Trace_Asynchronous_SW
PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Trace_Asynchronous_SW
PA14.Signal=SYS_JTCK-SWCLK
PA15.GPIOParameters=GPIO_Label
PA15.GPIOParameters=GPIO_PuPd,GPIO_Label
PA15.GPIO_Label=SPI5_IRQ
PA15.GPIO_PuPd=GPIO_PULLUP
PA15.Locked=true
PA15.Signal=GPXTI15
PA2.Mode=MII
Expand All @@ -348,8 +349,9 @@ PA6.Mode=RGB565
PA6.Signal=LTDC_G2
PA7.Mode=MII
PA7.Signal=ETH_RX_DV
PA8.GPIOParameters=GPIO_Label
PA8.GPIOParameters=GPIO_PuPd,GPIO_Label
PA8.GPIO_Label=SPI2_IRQ
PA8.GPIO_PuPd=GPIO_PULLUP
PA8.Locked=true
PA8.Signal=GPXTI8
PA9.Mode=Activate_VBUS
Expand Down Expand Up @@ -396,8 +398,9 @@ PB7.Mode=I2C
PB7.Signal=I2C1_SDA
PB8.Mode=MII
PB8.Signal=ETH_TXD3
PB9.GPIOParameters=GPIO_Label
PB9.GPIOParameters=GPIO_PuPd,GPIO_Label
PB9.GPIO_Label=SPI4_IRQ
PB9.GPIO_PuPd=GPIO_PULLUP
PB9.Locked=true
PB9.Signal=GPXTI9
PC0.GPIOParameters=GPIO_Speed
Expand Down

0 comments on commit 7c05ea7

Please sign in to comment.