Added buzzer

Added powerloss detector

Added buzzer behaviour to system.
Added powerloss behaviour to system 

Added french translation to menu texts

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@359 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-12-13 13:22:06 +00:00
parent 9a5bbf8a7a
commit a48164fe7a
24 changed files with 973 additions and 160 deletions

View File

@@ -108,6 +108,7 @@ ErrorStatus Keypad_construct(struct Keypad* self, size_t numberOfRows, size_t nu
if(returnValue == SUCCESS)
{
///TODO THIS SHOULD BE SELF INSTEAD OF KEYPAD, RIGHT?
xTaskCreate(KeypadTask, (const char*)"keypadTask", self->stackSize, keypad, self->taskPriority, &self->taskHandle);
}

View File

@@ -42,6 +42,7 @@
#include "Logger.h"
#include "platform.h"
#include "Buzzer.h"
#include "CathodeMCP.h"
#include "CoverSolenoid.h"
#include "gpio.h"
@@ -85,6 +86,10 @@
#define SPI_LCD_RX_QUEUE (32)
#define SPI_LCD_TX_QUEUE (32)
// Buzzer Settings
#define BUZZER_STACK_SIZE (128)
#define BUZZER_TASK_PRIORITY (3)
// Keypad Settings
#define KEYPAD_DEBOUNCE_TIME_MS (20)
#define KEYPAD_STACK_SIZE (128)
@@ -107,6 +112,8 @@
// Logger
static struct Logger _mainLog = {.initialized = false};
// Buzzer
static struct Buzzer _mainBuzzer = {.initialized = false};
// ADC
static struct Adc _adc1 = {.initialized = false};
@@ -170,6 +177,8 @@ static struct MAX5715 _max5715 = {.initialized = false};
struct Logger* mainLog = &_mainLog;
struct Buzzer* mainBuzzer = &_mainBuzzer;
struct Adc* const adc1 = &_adc1;
struct AdcParameters* adc1Parameters = &_adc1Parameters;
@@ -349,20 +358,20 @@ static ErrorStatus initIO (void)
// Init LED Orange on DevKit
ledInternOrange->gpio = configureGPIO(GPIOC, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_7);
// Init LED Green of BiColour led
ledBicolourGreen->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource11);
ledBicolourGreen->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_11);
// Init LED Red of BiColour led
ledBicolourRed->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource13);
ledBicolourRed->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_13);
/* BUZZER initialisation -------------------------------------------------*/
buzzer->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource12);
buzzer->gpio = configureGPIO(GPIOE, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_12);
/* HIGH VOLTAGE PRESENT initialisation -----------------------------------*/
// HV0 Present
hv0Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource12);
hv0Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_12);
// HV1 Present
hv1Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource13);
hv1Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_13);
// HV2 Present
hv2Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_PinSource14);
hv2Present->gpio = configureGPIO(GPIOB, GPIO_Mode_Out_PP, GPIO_Speed_50MHz, GPIO_Pin_4);
/* ADC1 initialisation ---------------------------------------------------*/
// Channel 0 - PA0
@@ -654,6 +663,9 @@ static ErrorStatus initPeriphery(void)
// Solenoid
GPIO_construct(solenoid, OUTPUT, solenoid->gpio);
// Buzzer
GPIO_construct(buzzer, OUTPUT, buzzer->gpio);
// HV detection
GPIO_construct(hv0Present, INPUT, hv0Present->gpio);
GPIO_construct(hv1Present, INPUT, hv1Present->gpio);
@@ -814,6 +826,14 @@ static ErrorStatus initPlatformDevices (void)
}
}
/* --------------------------------------------------------------------*/
/* SIMPLE IO BUZZER */
/* --------------------------------------------------------------------*/
if (returnValue == SUCCESS)
{
returnValue = Buzzer_construct(mainBuzzer, buzzer, BUZZER_TASK_PRIORITY, BUZZER_STACK_SIZE);
}
return returnValue;
}