Skip to content
Snippets Groups Projects
Commit 7422956c authored by rahix's avatar rahix
Browse files

Merge 'Update CHANGELOG and Documentation'

See merge request card10/firmware!394
parents 46632854 c686b7cf
No related branches found
No related tags found
No related merge requests found
Pipeline #4714 passed
......@@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- `leds.flash_rocket()` API for making rockets flash asynchronously.
- Basic API for the MAX86150 pulse-oximeter.
- A feature to allow setting the main app on-device.
- Added compatibility to BLE 5.0 capable phones (including iPhones).
- Added pairing dialog in BLE app. Device is only visible when BLE app is
active.
- Option to write HCI layer log files for debugging.
- _Stub_ `ubluetooth` module. Not yet functional!
### Changed
- Internal changes to the way interrupts are triggered.
- Updated to a newer version of MicryPython (v1.12).
- Improved BLE security by only allowing man-in-the-middle protected
pairings and specifying minimum key lengths.
### Fixed
- Made the `vibra` vibration motor API more stable.
- Fixed bug which triggered reboot loops.
- Fixed bug which made the USB serial connection unresponsive.
- Fixed bug which wrote the pairings file more periodically.
- Fixed invalid filesystem locking in BLE startup.
## [v1.15] - 2020-02-02 - [Okra]
......
......@@ -114,8 +114,10 @@ autodoc_mock_imports = [
"sys_display",
"sys_leds",
"sys_max30001",
"sys_max86150",
"sys_config",
"ucollections",
"uerrno",
"urandom",
"utime",
]
......
......@@ -25,6 +25,7 @@ Last but not least, if you want to start hacking the lower-level firmware, the
pycardium/bhi160
pycardium/bme680
pycardium/max30001
pycardium/max86150
pycardium/buttons
pycardium/color
pycardium/config
......
``max86150`` - MAX86150
=======================
.. automodule:: max86150
:members:
......@@ -970,7 +970,7 @@ struct max86150_sensor_data {
* - ``-EINVAL``: config->ppg_sample_rate is not one of 10, 20, 50, 84, 100, 200
* or config_size is not size of config.
*
* .. versionadded:: 1.13
* .. versionadded:: 1.16
*/
API(API_MAX86150_ENABLE, int epic_max86150_enable_sensor(struct max86150_sensor_config *config, size_t config_size));
......@@ -979,7 +979,7 @@ API(API_MAX86150_ENABLE, int epic_max86150_enable_sensor(struct max86150_sensor_
*
* :returns: 0 in case of success or forward negative error value from stream_deregister.
*
* .. versionadded:: 1.13
* .. versionadded:: 1.16
*/
API(API_MAX86150_DISABLE, int epic_max86150_disable_sensor());
......
......@@ -104,7 +104,7 @@ def flash_rocket(led, value, millis):
:param int value: brightness value (0 < value < 32)
:param int millis: duration of the rocket being on in milliseconds.
.. versionadded:: 1.??
.. versionadded:: 1.16
"""
return sys_leds.flash_rocket(led, value, millis)
......
......@@ -8,22 +8,30 @@ Max86150Data = ucollections.namedtuple("Max86150Data", ["red", "infrared", "ecg"
class MAX86150:
"""
The MAX86150 class provides a stram interface to the MAX86150 PPG and ECG.
The MAX86150 class provides a stream interface to the MAX86150 PPG and ECG.
**Example**:
.. code-block:: python
import MAX86150
import max86150
m = max86150.MAX86150()
m.read()
data = m.read()
for sample in data:
print("Red: {} Infrared: {} ECG: {}", sample.red, sample.infrared, sample.ecg)
m.close()
.. versionadded:: 1.16
"""
def __init__(self, callback=None, sample_buffer_len=128, sample_rate=200):
"""
Initializes the MAX86150 (if it is not already running).
:param callback: If not None: A callback which is called with the data when ever new data is available
:param callback: If not None: A callback which is called with the data
when ever new data is available
"""
self.active = False
self.stream_id = -uerrno.ENODEV
......@@ -35,7 +43,9 @@ class MAX86150:
def enable_sensor(self):
"""
Enables the sensor. Automatically called by __init__.
Enables the sensor.
Automatically called when instanciating the sensor object.
"""
interrupt.disable_callback(self.interrupt_id)
interrupt.set_callback(self.interrupt_id, self._interrupt)
......@@ -68,7 +78,7 @@ class MAX86150:
def read(self):
"""
Read as many samples (signed integer) as currently available.
Read as many samples as currently available.
"""
assert self.active, "Sensor is inactive"
result = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment