Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
a867aeab
Commit
a867aeab
authored
6 years ago
by
Joakim Nohlgård
Browse files
Options
Downloads
Patches
Plain Diff
periph/i2c: Add precondition on i2c_acquire for i2c bus access
parent
364c528d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/include/periph/i2c.h
+16
-0
16 additions, 0 deletions
drivers/include/periph/i2c.h
with
16 additions
and
0 deletions
drivers/include/periph/i2c.h
+
16
−
0
View file @
a867aeab
...
...
@@ -243,6 +243,8 @@ int i2c_release(i2c_t dev);
* @note This function is using a repeated start sequence for reading from
* the specified register address.
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] reg register address to read from (8- or 16-bit,
* right-aligned)
...
...
@@ -269,6 +271,8 @@ int i2c_read_reg(i2c_t dev, uint16_t addr, uint16_t reg,
* @note This function is using a repeated start sequence for reading from
* the specified register address.
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] reg register address to read from (8- or 16-bit,
* right-aligned)
...
...
@@ -294,6 +298,8 @@ int i2c_read_regs(i2c_t dev, uint16_t addr, uint16_t reg,
* @note This function is using a repeated start sequence for reading from
* the specified register address.
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] addr 7-bit or 10-bit device address (right-aligned)
* @param[out] data memory location to store received data
...
...
@@ -316,6 +322,8 @@ int i2c_read_byte(i2c_t dev, uint16_t addr, void *data, uint8_t flags);
* @note This function is using a repeated start sequence for reading from
* the specified register address.
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] addr 7-bit or 10-bit device address (right-aligned)
* @param[out] data memory location to store received data
...
...
@@ -337,6 +345,8 @@ int i2c_read_bytes(i2c_t dev, uint16_t addr,
/**
* @brief Convenience function for writing a single byte onto the bus
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] addr 7-bit or 10-bit device address (right-aligned)
* @param[in] data byte to write to the device
...
...
@@ -355,6 +365,8 @@ int i2c_write_byte(i2c_t dev, uint16_t addr, uint8_t data, uint8_t flags);
/**
* @brief Convenience function for writing several bytes onto the bus
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] addr 7-bit or 10-bit device address (right-aligned)
* @param[in] data array holding the bytes to write to the device
...
...
@@ -379,6 +391,8 @@ int i2c_write_bytes(i2c_t dev, uint16_t addr, const void *data,
* @note This function is using a repeated start sequence for writing to the
* specified register address.
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] reg register address to read from (8- or 16-bit,
* right-aligned)
...
...
@@ -403,6 +417,8 @@ int i2c_write_reg(i2c_t dev, uint16_t addr, uint16_t reg,
* @note This function is using a repeated start sequence for writing to the
* specified register address.
*
* @pre i2c_acquire must be called before accessing the bus
*
* @param[in] dev I2C peripheral device
* @param[in] reg register address to read from (8- or 16-bit,
* right-aligned)
...
...
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