Private
Public Access
2
0

mraa: initial implementation of "hooks"

* Should allow for more platform quirks to be handled by mraa without
* massive conditional areas per platform.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-06-27 15:37:48 +01:00
parent b6c56911c3
commit d0ea43f8d1
10 changed files with 209 additions and 28 deletions

21
docs/platform-hooks.md Normal file
View File

@@ -0,0 +1,21 @@
Hooks can be defined per supported platform to allow for highly custom operations if needed.
This feature of MRAA should only be used by developers defining the board definitions, NOT an end user.
## Types of Hooks
** REPLACE **
Defining a replace function will entirely replace the associate function. This should only be done if your new function can handle everything the mraa function would normally.
** PRE **
Any functionality defined here will be performed when the main function is called.
** POST **
Any functionality perfomed here is done just before the normal function returns. All post functions will have passed into them the return value that would normally be returned.
## Hooks
** gpio **
* init (pre-post) - On RAW functions
* mode (replace-pre-post)
* dir (replace-pre-post)
* write (pre-post)
* use-mmaped (replace-pre-post)