Improve documentation and beatify pieces of code
This commit is contained in:
31
doc/source/firmware/hw-version-detect.rst
Normal file
31
doc/source/firmware/hw-version-detect.rst
Normal file
@@ -0,0 +1,31 @@
|
||||
.. _hw_version_detect:
|
||||
|
||||
Automatic Hardware Version detection
|
||||
====================================
|
||||
|
||||
Functional Description
|
||||
----------------------
|
||||
|
||||
In order to automatically select the available hardware features, the firmware checks the PCB's version
|
||||
using vertain pins on the microcontroller.
|
||||
|
||||
The hardware revision is represented by the enum type :c:enum:`hw_revision`. A call to :c:func:`get_pcb_hardware_version` retrieves the revision.
|
||||
When the function is called for the first time, it activates pull-up resistors on pin numbers :c:macro:`HW_REV_DETECT_PIN_LOW` to :c:macro:`HW_REV_DETECT_PIN_HIGH`
|
||||
on port :c:macro:`HW_REV_DETECT_GPIO` and reads in the binary number.
|
||||
|
||||
The revision is set by externally connecting the pins to ground. The bit pattern read from the port is inverted and then checked internally to derive the hardware version.
|
||||
After the version is read for the first time, it is stored internally and subsequent calls to :c:func:`get_pcb_hardware_version` only retrieve the internally stored value to reduce the overhead of the function.
|
||||
|
||||
Hardware Version Dependent Features
|
||||
-----------------------------------
|
||||
|
||||
- The settings module searches for an external EEPROM on the SPI interface to store some settings, like the calibration. This is enabled for all versions higher or equal to ``v1.3``.
|
||||
- The safety controller enables the acknowledging of the external watchdog for all versions higher or equal to ``v1.3``.
|
||||
- The oven driver has a separate safety enable for the solid state relay which it enables on all versions higher or equal to ``v1.3``.
|
||||
|
||||
|
||||
API Documentation
|
||||
-----------------
|
||||
|
||||
.. doxygengroup:: hw-version-detect
|
||||
:project: Reflow Controller Firmware
|
@@ -14,4 +14,5 @@ mechanisms and the behavior. For a detailed code documentation see the doxygen o
|
||||
pid-controller
|
||||
safety/index
|
||||
code/index
|
||||
hw-version-detect
|
||||
|
||||
|
@@ -21,4 +21,5 @@ which are used to retain boot information across resets, for example to communic
|
||||
flags
|
||||
backup-ram
|
||||
error-handling
|
||||
startup-tests
|
||||
stack-checking
|
||||
|
23
doc/source/firmware/safety/startup-tests.rst
Normal file
23
doc/source/firmware/safety/startup-tests.rst
Normal file
@@ -0,0 +1,23 @@
|
||||
.. _safety_startup_tests:
|
||||
|
||||
Startup Tests
|
||||
=============
|
||||
|
||||
The following tests will be performed after each reset / power cycle of the controller.
|
||||
|
||||
Internal Memory Test
|
||||
--------------------
|
||||
Directly after startup and after setting up the system clocks, the controller performs memory checks on the internal SRAM and the core coupled memory.
|
||||
|
||||
RAM checking is performed by testing the following sequences:
|
||||
|
||||
- Alternating 0x55AA55AA / 0xAA55AA55 pattern
|
||||
- Alternating 0xAA55AA55 / 0x55AA55AA pattern
|
||||
- 0xFFFFFFFF constant value
|
||||
- 0x00000000 constant value
|
||||
|
||||
The following functions implement the RAM checking:
|
||||
|
||||
.. doxygenfunction:: startup_test_perform_ccm_ram_check
|
||||
|
||||
.. doxygenfunction:: startup_test_perform_system_ram_check
|
Reference in New Issue
Block a user