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
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Ferdinand Bachmann
firmware
Commits
47c60713
Verified
Commit
47c60713
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
style(api): Unify style of API-call declarations
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
f8aada27
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
epicardium/epicardium.h
+80
-73
80 additions, 73 deletions
epicardium/epicardium.h
with
80 additions
and
73 deletions
epicardium/epicardium.h
+
80
−
73
View file @
47c60713
...
@@ -309,8 +309,7 @@ API(API_THERMISTOR_VOLTAGE, int epic_read_thermistor_voltage(float *result));
...
@@ -309,8 +309,7 @@ API(API_THERMISTOR_VOLTAGE, int epic_read_thermistor_voltage(float *result));
* :param length: Amount of bytes to print.
* :param length: Amount of bytes to print.
*/
*/
API
(
API_UART_WRITE_STR
,
void
epic_uart_write_str
(
API
(
API_UART_WRITE_STR
,
void
epic_uart_write_str
(
const
char
*
str
,
const
char
*
str
,
intptr_t
length
intptr_t
length
));
));
/**
/**
...
@@ -494,7 +493,9 @@ enum gpio_mode {
...
@@ -494,7 +493,9 @@ enum gpio_mode {
* :param uint8_t mode: Mode to be configured. Use a combination of the :c:type:`gpio_mode` flags.
* :param uint8_t mode: Mode to be configured. Use a combination of the :c:type:`gpio_mode` flags.
* :returns: ``0`` if the mode was set, ``-EINVAL`` if ``pin`` is not valid or the mode could not be set.
* :returns: ``0`` if the mode was set, ``-EINVAL`` if ``pin`` is not valid or the mode could not be set.
*/
*/
API
(
API_GPIO_SET_PIN_MODE
,
int
epic_gpio_set_pin_mode
(
uint8_t
pin
,
uint8_t
mode
));
API
(
API_GPIO_SET_PIN_MODE
,
int
epic_gpio_set_pin_mode
(
uint8_t
pin
,
uint8_t
mode
));
/**
/**
* Get the mode of a card10 GPIO pin.
* Get the mode of a card10 GPIO pin.
...
@@ -601,7 +602,9 @@ API(API_LEDS_SET, void epic_leds_set(int led, uint8_t r, uint8_t g, uint8_t b));
...
@@ -601,7 +602,9 @@ API(API_LEDS_SET, void epic_leds_set(int led, uint8_t r, uint8_t g, uint8_t b));
* :param float s: Saturation component of the color. (0 <= s <= 1)
* :param float s: Saturation component of the color. (0 <= s <= 1)
* :param float v: Value/Brightness component of the color. (0 <= v <= 0)
* :param float v: Value/Brightness component of the color. (0 <= v <= 0)
*/
*/
API
(
API_LEDS_SET_HSV
,
void
epic_leds_set_hsv
(
int
led
,
float
h
,
float
s
,
float
v
));
API
(
API_LEDS_SET_HSV
,
void
epic_leds_set_hsv
(
int
led
,
float
h
,
float
s
,
float
v
));
/**
/**
* Set multiple of card10's RGB LEDs to a certain color in RGB format.
* Set multiple of card10's RGB LEDs to a certain color in RGB format.
...
@@ -624,7 +627,9 @@ API(API_LEDS_SET_ALL, void epic_leds_set_all(uint8_t *pattern, uint8_t len));
...
@@ -624,7 +627,9 @@ API(API_LEDS_SET_ALL, void epic_leds_set_all(uint8_t *pattern, uint8_t len));
* LEDs. (0 <= h < 360, 0 <= s <= 1, 0 <= v <= 1)
* LEDs. (0 <= h < 360, 0 <= s <= 1, 0 <= v <= 1)
* :param uint8_t len: Length of 1st dimension of ``pattern``, see above.
* :param uint8_t len: Length of 1st dimension of ``pattern``, see above.
*/
*/
API
(
API_LEDS_SET_ALL_HSV
,
void
epic_leds_set_all_hsv
(
float
*
pattern
,
uint8_t
len
));
API
(
API_LEDS_SET_ALL_HSV
,
void
epic_leds_set_all_hsv
(
float
*
pattern
,
uint8_t
len
));
/**
/**
* Prepare one of card10's RGB LEDs to be set to a certain color in RGB format.
* Prepare one of card10's RGB LEDs to be set to a certain color in RGB format.
...
@@ -637,7 +642,9 @@ API(API_LEDS_SET_ALL_HSV, void epic_leds_set_all_hsv(float *pattern, uint8_t len
...
@@ -637,7 +642,9 @@ API(API_LEDS_SET_ALL_HSV, void epic_leds_set_all_hsv(float *pattern, uint8_t len
* :param uint8_t g: Green component of the color.
* :param uint8_t g: Green component of the color.
* :param uint8_t b: Blue component of the color.
* :param uint8_t b: Blue component of the color.
*/
*/
API
(
API_LEDS_PREP
,
void
epic_leds_prep
(
int
led
,
uint8_t
r
,
uint8_t
g
,
uint8_t
b
));
API
(
API_LEDS_PREP
,
void
epic_leds_prep
(
int
led
,
uint8_t
r
,
uint8_t
g
,
uint8_t
b
));
/**
/**
* Prepare one of card10's RGB LEDs to be set to a certain color in HSV format.
* Prepare one of card10's RGB LEDs to be set to a certain color in HSV format.
...
@@ -650,7 +657,9 @@ API(API_LEDS_PREP, void epic_leds_prep(int led, uint8_t r, uint8_t g, uint8_t b)
...
@@ -650,7 +657,9 @@ API(API_LEDS_PREP, void epic_leds_prep(int led, uint8_t r, uint8_t g, uint8_t b)
* :param uint8_t s: Saturation component of the color. (float, 0 <= s <= 1)
* :param uint8_t s: Saturation component of the color. (float, 0 <= s <= 1)
* :param uint8_t v: Value/Brightness component of the color. (float, 0 <= v <= 0)
* :param uint8_t v: Value/Brightness component of the color. (float, 0 <= v <= 0)
*/
*/
API
(
API_LEDS_PREP_HSV
,
void
epic_leds_prep_hsv
(
int
led
,
float
h
,
float
s
,
float
v
));
API
(
API_LEDS_PREP_HSV
,
void
epic_leds_prep_hsv
(
int
led
,
float
h
,
float
s
,
float
v
));
/**
/**
* Set global brightness for top RGB LEDs.
* Set global brightness for top RGB LEDs.
...
@@ -733,8 +742,7 @@ API(API_LEDS_SET_FLASHLIGHT, void epic_set_flashlight(bool power));
...
@@ -733,8 +742,7 @@ API(API_LEDS_SET_FLASHLIGHT, void epic_set_flashlight(bool power));
* :param uint8_t[256] gamma_table: Gamma lookup table. (default = 4th order power function rounded up)
* :param uint8_t[256] gamma_table: Gamma lookup table. (default = 4th order power function rounded up)
*/
*/
API
(
API_LEDS_SET_GAMMA_TABLE
,
void
epic_leds_set_gamma_table
(
API
(
API_LEDS_SET_GAMMA_TABLE
,
void
epic_leds_set_gamma_table
(
uint8_t
rgb_channel
,
uint8_t
rgb_channel
,
uint8_t
*
gamma_table
uint8_t
*
gamma_table
));
));
/**
/**
...
@@ -744,7 +752,9 @@ API(API_LEDS_SET_GAMMA_TABLE, void epic_leds_set_gamma_table(
...
@@ -744,7 +752,9 @@ API(API_LEDS_SET_GAMMA_TABLE, void epic_leds_set_gamma_table(
* :param uint8_t g: Value for the green color channel.
* :param uint8_t g: Value for the green color channel.
* :param uint8_t b: Value for the blue color channel.
* :param uint8_t b: Value for the blue color channel.
*/
*/
API
(
API_LEDS_CLEAR_ALL
,
void
epic_leds_clear_all
(
uint8_t
r
,
uint8_t
g
,
uint8_t
b
));
API
(
API_LEDS_CLEAR_ALL
,
void
epic_leds_clear_all
(
uint8_t
r
,
uint8_t
g
,
uint8_t
b
));
/**
/**
* BME680
* BME680
...
@@ -811,8 +821,9 @@ API(API_BME680_DEINIT, int epic_bme680_deinit());
...
@@ -811,8 +821,9 @@ API(API_BME680_DEINIT, int epic_bme680_deinit());
* - ``-EIO``: Communication with the device failed.
* - ``-EIO``: Communication with the device failed.
* - ``-ENODEV``: Device was not found.
* - ``-ENODEV``: Device was not found.
*/
*/
API
(
API_BME680_GET_DATA
,
API
(
API_BME680_GET_DATA
,
int
epic_bme680_read_sensors
(
int
epic_bme680_read_sensors
(
struct
bme680_sensor_data
*
data
));
struct
bme680_sensor_data
*
data
));
/**
/**
* Personal State
* Personal State
...
@@ -855,8 +866,9 @@ enum personal_state {
...
@@ -855,8 +866,9 @@ enum personal_state {
* :param bool persistent: Indicates whether the configured personal state will remain set and active on pycardium application restart/change.
* :param bool persistent: Indicates whether the configured personal state will remain set and active on pycardium application restart/change.
* :returns: ``0`` on success, ``-EINVAL`` if an invalid state was requested.
* :returns: ``0`` on success, ``-EINVAL`` if an invalid state was requested.
*/
*/
API
(
API_PERSONAL_STATE_SET
,
int
epic_personal_state_set
(
uint8_t
state
,
API
(
API_PERSONAL_STATE_SET
,
int
epic_personal_state_set
(
bool
persistent
));
uint8_t
state
,
bool
persistent
));
/**
/**
* Get the users personal state.
* Get the users personal state.
...
@@ -1301,15 +1313,14 @@ enum disp_font_name {
...
@@ -1301,15 +1313,14 @@ enum disp_font_name {
*
*
* - ``-EBUSY``: Display was already locked from another task.
* - ``-EBUSY``: Display was already locked from another task.
*/
*/
API
(
API_DISP_PRINT_ADV
,
API
(
API_DISP_PRINT_ADV
,
int
epic_disp_print_adv
(
int
epic_disp_print_adv
(
uint8_t
font
,
uint8_t
font
,
uint16_t
posx
,
uint16_t
posx
,
uint16_t
posy
,
uint16_t
posy
,
const
char
*
pString
,
const
char
*
pString
,
uint16_t
fg
,
uint16_t
fg
,
uint16_t
bg
)
uint16_t
bg
);
)
);
/**
/**
* Fills the whole screen with one color
* Fills the whole screen with one color
...
@@ -1331,12 +1342,9 @@ API(API_DISP_CLEAR, int epic_disp_clear(uint16_t color));
...
@@ -1331,12 +1342,9 @@ API(API_DISP_CLEAR, int epic_disp_clear(uint16_t color));
*
*
* - ``-EBUSY``: Display was already locked from another task.
* - ``-EBUSY``: Display was already locked from another task.
*/
*/
API
(
API_DISP_PIXEL
,
API
(
API_DISP_PIXEL
,
int
epic_disp_pixel
(
int
epic_disp_pixel
(
uint16_t
x
,
uint16_t
y
,
uint16_t
color
uint16_t
x
,
));
uint16_t
y
,
uint16_t
color
)
);
/**
/**
* Draws a line on the display
* Draws a line on the display
...
@@ -1352,16 +1360,15 @@ API(API_DISP_PIXEL,
...
@@ -1352,16 +1360,15 @@ API(API_DISP_PIXEL,
*
*
* - ``-EBUSY``: Display was already locked from another task.
* - ``-EBUSY``: Display was already locked from another task.
*/
*/
API
(
API_DISP_LINE
,
API
(
API_DISP_LINE
,
int
epic_disp_line
(
int
epic_disp_line
(
uint16_t
xstart
,
uint16_t
xstart
,
uint16_t
ystart
,
uint16_t
ystart
,
uint16_t
xend
,
uint16_t
xend
,
uint16_t
yend
,
uint16_t
yend
,
uint16_t
color
,
uint16_t
color
,
enum
disp_linestyle
linestyle
,
enum
disp_linestyle
linestyle
,
uint16_t
pixelsize
)
uint16_t
pixelsize
);
)
);
/**
/**
* Draws a rectangle on the display
* Draws a rectangle on the display
...
@@ -1377,16 +1384,15 @@ API(API_DISP_LINE,
...
@@ -1377,16 +1384,15 @@ API(API_DISP_LINE,
*
*
* - ``-EBUSY``: Display was already locked from another task.
* - ``-EBUSY``: Display was already locked from another task.
*/
*/
API
(
API_DISP_RECT
,
API
(
API_DISP_RECT
,
int
epic_disp_rect
(
int
epic_disp_rect
(
uint16_t
xstart
,
uint16_t
xstart
,
uint16_t
ystart
,
uint16_t
ystart
,
uint16_t
xend
,
uint16_t
xend
,
uint16_t
yend
,
uint16_t
yend
,
uint16_t
color
,
uint16_t
color
,
enum
disp_fillstyle
fillstyle
,
enum
disp_fillstyle
fillstyle
,
uint16_t
pixelsize
)
uint16_t
pixelsize
);
)
);
/**
/**
* Draws a circle on the display
* Draws a circle on the display
...
@@ -1401,15 +1407,14 @@ API(API_DISP_RECT,
...
@@ -1401,15 +1407,14 @@ API(API_DISP_RECT,
*
*
* - ``-EBUSY``: Display was already locked from another task.
* - ``-EBUSY``: Display was already locked from another task.
*/
*/
API
(
API_DISP_CIRC
,
API
(
API_DISP_CIRC
,
int
epic_disp_circ
(
int
epic_disp_circ
(
uint16_t
x
,
uint16_t
x
,
uint16_t
y
,
uint16_t
y
,
uint16_t
rad
,
uint16_t
rad
,
uint16_t
color
,
uint16_t
color
,
enum
disp_fillstyle
fillstyle
,
enum
disp_fillstyle
fillstyle
,
uint16_t
pixelsize
)
uint16_t
pixelsize
);
)
);
/**
/**
* Immediately send the contents of a framebuffer to the display. This overrides
* Immediately send the contents of a framebuffer to the display. This overrides
...
@@ -1420,7 +1425,9 @@ API(API_DISP_CIRC,
...
@@ -1420,7 +1425,9 @@ API(API_DISP_CIRC,
*
*
* - ``-EBUSY``: Display was already locked from another task.
* - ``-EBUSY``: Display was already locked from another task.
*/
*/
API
(
API_DISP_FRAMEBUFFER
,
int
epic_disp_framebuffer
(
union
disp_framebuffer
*
fb
));
API
(
API_DISP_FRAMEBUFFER
,
int
epic_disp_framebuffer
(
union
disp_framebuffer
*
fb
));
/**
/**
...
@@ -1521,10 +1528,9 @@ API(API_FILE_READ, int epic_file_read(int fd, void* buf, size_t nbytes));
...
@@ -1521,10 +1528,9 @@ API(API_FILE_READ, int epic_file_read(int fd, void* buf, size_t nbytes));
* :return: ``< 0`` on error, ``nbytes`` on success. (Partial writes don't occur on success!)
* :return: ``< 0`` on error, ``nbytes`` on success. (Partial writes don't occur on success!)
*
*
*/
*/
API
(
API
(
API_FILE_WRITE
,
int
epic_file_write
(
API_FILE_WRITE
,
int
fd
,
const
void
*
buf
,
size_t
nbytes
int
epic_file_write
(
int
fd
,
const
void
*
buf
,
size_t
nbytes
)
));
);
/** */
/** */
API
(
API_FILE_FLUSH
,
int
epic_file_flush
(
int
fd
));
API
(
API_FILE_FLUSH
,
int
epic_file_flush
(
int
fd
));
...
@@ -1690,7 +1696,9 @@ API(API_RTC_GET_MILLISECONDS, uint64_t epic_rtc_get_milliseconds(void));
...
@@ -1690,7 +1696,9 @@ API(API_RTC_GET_MILLISECONDS, uint64_t epic_rtc_get_milliseconds(void));
/**
/**
* Sets the current RTC time in milliseconds
* Sets the current RTC time in milliseconds
*/
*/
API
(
API_RTC_SET_MILLISECONDS
,
void
epic_rtc_set_milliseconds
(
uint64_t
milliseconds
));
API
(
API_RTC_SET_MILLISECONDS
,
void
epic_rtc_set_milliseconds
(
uint64_t
milliseconds
));
/**
/**
* Schedule the RTC alarm for the given timestamp.
* Schedule the RTC alarm for the given timestamp.
...
@@ -1765,9 +1773,10 @@ struct max30001_sensor_config {
...
@@ -1765,9 +1773,10 @@ struct max30001_sensor_config {
};
};
/**
/**
* Enable a MAX30001 ecg sensor. Calling this funciton will instruct the
* Enable a MAX30001 ecg sensor.
* MAX30001 to collect data for this sensor. You can then
*
* retrieve the samples using :c:func:`epic_stream_read`.
* Calling this funciton will instruct the MAX30001 to collect data for this
* sensor. You can then retrieve the samples using :c:func:`epic_stream_read`.
*
*
* :param max30001_sensor_config* config: Configuration for this sensor.
* :param max30001_sensor_config* config: Configuration for this sensor.
* :returns: A sensor descriptor which can be used with
* :returns: A sensor descriptor which can be used with
...
@@ -1787,9 +1796,7 @@ API(API_MAX30001_ENABLE, int epic_max30001_enable_sensor(
...
@@ -1787,9 +1796,7 @@ API(API_MAX30001_ENABLE, int epic_max30001_enable_sensor(
*
*
* .. versionadded:: 1.6
* .. versionadded:: 1.6
*/
*/
API
(
API_MAX30001_DISABLE
,
int
epic_max30001_disable_sensor
(
API
(
API_MAX30001_DISABLE
,
int
epic_max30001_disable_sensor
());
void
));
/**
/**
* **Interrupt Service Routine** for :c:data:`EPIC_INT_MAX30001_ECG`
* **Interrupt Service Routine** for :c:data:`EPIC_INT_MAX30001_ECG`
...
...
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