Martin Jäger
445359c3b5
Make CAN publication frequency more accurate
...
Using K_TIMEOUT_ABS_MS for k_sleep calculate exact 1s interval.
2020-08-03 14:52:20 +02:00
Martin Jäger
bbd1312fe5
Relocate and clean up application Kconfig structure
2020-07-24 08:49:47 +02:00
Martin Jäger
dc85b46477
Remove unused ExtInterface and ExtMgr
2020-07-23 19:27:45 +02:00
Martin Jäger
01650917fd
Move ThingSet serial to dedicated thread
2020-07-23 19:18:24 +02:00
Martin Jäger
79ba9006e7
Move OLED display to dedicated thread
2020-07-23 18:31:52 +02:00
Martin Jäger
c2ef955a63
Replace custom print_* with Zephyr LOG_*
2020-07-23 17:34:41 +02:00
Martin Jäger
8e06357a7d
Make CAN node ID configurable
2020-07-23 17:34:41 +02:00
Martin Jäger
70baedf95d
CAN: Separate thread for pub messages
2020-07-23 17:34:41 +02:00
Martin Jäger
ed374e8e99
Remove CAN msg queue and update ThingSet lib
2020-07-23 17:34:41 +02:00
Martin Jäger
dc4576c8b4
Remove all board.h files
...
Final updates to devicetree files (adding temperature sensor information) make
board.h files obsolete.
2020-07-23 17:34:41 +02:00
Martin Jäger
a584904470
Switch to new DT_ macros
2020-07-23 17:34:39 +02:00
Martin Jäger
b8fe6d7023
Fix some static code analysis warnings
2020-07-23 12:55:38 +02:00
Martin Jäger
7af7d1c4ee
Add CAN ISO-TP support
2020-07-23 12:55:37 +02:00
Martin Jäger
3fcd27cdba
Use separate CMakeLists.txt per directory
2020-07-23 12:41:32 +02:00
Martin Jäger
705abbed6b
Remove broken ESP32 modem driver
...
This driver was only compatible with mbed and didn't work reliably. Zephyr
has an in-built ESP modem driver already.
2020-07-23 12:41:32 +02:00
Martin Jäger
a7f4ccaa91
Add CAN support for MPPT 2420 RC board
...
The CAN-FD driver is not yet in Zephyr master, so it is required to get
Zephyr PR 22832 to actually use CAN with this MCU.
2020-07-23 12:41:24 +02:00
Martin Jäger
3185ff32a1
Add support for Zephyr 2.3.0 (using west)
...
Enable CONFIG_LEGACY_DEVICETREE_MACROS and fix removed Kconfig values
like UART_1 to support v2.2 and v2.3.
2020-06-17 11:15:38 +02:00
Martin Jäger
efc0bc8fdc
Update to ThingSet library v0.3
2020-05-06 12:53:26 +02:00
Martin Jäger
ce7f63b888
Introduce generic "outputs" DTS binding
...
Replaces previous "switch" and "pwm-out" bindings and allows to reference
either gpio or pwm handle and specify maximum current.
Also replacing CONFIG_HAS_LOAD and CONFIG_HAS_USB_PWR with DT_ variants.
2020-05-06 12:53:26 +02:00
Martin Jäger
c25640b987
Fix blocking if CAN not connected to bus
2020-05-06 12:53:26 +02:00
Martin Jäger
2a71d02aeb
Move PCB and user config to board Kconfig
...
Files in src/pcbs/xyz.h are moved to boards/xyz/board.h. User settings from
src/config.h are also configured via Kconfig, so the file is removed.
2020-04-30 10:53:58 +02:00
Martin Jäger
2d74a3a554
Mbed support removed
...
Rationale: The support for both Zephyr and Mbed made the code confusing,
especially because of many ifdefs.
Zephyr RTOS is the future!
2020-04-04 08:21:43 +02:00
Martin Jäger
fa9d15e796
Separate load and USB out, improve state handling
...
Identified issues:
- The load output and USB charging port shared the same state machine,
which did not allow to set different switch-off thresholds.
- Load error codes were global, so it was not possible to have multiple
load instances.
This commit introduces load-specific error_flags, makes the LoadOutput
class inherit from PowerPort (to improve code readability), separates
the load driver better from higher level implementation and adds a
second LoadOutput object for the USB charging port.
2020-02-21 18:27:36 +01:00
Martin Jaeger
08974169ab
Use new Zephyr 2.2 GPIO driver API features
...
Enable and disable pins are now handled the same using _set function
instead of _write and using ACTIVE_HIGH/LOW setting in dts.
2020-02-13 18:35:42 +01:00
Martin Jaeger
c4d4372953
Fix board files for Zephyr 2.2 compatibility
...
Warning: These changes break compatibility with previous v2.1.
2020-02-13 17:30:19 +01:00
Martin Jaeger
5f1d76ef74
Dedicated setup.cpp to clean up main.cpp
...
Also includes update of timestamp calculation in Zephyr.
2020-02-08 11:08:58 +01:00
Martin Jaeger
f0e99cd80f
Voltage replaced by DcBus ptr in PowerPort class
...
Preparation to separate current and voltage measurements and control
parameters into DcBus and PowerPort classes. This will help to
manage current from different sources (grid, solar) going towards
one bus and control the battery voltage. It will also help to align
multiple charge controllers in parallel, communicating via CAN bus.
2020-02-07 11:55:51 +01:00
Martin Jaeger
c31f8d5014
Fix PlatformIO debug error in ext.cpp
...
Without this dummy implementation of std::__throw_bad_alloc() the
linker was throwing errors.
2020-02-05 18:06:06 +01:00
Martin Jaeger
1b6a7f82d7
Zephyr: CAN support added
...
So far, only publishing messages are supported (no RX yet).
Logging is switched on again, but with minimal output only (suitable
for small F0 MCUs). CAN is activated by default for MPPT 2420 LC.
2020-01-30 16:54:58 +01:00
Martin Jaeger
e078b87553
Zephyr: MPPT 2420 LC board added
2020-01-29 11:03:09 +01:00
Martin Jaeger
eed8c9114c
Coding style updated/fixed
...
Indentations of class definitions and preprocessor statements were not
uniform throughout the code. This commit cleans up indentations as well
as the order of include statements.
Style conventions see: https://github.com/LibreSolar/coding-style
2020-01-28 13:20:01 +01:00
Martin Jaeger
c04081fc8a
Make Serial and OLED configurable via Kconfig
2020-01-28 12:13:54 +01:00
azeemshatp
f830389c33
Implemented Thingset Serial functionality in Zephyr framework.
...
Implemented using UART driver APIs.
2020-01-23 08:06:13 +01:00
Martin Jaeger
d5ea6b5653
Zephyr: Custom DTS binding for GPIO switch
...
Previously, the LED binding was abused. DTS is now much cleaner.
2020-01-18 15:56:57 +01:00
Martin Jaeger
a76b92c27b
time(NULL) replaced with uptime() in helper files
...
Reason: Zephyr does not support time(NULL). This way it is portable.
2020-01-16 20:04:37 +01:00
Martin Jaeger
90f4c9af00
ThingSet and OLED libs added as git submodules
2020-01-07 07:40:46 +01:00
Martin Jaeger
16ca793bb3
Port configuration based on Kconfig implemented
2020-01-06 19:16:44 +01:00
Martin Jaeger
93418fc8c8
Fixed basic nanogrid port implementation
...
Instead of SOLAR_TERMINAL, GRID_TERMINAL has to be defined in config.h
(see also template).
2019-12-20 14:52:57 +01:00
Martin Jaeger
53ae6d4608
File headers shortened using SPDX-License-Identifier
2019-12-20 11:40:10 +01:00
Martin Jaeger
dc270372af
OLED display integrated with Zephyr
...
- Some fixes in DTS and pinmux settings
- Supporting different I2C address definitions of mbed and zephyr
- Thread for ext_mgr added
2019-12-20 10:51:00 +01:00
Martin Jaeger
117455390b
OLED library refactoring to prepare Zephyr integration
...
- Made Adafruit GFX library independent of mbed Stream class
- Major cleanup/rewrite of SSD1306 specific class
- Dynamically allocated std::vector display buffer replaced with statically
allocated std::array (leads to more calculated RAM usage only because
previous heap usage is not considered in memory summary)
- Commands for brightness control and to prevent shifted display now
integrated in SSD1306 class
2019-12-20 10:44:53 +01:00
Martin Jaeger
8c3c08df26
Removed broken mbed USB CDC libraries
2019-12-20 10:44:21 +01:00
Martin Jaeger
3f89943edf
ThingSet interfaces merged with Ext interfaces
2019-12-20 10:43:51 +01:00
Martin Jaeger
4326d74fe2
UExt interfaces simplified and renamed to Ext
2019-12-20 10:42:45 +01:00
Martin Jaeger
62f2f1978c
UEXT and ThingSet code moved to ext folder
2019-12-20 10:38:31 +01:00