Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
85a09a27
Commit
85a09a27
authored
5 years ago
by
Arist
Browse files
Options
Downloads
Patches
Plain Diff
add config_size
parent
a7d1f72a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
epicardium/epicardium.h
+10
-13
10 additions, 13 deletions
epicardium/epicardium.h
epicardium/modules/max86150.c
+7
-2
7 additions, 2 deletions
epicardium/modules/max86150.c
with
17 additions
and
15 deletions
epicardium/epicardium.h
+
10
−
13
View file @
85a09a27
...
@@ -897,8 +897,6 @@ struct max86150_sensor_config {
...
@@ -897,8 +897,6 @@ struct max86150_sensor_config {
* Possible values are 10, 20, 50, 84, 100, 200.
* Possible values are 10, 20, 50, 84, 100, 200.
*/
*/
uint16_t
ppg_sample_rate
;
uint16_t
ppg_sample_rate
;
/** Always zero. Reserved for future parameters. */
uint8_t
_padding
[
10
];
};
};
/**
/**
...
@@ -920,26 +918,25 @@ struct max86150_sensor_data {
...
@@ -920,26 +918,25 @@ struct max86150_sensor_data {
* data from the sensor. You can then retrieve the samples using
* data from the sensor. You can then retrieve the samples using
* :c:func:`epic_stream_read`.
* :c:func:`epic_stream_read`.
*
*
* :param max86150_sensor_config* config: Configuration for this sensor.
* :param size_t config_size: Size of ``config``.
* :returns: A sensor descriptor which can be used with
* :returns: A sensor descriptor which can be used with
* :c:func:`epic_stream_read` or a negative error value:
* :c:func:`epic_stream_read` or a negative error value:
*
*
* - ``-EBUSY``: The MAX86150 driver or I2C bus are currently busy with other tasks
* and could not be acquired for enabling a sensor.
* - ``-ENOMEM``: The MAX86150 driver failed to create a stream queue.
* - ``-ENOMEM``: The MAX86150 driver failed to create a stream queue.
* - ``-ENODEV``: The MAX86150 driver failed due to physical connectivity problem (broken wire, unpowered, etc).
* - ``-ENODEV``: The MAX86150 driver failed due to physical connectivity problem
* - ``-EINVAL``: config->ppg_sample_rate is not one of 10, 20, 50, 84, 100, 200.
* (broken wire, unpowered, etc).
* - ``-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.13
*/
*/
API
(
API_MAX86150_ENABLE
,
int
epic_max86150_enable_sensor
(
struct
max86150_sensor_config
*
config
));
API
(
API_MAX86150_ENABLE
,
int
epic_max86150_enable_sensor
(
struct
max86150_sensor_config
*
config
,
size_t
config_size
));
/**
/**
* Disable the MAX86150 sensor.
* Disable the MAX86150 sensor.
*
*
* :returns: 0 in case of success or a negative error value:
* :returns: 0 in case of success or forward negative error value from stream_deregister.
*
* - ``-EBUSY``: The MAX86150 driver or I2C bus are currently busy with other tasks and
* could not be acquired for enabling a sensor.
*
*
* .. versionadded:: 1.13
* .. versionadded:: 1.13
*/
*/
...
...
This diff is collapsed.
Click to expand it.
epicardium/modules/max86150.c
+
7
−
2
View file @
85a09a27
...
@@ -32,10 +32,15 @@ static struct stream_info max86150_stream;
...
@@ -32,10 +32,15 @@ static struct stream_info max86150_stream;
/* Active */
/* Active */
static
bool
max86150_sensor_active
=
false
;
static
bool
max86150_sensor_active
=
false
;
int
epic_max86150_enable_sensor
(
struct
max86150_sensor_config
*
config
)
int
epic_max86150_enable_sensor
(
{
struct
max86150_sensor_config
*
config
,
size_t
config_size
)
{
int
result
=
0
;
int
result
=
0
;
// if (sizeof(struct max86150_sensor_config) != config_size) {
// return -EINVAL;
// }
mutex_lock
(
&
max86150_mutex
);
mutex_lock
(
&
max86150_mutex
);
hwlock_acquire
(
HWLOCK_I2C
);
hwlock_acquire
(
HWLOCK_I2C
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment