PCB names updated according to new type convention
This commit is contained in:
@@ -63,20 +63,18 @@
|
||||
// specific board settings
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(PCB_LS_005)
|
||||
#include "pcbs/pcb_ls_005.h"
|
||||
#elif defined(PCB_LS_010)
|
||||
#include "pcbs/pcb_ls_010.h"
|
||||
#elif defined(PCB_CS_02)
|
||||
#include "pcbs/pcb_cs_02.h"
|
||||
#elif defined(PCB_CS_04)
|
||||
#include "pcbs/pcb_cs_04.h"
|
||||
#elif defined(PCB_CS_06)
|
||||
#include "pcbs/pcb_cs_06.h"
|
||||
#elif defined(PCB_PWM_01)
|
||||
#include "pcbs/pcb_pwm_01.h"
|
||||
#elif defined(PCB_PWM_02)
|
||||
#include "pcbs/pcb_pwm_02.h"
|
||||
#if defined(MPPT_2420_LC_0V10)
|
||||
#include "pcbs/mppt_2420_lc_0v10.h"
|
||||
#elif defined(MPPT_1210_HUS_0V2)
|
||||
#include "pcbs/mppt_1210_hus_0v2.h"
|
||||
#elif defined(MPPT_1210_HUS_0V4)
|
||||
#include "pcbs/mppt_1210_hus_0v4.h"
|
||||
#elif defined(MPPT_1210_HUS_0V6)
|
||||
#include "pcbs/mppt_1210_hus_0v6.h"
|
||||
#elif defined(PWM_2420_LUS_0V1)
|
||||
#include "pcbs/pwm_2420_lus_0v1.h"
|
||||
#elif defined(PWM_2420_LUS_0V2)
|
||||
#include "pcbs/pwm_2420_lus_0v2.h"
|
||||
#elif defined(UNIT_TEST)
|
||||
#include "pcbs/pcb_stub.h"
|
||||
#else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2017 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __PCB_CS_02_H_
|
||||
#define __PCB_CS_02_H_
|
||||
#ifndef MPPT_1210_HUS_0V2_H
|
||||
#define MPPT_1210_HUS_0V2_H
|
||||
|
||||
#include "mbed.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2018 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __PCB_CS_04_H_
|
||||
#define __PCB_CS_04_H_
|
||||
#ifndef MPPT_1210_HUS_0V4_H
|
||||
#define MPPT_1210_HUS_0V4_H
|
||||
|
||||
#include "mbed.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2018 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __PCB_CS_06_H_
|
||||
#define __PCB_CS_06_H_
|
||||
#ifndef MPPT_1210_HUS_0V6_H
|
||||
#define MPPT_1210_HUS_0V6_H
|
||||
|
||||
#include "mbed.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2017 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_LS_10_H_
|
||||
#define __CONFIG_LS_10_H_
|
||||
#ifndef MPPT_2420_LC_0V10_H
|
||||
#define MPPT_2420_LC_0V10_H
|
||||
|
||||
#include "mbed.h"
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2017 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_LS_05_H_
|
||||
#define __CONFIG_LS_05_H_
|
||||
|
||||
#include "mbed.h"
|
||||
|
||||
// DC/DC converter settings
|
||||
#define PWM_FREQUENCY 70 // kHz 70 = good compromise between output ripple and efficiency
|
||||
#define PWM_TIM 1 // use TIM1 timer
|
||||
|
||||
#define DCDC_CURRENT_MAX 12 // PCB maximum DCDC output current
|
||||
#define LOAD_CURRENT_MAX 12 // PCB maximum load switch current
|
||||
|
||||
#define PIN_UEXT_TX PA_2
|
||||
#define PIN_UEXT_RX PA_3
|
||||
#define PIN_UEXT_SCL PB_6
|
||||
#define PIN_UEXT_SDA PB_7
|
||||
#define PIN_UEXT_MISO PB_4
|
||||
#define PIN_UEXT_MOSI PB_5
|
||||
#define PIN_UEXT_SCK PB_3
|
||||
#define PIN_UEXT_SSEL PA_1
|
||||
|
||||
#define PIN_SWD_TX PB_10
|
||||
#define PIN_SWD_RX PB_11
|
||||
/*
|
||||
#define PIN_LED_PWR PA_9
|
||||
#define PIN_LED_DCDC PA_10
|
||||
#define PIN_LED_LOAD PB_12
|
||||
*/
|
||||
#define PIN_LOAD_DIS PB_2
|
||||
|
||||
#define PIN_CAN_RX PB_8
|
||||
#define PIN_CAN_TX PB_9
|
||||
|
||||
enum pin_state_t { PIN_HIGH, PIN_LOW, PIN_FLOAT };
|
||||
|
||||
// assignment LED numbers on PCB to their meaning
|
||||
#define NUM_LEDS 3
|
||||
|
||||
#define LED_PWR 0 // LED1
|
||||
#define LED_DCDC 1 // LED2
|
||||
#define LED_LOAD 2 // LED3
|
||||
|
||||
// LED pins and pin state configuration to switch above LEDs on
|
||||
#define NUM_LED_PINS 3
|
||||
static const PinName led_pins[NUM_LED_PINS] = {
|
||||
// PWR DCDC LOAD
|
||||
PA_9, PA_10, PB_12
|
||||
};
|
||||
static const pin_state_t led_pin_setup[NUM_LEDS][NUM_LED_PINS] = {
|
||||
{ PIN_HIGH, PIN_LOW, PIN_LOW }, // LED1
|
||||
{ PIN_LOW, PIN_HIGH, PIN_LOW }, // LED2
|
||||
{ PIN_LOW, PIN_LOW, PIN_HIGH } // LED3
|
||||
};
|
||||
|
||||
// typical value for Semitec 103AT-5 thermistor: 3435
|
||||
#define NTC_BETA_VALUE 3435
|
||||
|
||||
#define ADC_GAIN_V_BAT (130.0 / 10 ) // battery voltage divider 120k + 10k
|
||||
#define ADC_GAIN_V_SOLAR (156.8 / 6.8) // solar voltage divider: 150k + 6.kk
|
||||
#define ADC_GAIN_I_LOAD (1000 / 5 / 50) // amp gain: 50, resistor: 5 mOhm
|
||||
#define ADC_GAIN_I_DCDC (1000 / 5 / 50)
|
||||
|
||||
// position in the array written by the DMA controller
|
||||
enum {
|
||||
ADC_POS_V_BAT, // ADC 4 (PA_4)
|
||||
ADC_POS_V_SOLAR, // ADC 5 (PA_5)
|
||||
ADC_POS_I_LOAD, // ADC 6 (PA_6)
|
||||
ADC_POS_I_DCDC, // ADC 7 (PA_7)
|
||||
ADC_POS_TEMP_MCU, // ADC 16
|
||||
ADC_POS_VREF_MCU, // ADC 17
|
||||
NUM_ADC_CH // trick to get the number of enums
|
||||
};
|
||||
|
||||
// selected ADC channels (has to match with above enum)
|
||||
#define ADC_CHSEL ( \
|
||||
ADC_CHSELR_CHSEL4 | \
|
||||
ADC_CHSELR_CHSEL5 | \
|
||||
ADC_CHSELR_CHSEL6 | \
|
||||
ADC_CHSELR_CHSEL7 | \
|
||||
ADC_CHSELR_CHSEL16 | \
|
||||
ADC_CHSELR_CHSEL17 \
|
||||
)
|
||||
|
||||
#endif
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2018 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __PCB_PWM_02_H_
|
||||
#define __PCB_PWM_02_H_
|
||||
#ifndef PCB_STUB_H
|
||||
#define PCB_STUB_H
|
||||
|
||||
#define PWM_TIM 3 // use TIM3 timer
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2018 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __PCB_PWM_01_H_
|
||||
#define __PCB_PWM_01_H_
|
||||
#ifndef PWM_2420_LUS_0V1_H
|
||||
#define PWM_2420_LUS_0V1_H
|
||||
|
||||
#include "mbed.h"
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#define PIN_LOAD_DIS PB_2
|
||||
#define PIN_USB_PWR_DIS PB_5
|
||||
#define PIN_I_LOAD_COMP PB_4
|
||||
|
||||
#define PIN_REF_I_DCDC PA_4
|
||||
|
||||
@@ -79,8 +80,8 @@ static const pin_state_t led_pin_setup[NUM_LEDS][NUM_LED_PINS] = {
|
||||
|
||||
#define ADC_GAIN_V_BAT (132 / 12)
|
||||
#define ADC_GAIN_V_SOLAR (1 + 120/12 + 120/8.2)
|
||||
#define ADC_GAIN_I_LOAD (1000 / 2 / (150/2.2)) // amp gain: 150/2.2, resistor: 2 mOhm
|
||||
#define ADC_GAIN_I_SOLAR (1000 / 2 / (150/2.2))
|
||||
#define ADC_GAIN_I_LOAD (1000 / 2 / (68.0/2.2)) // amp gain: 150/2.2, resistor: 2 mOhm
|
||||
#define ADC_GAIN_I_SOLAR (1000 / 2 / (68.0/2.2))
|
||||
|
||||
#define ADC_OFFSET_V_SOLAR (-120.0 / 8.2) // to be multiplied with VDDA to get absolute voltage offset
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* LibreSolar MPPT charge controller firmware
|
||||
* Copyright (c) 2016-2018 Martin Jäger (www.libre.solar)
|
||||
/* LibreSolar charge controller firmware
|
||||
* Copyright (c) 2016-2019 Martin Jäger (www.libre.solar)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,8 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __PCB_PWM_02_H_
|
||||
#define __PCB_PWM_02_H_
|
||||
#ifndef PWM_2420_LUS_0V2_H
|
||||
#define PWM_2420_LUS_0V2_H
|
||||
|
||||
#include "mbed.h"
|
||||
|
||||
Reference in New Issue
Block a user