Fixed issue with external DAC handlign from repair process

repair process implemented. Simple regulation without feedback (must be addeed, yet)

HW validation menu functional but buggy (IOs not OK)

Added ClearLine functionality to displayDevice

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@244 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-09 15:29:23 +00:00
parent 0e69a81570
commit a73154a5e6
25 changed files with 1054 additions and 229 deletions

View File

@@ -24,9 +24,8 @@ ARFLAGS = rs
OBJECTS = \
stm32f10x_it.o \
adc.o \
gpio.o \
IODevice.o \
internalADC.o \
keypadMatrix.o \
oli_stm32_h107.o \
PCBA.o \

View File

@@ -1,70 +0,0 @@
// -----------------------------------------------------------------------------
/// @file IODevice.h
/// @brief File description
// -----------------------------------------------------------------------------
// Micro-Key bv
// Industrieweg 28, 9804 TG Noordhorn
// Postbus 92, 9800 AB Zuidhorn
// The Netherlands
// Tel: +31 594 503020
// Fax: +31 594 505825
// Email: support@microkey.nl
// Web: www.microkey.nl
// -----------------------------------------------------------------------------
/// $Revision$
/// $Author$
/// $Date$
// (c) 2017 Micro-Key bv
// -----------------------------------------------------------------------------
/// @defgroup {group_name} {group_description}
/// Description
/// @file IODevice.h
/// @ingroup {group_name}
#ifndef MISC_INC_IODEVICE_H_
#define MISC_INC_IODEVICE_H_
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
#include <stdio.h>
#include "stm32f10x.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Type definitions.
// -----------------------------------------------------------------------------
struct IODevice;
typedef ErrorStatus (*ReadFunction)(const struct IODevice* self, char* buffer, size_t length, size_t* actualLength);
typedef ErrorStatus (*WriteFunction)(const struct IODevice* self, const char* buffer, size_t length);
struct IODevice
{
ReadFunction _read;
WriteFunction _write;
};
// -----------------------------------------------------------------------------
// Function declarations
// -----------------------------------------------------------------------------
extern ErrorStatus IODevice_construct (struct IODevice* self, ReadFunction read, WriteFunction write);
extern ErrorStatus IODevice_write(const struct IODevice* self, const char* buffer, size_t length);
extern ErrorStatus IODevice_read(const struct IODevice* self, char* buffer, size_t length, size_t* actualLength);
#endif /* MISC_INC_IODEVICE_H_ */

View File

@@ -230,6 +230,6 @@ extern void ADCChannel_destruct(struct AdcChannel* self);
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus ADCChannel_read(struct AdcChannel* self, uint16_t* value);
extern ErrorStatus ADCChannel_read(const struct AdcChannel* self, uint16_t* value);
#endif /* INC_ADC_H_ */

View File

@@ -1,91 +0,0 @@
// -----------------------------------------------------------------------------
/// @file IODevice.c
/// @brief Description
// -----------------------------------------------------------------------------
// Micro-Key bv
// Industrieweg 28, 9804 TG Noordhorn
// Postbus 92, 9800 AB Zuidhorn
// The Netherlands
// Tel: +31 594 503020
// Fax: +31 594 505825
// Email: support@microkey.nl
// Web: www.microkey.nl
// -----------------------------------------------------------------------------
/// $Revision$
/// $Author$
/// $Date$
// (c) 2017 Micro-Key bv
// -----------------------------------------------------------------------------
/// @file IODevice.c
/// @ingroup {group_name}
// -----------------------------------------------------------------------------
// Include files
// -----------------------------------------------------------------------------
#include "IODevice.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Type definitions
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// File-scope variables
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Function declarations
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Function definitions
// -----------------------------------------------------------------------------
ErrorStatus IODevice_construct (struct IODevice* self, ReadFunction read, WriteFunction write)
{
ErrorStatus returnValue = SUCCESS;
self->_write = write;
self->_read = read;
return returnValue;
}
ErrorStatus IODevice_write(const struct IODevice* self, const char* buffer, size_t length)
{
ErrorStatus returnValue = SUCCESS;
if (self->_write != NULL)
{
returnValue = self->_write(self, buffer, length);
}
return returnValue;
}
ErrorStatus IODevice_read(const struct IODevice* self, char* buffer, size_t length, size_t* actualLength)
{
ErrorStatus returnValue = SUCCESS;
if (self->_read != NULL)
{
returnValue = self->_read(self, buffer, length, actualLength);
}
return returnValue;
}

