File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22#define CCU_CONSTANTS
33
44/* Watchdog constants */
5- constexpr int WATCHDOG_PIN = 26 ;
6- constexpr int SOFTWARE_OK_PIN = 27 ; // Watchdog's !RESET pin
5+ constexpr int WATCHDOG_PIN = 35 ;
6+ constexpr int SOFTWARE_OK_PIN = 34 ; // Watchdog's !RESET pin
77constexpr unsigned long WATCHDOG_KICK_INTERVAL_MS = 10UL ;
88
99#endif
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ using pin = size_t;
1515
1616namespace DISPLAY_PINS
1717{
18- constexpr const pin LCD_CS = 36 ;
18+ constexpr const pin LCD_CS = 39 ;
1919 constexpr const pin LCD_SCK = 13 ;
2020 constexpr const pin LCD_MISO = 12 ;
2121 constexpr const pin LCD_MOSI = 11 ;
Original file line number Diff line number Diff line change 1+ #ifndef Level2Interface
2+ #define Level2Interface
3+
4+ #include < etl/singleton.h>
5+ #include < Arduino.h>
6+ #include " CCUData.h"
7+
8+ using pin = size_t ;
9+
10+
11+ /* 240V Charging Constants */
12+ namespace LEVEL2_PARAMS {
13+
14+ constexpr const pin CONTROL_V_SENSE = 37 ; // pin to read voltage on CP line
15+ constexpr const pin CONTROL_PWM_SENSE = 29 ; // pin to read PWM signal from CP
16+ constexpr const pin PROXIMITY_SENSE = 15 ; // pin to read voltage on PP
17+
18+ };
19+
20+ class Level2Interface
21+ {
22+ private:
23+ pin teensy_cp_v;
24+ pin teensy_cp_pwm;
25+ pin teensy_pp_v;
26+ pin enabled;
27+
28+ public:
29+ Level2Interface (
30+ pin cp_v = LEVEL2_PARAMS::CONTROL_V_SENSE,
31+ pin cp_pwm = LEVEL2_PARAMS::CONTROL_PWM_SENSE,
32+ pin pp_v = LEVEL2_PARAMS::PROXIMITY_SENSE) :
33+ teensy_cp_v (cp_v),
34+ teensy_cp_pwm (cp_pwm),
35+ teensy_pp_v (pp_v),
36+ enabled (CCUData.level_2_enabled)
37+ {};
38+
39+ void init ();
40+ }
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ using pin = size_t;
99/* Watchdog Constants */
1010namespace WATCHDOG_PARAMS {
1111
12- constexpr const pin WATCHDOG_PIN = 26 ; // teensy input to watchdog
13- constexpr const pin SOFTWARE_OK_PIN = 27 ; // Watchdog's !RESET pin
12+ constexpr const pin WATCHDOG_PIN = 35 ; // teensy input to watchdog
13+ constexpr const pin SOFTWARE_OK_PIN = 34 ; // Watchdog's !RESET pin
1414 constexpr unsigned long WATCHDOG_KICK_INTERVAL_MS = 10UL ;
1515
1616};
Original file line number Diff line number Diff line change 1+ #include " Level2Interface.h"
2+
3+ void Level2Interface::init () {
4+ pinMode (CONTROL_V_SENSE, in)
5+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ struct CCUData
2626 float min_cell_temp = 0 ; // value given for initialization
2727 static constexpr float balancing_voltage = 3.8 ; // voltage at which cells begin balancing
2828 float max_board_temp;
29+ bool level_2_enabled = false ; // tells CCU systems what to do
2930};
3031
3132
Original file line number Diff line number Diff line change 1717#include " DisplayInterface.h"
1818
1919
20- FlexCAN_Type<CAN2 > CHARGER_CAN; // placed here after debugging
20+ FlexCAN_Type<CAN3 > CHARGER_CAN; // placed here after debugging
2121FlexCAN_Type<CAN1> ACU_CAN;
2222
2323
You can’t perform that action at this time.
0 commit comments