View File

@@ -26,7 +26,7 @@
// -----------------------------------------------------------------------------
#include "stm32f10x.h"
#include "adc.h"
#include "internalADC.h"
// -----------------------------------------------------------------------------
// Constant and macro definitions
@@ -206,7 +206,7 @@ void ADCChannel_destruct(struct AdcChannel* self)
}
ErrorStatus ADCChannel_read(struct AdcChannel* self, uint16_t* value)
ErrorStatus ADCChannel_read(const struct AdcChannel* self, uint16_t* value)
{
ErrorStatus returnValue = SUCCESS;

View File

@@ -37,7 +37,7 @@
#include "Logger.h"
#include "platform.h"
#include "adc.h"
#include "internalADC.h"
#include "gpio.h"
#include "PCBA.h"
#include "rtc.h"
@@ -171,7 +171,7 @@ struct Gpio* const solenoid = & _solenoid;
struct Gpio* const mcp0Relay = &_mcp0Relay;
struct Gpio* const mcp1Relay = &_mcp1Relay;
struct Gpio* const mcp2Relay = &_mcp2Relay;
struct Gpio* const cat0Relay = & _cat0Relay;
struct Gpio* const cat0Relay = &_cat0Relay;
struct Gpio* const cat1Relay = &_cat1Relay;
struct Gpio* const cat2Relay = &_cat2Relay;
struct Gpio* const teslaLock = &_teslaLock;
@@ -249,24 +249,21 @@ ErrorStatus initPlatform(void)
adc1->ADCx = ADC1;
ADC_construct(adc1, adc1Parameters);
struct AdcChannel adcChannel = {.initialized = false};
struct AdcChannelParameters acParameters;
acParameters.channel = ADC_Channel_1;
acParameters.Rank = 1;
acParameters.ADC_SampleTime = ADC_SampleTime_55Cycles5;
ADCChannel_construct(&adc1->channel[1], adc1, &acParameters);
acParameters.channel = ADC_Channel_2;
acParameters.Rank = 2;
acParameters.ADC_SampleTime = ADC_SampleTime_55Cycles5;
ADCChannel_construct(&adc1->channel[2], adc1, &acParameters);
acParameters.channel = ADC_Channel_0;
acParameters.Rank = 3;
acParameters.ADC_SampleTime = ADC_SampleTime_55Cycles5;
ADCChannel_construct(&adcChannel, adc1, &acParameters);
acParameters.channel = ADC_Channel_1;
acParameters.Rank = 2;
acParameters.ADC_SampleTime = ADC_SampleTime_55Cycles5;
ADCChannel_construct(&adcChannel, adc1, &acParameters);
acParameters.channel = ADC_Channel_2;
acParameters.Rank = 1;
acParameters.ADC_SampleTime = ADC_SampleTime_55Cycles5;
ADCChannel_construct(&adcChannel, adc1, &acParameters);
ADCChannel_construct(&adc1->channel[0], adc1, &acParameters);
ADC_setDMAStatus(adc1, ENABLE);
ADC_setStatus(adc1, ENABLE);
@@ -734,6 +731,7 @@ static ErrorStatus initIO (void)
interlock2->gpio = configureGPIO(GPIOB, GPIO_Mode_IN_FLOATING, GPIO_Speed_50MHz, GPIO_Pin_1);
// Solenoid - PB5 output
solenoid->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_5);
if (PCBA_getInstance()->pcba == CathodeMCP)
{
// MCP0Relay - PD8 output
@@ -749,10 +747,7 @@ static ErrorStatus initIO (void)
// CAT2Relay - PD13 output
cat2Relay->gpio = configureGPIO(GPIOD, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_13);
}
else
{
}
if (PCBA_getInstance()->pcba == Tesla)
{
// Tesla lock PB10 output