[GitHub] incubator-mynewt-site pull request: Add mqueue documentation

2016-03-03 Thread wes3
GitHub user wes3 opened a pull request:

https://github.com/apache/incubator-mynewt-site/pull/30

Add mqueue documentation



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/incubator-mynewt-site mqueue

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-mynewt-site/pull/30.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #30


commit 736ca9a059a833cf2e941d055d76608b64fd764b
Author: wes3 
Date:   2016-03-04T06:53:32Z

Add mqueue documentation




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-mynewt-site git commit: Add mqueue documentation

2016-03-03 Thread wes3
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/mqueue [created] 736ca9a05


Add mqueue documentation


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/736ca9a0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/736ca9a0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/736ca9a0

Branch: refs/heads/mqueue
Commit: 736ca9a059a833cf2e941d055d76608b64fd764b
Parents: 7451406
Author: wes3 
Authored: Thu Mar 3 22:53:32 2016 -0800
Committer: wes3 
Committed: Thu Mar 3 22:53:32 2016 -0800

--
 docs/os/core_os/mbuf/mbuf.md | 12 
 docs/os/core_os/mqueue/mqueue.md | 96 +++
 docs/os/core_os/mqueue/os_mqueue_get.md  | 44 
 docs/os/core_os/mqueue/os_mqueue_init.md | 35 ++
 docs/os/core_os/mqueue/os_mqueue_put.md  | 45 +
 docs/os/core_os/msys/msys.md | 20 ++
 mkdocs.yml   |  2 +-
 7 files changed, 241 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/736ca9a0/docs/os/core_os/mbuf/mbuf.md
--
diff --git a/docs/os/core_os/mbuf/mbuf.md b/docs/os/core_os/mbuf/mbuf.md
index 7b445b3..472d96a 100644
--- a/docs/os/core_os/mbuf/mbuf.md
+++ b/docs/os/core_os/mbuf/mbuf.md
@@ -156,18 +156,6 @@ mbuf_usage_example2(struct mbuf *rxpkt)
 
 
 
-# Msys
-
-msys stands for "system mbufs" and is set of API built on top of the mbuf 
code. The basic idea behind msys is the following. The developer can create 
different size mbuf pools and register them with msys. The application then 
allocates mbufs using the msys API (as opposed to the mbuf API). The msys code 
will choose the mbuf pool with the smallest mbufs that can accommodate the 
requested size. 
-
-Let us walk through an example where the user registers three mbuf pools with 
msys: one with 32 byte mbufs, one with 256 and one with 2048. If the user 
requests an mbuf with 10 bytes, the 32-byte mbuf pool is used. If the request 
is for 33 bytes the 256 byte mbuf pool is used. If an mbuf data size is 
requested that is larger than any of the pools (say, 4000 bytes) the largest 
pool is used. While this behaviour may not be optimal in all cases that is the 
currently implemented behaviour. All this means is that the user is not 
guaranteed that a single mbuf can hold the requested data.
-
-The msys code will not allocate an mbuf from a larger pool if the chosen mbuf 
pool is empty. Similarly, the msys code will not chain together a number of 
smaller mbufs to accommodate the requested size. While this behaviour may 
change in future implementations the current code will simply return NULL. 
Using the above example, say the user requests 250 bytes. The msys code chooses 
the appropriate pool (i.e. the 256 byte mbuf pool) and attempts to allocate an 
mbuf from that pool. If that pool is empty, NULL is returned even though the 32 
and 2048 byte pools are not empty.
-
-Note that no added descriptions on how to use the msys API are presented here 
(other than in the API descriptions themselves) as the msys API is used in 
exactly the same manner as the mbuf API. The only difference is that mbuf pools 
are added to msys by calling `os_msys_register().`
-
-  
-
 ## Data Structures
 
 ```no-highlight

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/736ca9a0/docs/os/core_os/mqueue/mqueue.md
--
diff --git a/docs/os/core_os/mqueue/mqueue.md b/docs/os/core_os/mqueue/mqueue.md
index e69de29..93e3c7b 100644
--- a/docs/os/core_os/mqueue/mqueue.md
+++ b/docs/os/core_os/mqueue/mqueue.md
@@ -0,0 +1,96 @@
+# Mqueue
+
+Mqueue (Mbuf event queue) is a set of API built on top of the mbuf and event 
queue code. A typical networking stack operation is to put a packet on a queue 
and post an event to the task handling that queue. Mqueue was designed to 
provide a common api so that individual packages would not each have to create 
similar code.
+
+The mqueue data structure consists of a queue head pointer (a "stailq" queue; 
a singly linked list with head structure having a pointer to the start and end 
of the list) and an os event structure. Packets (packet header mbufs) are added 
to the queue using the *omp_next* pointer in the `os_mbuf_pkthdr` structure of 
the mbuf. The event is used to post  a task an event of type 
OS_EVENT_T_MQUEUE_DATA. 
+
+  
+
+## Using Mqueue
+
+The following code sample will demonstrate how to use an mqueue. This is a 
simple example where packets are put on a ""receive queue"" and a task 
processes that receive queue by incrementing 

[GitHub] incubator-mynewt-site pull request: Removal of os_mutex_delete and...

2016-03-03 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-mynewt-site/pull/25


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[1/2] incubator-mynewt-site git commit: Removal of os_mutex_delete and os_sem_delete from the documentation as they are no longer in the code

2016-03-03 Thread aditi
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/master 74514067b -> b68598e50


Removal of os_mutex_delete and os_sem_delete from the documentation as they are 
no longer in the code


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/26867f1d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/26867f1d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/26867f1d

Branch: refs/heads/master
Commit: 26867f1d60ac5e1cd62c3f7e9a4ab7e00f0b2ec9
Parents: 9ee8142
Author: wes3 
Authored: Wed Mar 2 14:02:40 2016 -0800
Committer: wes3 
Committed: Wed Mar 2 14:02:40 2016 -0800

--
 docs/os/core_os/mutex/mutex.md |  1 -
 docs/os/core_os/mutex/os_mutex_delete.md   | 33 --
 docs/os/core_os/semaphore/os_sem_delete.md | 37 -
 docs/os/core_os/semaphore/semaphore.md |  1 -
 mkdocs.yml |  2 --
 5 files changed, 74 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/26867f1d/docs/os/core_os/mutex/mutex.md
--
diff --git a/docs/os/core_os/mutex/mutex.md b/docs/os/core_os/mutex/mutex.md
index 08b9487..f053e31 100644
--- a/docs/os/core_os/mutex/mutex.md
+++ b/docs/os/core_os/mutex/mutex.md
@@ -41,7 +41,6 @@ struct os_mutex
 
 The functions available in this OS feature are:
 
-* [os_mutex_delete](os_mutex_delete)
 * [os_mutex_init](os_mutex_init)
 * [os_mutex_pend](os_mutex_pend)
 * [os_mutex_release](os_mutex_release)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/26867f1d/docs/os/core_os/mutex/os_mutex_delete.md
--
diff --git a/docs/os/core_os/mutex/os_mutex_delete.md 
b/docs/os/core_os/mutex/os_mutex_delete.md
deleted file mode 100644
index 29155b6..000
--- a/docs/os/core_os/mutex/os_mutex_delete.md
+++ /dev/null
@@ -1,33 +0,0 @@
-## os_mutex_delete 
-
-```no-highlight
-os_error_t os_mutex_pend(struct os_mutex *mu)
-```
-
-Delete a mutex
-
- Arguments
-
-| Arguments | Description |
-|---|-|
-| *mu |  Pointer to mutex  |
-
- Returned values
-
-OS_INVALID_PARM: returned when *mu is NULL on entry.
-
-OS_OK: mutex initialized successfully.
-
-OS_NOT_STARTED: Attempt to release a mutex before the os has been started.
-
- Example
-
-```no-highlight
-struct os_mutex g_mutex1;
-os_error_t err;
-
-err = os_mutex_delete(_mutex1);
-assert(err == OS_OK);
-```
-
--

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/26867f1d/docs/os/core_os/semaphore/os_sem_delete.md
--
diff --git a/docs/os/core_os/semaphore/os_sem_delete.md 
b/docs/os/core_os/semaphore/os_sem_delete.md
deleted file mode 100644
index 26a340d..000
--- a/docs/os/core_os/semaphore/os_sem_delete.md
+++ /dev/null
@@ -1,37 +0,0 @@
-##  os_sem_delete 
-
-```no-highlight
-os_error_t os_sem_delete(struct os_sem *sem)
-```
-
-Delete a semaphore
-
- Arguments
-
-| Arguments | Description |
-|---|-|
-| *sem |  Pointer to semaphore  |
-
- Returned values
-
-OS_INVALID_PARM: returned when *sem is NULL on entry.
-
-OS_OK: semaphore deleted successfully.
-
-OS_NOT_STARTED: Attempt to release a semaphore before os started.
-
- Notes 
-
-Care must be taken when deleting a semaphore as deleting a semaphore used by 
other tasks could causes unexpected/unwanted behavior.
-
- Example
-
-```no-highlight
-struct os_sem g_os_sem;
-os_error_t err;
-
-err = os_sem_delete(_os_sem);
-assert(err == OS_OK);
-```
-
--

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/26867f1d/docs/os/core_os/semaphore/semaphore.md
--
diff --git a/docs/os/core_os/semaphore/semaphore.md 
b/docs/os/core_os/semaphore/semaphore.md
index b36a624..cbf7abc 100644
--- a/docs/os/core_os/semaphore/semaphore.md
+++ b/docs/os/core_os/semaphore/semaphore.md
@@ -35,7 +35,6 @@ struct os_sem
 
 The functions available in semaphore are:
 
-* [os_sem_delete](os_sem_delete)
 * [os_sem_init](os_sem_init)
 * [os_sem_pend](os_sem_pend)
 * [os_sem_release](os_sem_release)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/26867f1d/mkdocs.yml
--
diff --git a/mkdocs.yml b/mkdocs.yml
index 517647d..3760314 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -64,14 +64,12 @@ pages:
 - Semaphores: 
 - 'Overview': 'os/core_os/semaphore/semaphore.md'
 - 

[GitHub] incubator-mynewt-site pull request: Support ... in 'go get mynewt....

2016-03-03 Thread spoonofpower
GitHub user spoonofpower opened a pull request:

https://github.com/apache/incubator-mynewt-site/pull/29

Support ... in 'go get mynewt.apache.org/newt/...'



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/spoonofpower/incubator-mynewt-site 
go_submodules

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-mynewt-site/pull/29.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #29


commit aa9d5262753c0620474be130d55a9a647ee4373a
Author: spoonofpower 
Date:   2016-03-04T01:09:13Z

Support ... in 'go get mynewt.apache.org/newt/...'




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-mynewt-site pull request: Mynewt 215

2016-03-03 Thread paulfdietrich
GitHub user paulfdietrich opened a pull request:

https://github.com/apache/incubator-mynewt-site/pull/28

Mynewt 215

This includes the documentation for arduino blinky and also include two 
small fixes for the porting work.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/paulfdietrich/incubator-mynewt-site MYNEWT-215

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-mynewt-site/pull/28.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #28


commit 652a89dc3f7ce06ac62d1d3a50938c38dc75b006
Author: Paul Dietrich 
Date:   2016-03-01T21:54:05Z

basic changes to support structure for porting sections

commit 8b5b99dfdf36f8bcdf367969f59c25dfdaa178ef
Author: Paul Dietrich 
Date:   2016-03-01T21:58:19Z

fixed a type in the file which caused mkdocs build error

commit c2bd198bffdab7b9f279622bc9ea230ff17d4910
Author: Paul Dietrich 
Date:   2016-03-03T20:29:19Z

documentation for arduino blinky tutorial




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[3/6] incubator-mynewt-site git commit: added shell functions. Added mbuf sections. This closes #24.

2016-03-03 Thread aditi
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/core_os/msys/os_msys_reset/index.html
--
diff --git a/os/core_os/msys/os_msys_reset/index.html 
b/os/core_os/msys/os_msys_reset/index.html
new file mode 100644
index 000..74255ec
--- /dev/null
+++ b/os/core_os/msys/os_msys_reset/index.html
@@ -0,0 +1,622 @@
+
+
+
+
+
+
+
+
+http://mynewt.apache.org/os/core_os/msys/os_msys_reset/;>
+
+
+   os_msys_reset - Apache Mynewt
+
+
+
+
+
+
+
+https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css;>
+
+
+
+
+
+
+
+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
+ga('send', 'pageview');
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Toggle navigation
+
+
+
+
+
+
+
+
+
+
+
+
+Home
+
+
+Docs
+
+
+Download
+
+
+Community
+
+
+Events
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+  
+  Apache Mynewt Manual
+
+  
+  
+  
+  
+
+  Introduction
+
+  
+
+  
+  
+  
+  Get Started
+
+  
+
+  
+  
+  
+  Tutorials
+
+  
+
+  
+  
+  
+  OS User Guide
+
+  
+  
+  
+  
+  OS Core
+
+  
+  
+  
+  
+  OS Fundamentals
+
+  
+
+  
+  
+  
+  Scheduler
+
+  
+
+  
+  
+  
+  Time
+
+  
+
+  
+  
+  
+  Tasks
+
+  
+
+  
+  
+  
+  Event Queues
+
+  
+
+  
+  
+  
+  Semaphores
+
+  
+
+  
+  
+  
+  Mutexes
+
+  
+
+  
+  
+  
+  Memory Pools
+
+  
+
+  
+  
+  
+  Heap
+
+  
+
+  
+  
+  
+  Memory Buffers
+
+  
+  
+  
+  
+  Mbuf
+
+  
+
+  
+  
+  
+  Msys
+
+  
+  
+  
+  
+
+  Overview
+
+  
+
+  
+  
+  
+  Functions
+
+  
+  
+  
+  
+
+  os_msys_get
+
+  
+
+  
+  
+  
+
+  os_msys_get_pkthdr
+
+  
+
+  
+  
+  
+
+  os_msys_register
+
+  
+
+  
+  
+  
+
+  os_msys_reset
+
+  
+
+  
+  
+
+  
+
+  
+  
+
+  
+
+  
+  
+  
+  MQueue
+
+  
+
+  
+  
+
+  
+
+  
+  
+  
+  Sanity
+
+  
+
+  
+  
+  
+  Callouts
+
+  
+
+  
+  
+  
+
+  Porting to other Platforms
+
+  
+
+  
+  
+
+  
+
+  
+  
+  
+  Console
+
+  
+
+  
+  
+  
+  Shell
+
+  
+
+  
+  
+  
+  Bootloader
+
+  
+
+  
+  
+  
+
+  File System Abstraction
+
+  
+
+  
+  
+  
+
+  Newtron Flash File System
+
+  
+
+  
+  
+  
+  Hardware Abstraction Layer
+
+  
+
+  
+  
+  
+  Test Utilities
+
+  
+
+  
+  
+  
+  Image Manager
+
+  
+
+  
+  
+  
+
+  Baselibc library
+
+  
+
+  
+  
+  
+  Embedded Lua
+
+  
+
+  
+  
+  
+  JSON
+
+  
+
+  
+  
+
+  
+
+  
+  
+  
+  Networking User Guide
+
+  
+
+  
+  

[5/6] incubator-mynewt-site git commit: added shell functions. Added mbuf sections. This closes #24.

2016-03-03 Thread aditi
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/core_os/mbuf/mbuf/index.html
--
diff --git a/os/core_os/mbuf/mbuf/index.html b/os/core_os/mbuf/mbuf/index.html
index 0c0991e..45c300f 100644
--- a/os/core_os/mbuf/mbuf/index.html
+++ b/os/core_os/mbuf/mbuf/index.html
@@ -260,8 +260,19 @@
   
   
   Mbufs
+
+">Memory Buffers
+
+  
+  
+  
+  
+  Mbuf
 
   
   
@@ -290,12 +301,26 @@
   
   
   Msys
+
+  
+
+  
+  
+  
+  MQueue
 
   
 
   
+  
+
+  
+
+  
   
   
   os_mbuf_pool_init
 os_mbuf_prepend
 os_mbuf_pullup
-os_msys_get
-os_msys_get_pkthdr
-os_msys_register
-os_msys_reset
+os_msys_get
+os_msys_get_pkthdr
+os_msys_register
+os_msys_reset
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/core_os/mbuf/os_mbuf_adj/index.html
--
diff --git a/os/core_os/mbuf/os_mbuf_adj/index.html 
b/os/core_os/mbuf/os_mbuf_adj/index.html
index 74ba468..98a2add 100644
--- a/os/core_os/mbuf/os_mbuf_adj/index.html
+++ b/os/core_os/mbuf/os_mbuf_adj/index.html
@@ -260,8 +260,19 @@
   
   
   Memory Buffers
+
+  
+  
+  
+  
+  Mbufs
+">Mbuf
 
   
   
@@ -465,36 +476,9 @@
   
 
   
-  
-  
-
-  os_msys_get
-
-  
-
-  
-  
-  
-
-  os_msys_get_pkthdr
-
-  
-
-  
-  
-  
-
-  os_msys_register
-
-  
-
-  
-  
-  
-
-  os_msys_reset
-
-  
+  
+
+  
 
   
   
@@ -502,7 +486,11 @@
   
 
   
-  
+  
+  
+  Msys
 
   
 
@@ -516,6 +504,11 @@
   
 
   
+  
+
+  
+
+  
   
   
   http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/core_os/mbuf/os_mbuf_append/index.html
--
diff --git a/os/core_os/mbuf/os_mbuf_append/index.html 
b/os/core_os/mbuf/os_mbuf_append/index.html
index 64872a0..7a4f22c 100644
--- a/os/core_os/mbuf/os_mbuf_append/index.html
+++ b/os/core_os/mbuf/os_mbuf_append/index.html
@@ -260,8 +260,19 @@
   
   
   Memory Buffers
+
+  
+  
+  
+  
+  Mbufs
+">Mbuf
 
   
   
@@ -465,36 +476,9 @@
   
 
   
-  
-  
-
-  os_msys_get
-
-  
-
-  
-  
-  
-
-  os_msys_get_pkthdr
-
-  
-
-  
-  
-  
-
-  os_msys_register
-
-  
-
-  
-  
-  
-
-  os_msys_reset
-
-  
+  
+
+  
 
   
   
@@ -502,7 +486,11 @@
   
 
   
-  
+  
+  
+  Msys
 
   
 
@@ -516,6 +504,11 @@
   
 
   
+  
+
+  
+
+  
   
   
   http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/core_os/mbuf/os_mbuf_concat/index.html
--
diff --git a/os/core_os/mbuf/os_mbuf_concat/index.html 
b/os/core_os/mbuf/os_mbuf_concat/index.html
index 73b5a6b..907a291 100644
--- a/os/core_os/mbuf/os_mbuf_concat/index.html
+++ b/os/core_os/mbuf/os_mbuf_concat/index.html
@@ -260,8 +260,19 @@
   
   
   Memory Buffers
+
+  
+  
+  
+  
+  Mbufs
+">Mbuf
 
   
   
@@ -465,36 +476,9 @@
   
 
   
-  
-  
-
-  os_msys_get
-
-  
-
-  
-  
-  
-
-  os_msys_get_pkthdr
-
-  
-
-  
-  
-  
-
-  os_msys_register
-
-  
-
-  
-  
-  
-
-  os_msys_reset
-
-  
+  
+
+  
 
   
   
@@ -502,7 +486,11 @@
   
 
   
-  
+  
+  
+  Msys
 
   
 
@@ -516,6 +504,11 @@
   
 
   
+  
+
+  
+
+  
   
   
   http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/core_os/mbuf/os_mbuf_copydata/index.html
--
diff --git a/os/core_os/mbuf/os_mbuf_copydata/index.html 
b/os/core_os/mbuf/os_mbuf_copydata/index.html
index 4e97e0f..8f2b269 100644
--- a/os/core_os/mbuf/os_mbuf_copydata/index.html
+++ b/os/core_os/mbuf/os_mbuf_copydata/index.html
@@ -260,8 +260,19 @@
   
   
   Memory Buffers
+
+  
+  
+  
+  
+  Mbufs
+">Mbuf
 
   
   
@@ -465,36 +476,9 @@
   
 
   
-  
-  
-
-  os_msys_get
-
-  
-
-  
-  
-  
-
-  os_msys_get_pkthdr
-
-  
-
-  
-  
-  
-
-  

[4/6] incubator-mynewt-site git commit: added shell functions. Added mbuf sections. This closes #24.

2016-03-03 Thread aditi
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/core_os/mbuf/os_msys_reset/index.html
--
diff --git a/os/core_os/mbuf/os_msys_reset/index.html 
b/os/core_os/mbuf/os_msys_reset/index.html
deleted file mode 100644
index 9dd465b..000
--- a/os/core_os/mbuf/os_msys_reset/index.html
+++ /dev/null
@@ -1,781 +0,0 @@
-
-
-
-
-
-
-
-
-http://mynewt.apache.org/os/core_os/mbuf/os_msys_reset/;>
-
-
-   os_msys_reset - Apache Mynewt
-
-
-
-
-
-
-
-https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css;>
-
-
-
-
-
-
-
-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
-ga('send', 'pageview');
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Toggle navigation
-
-
-
-
-
-
-
-
-
-
-
-
-Home
-
-
-Docs
-
-
-Download
-
-
-Community
-
-
-Events
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  
-
-  
-
-  
-
-  
-
-  
-
-  
-
-  
-  
-  Apache Mynewt Manual
-
-  
-  
-  
-  
-
-  Introduction
-
-  
-
-  
-  
-  
-  Get Started
-
-  
-
-  
-  
-  
-  Tutorials
-
-  
-
-  
-  
-  
-  OS User Guide
-
-  
-  
-  
-  
-  OS Core
-
-  
-  
-  
-  
-  OS Fundamentals
-
-  
-
-  
-  
-  
-  Scheduler
-
-  
-
-  
-  
-  
-  Time
-
-  
-
-  
-  
-  
-  Tasks
-
-  
-
-  
-  
-  
-  Event Queues
-
-  
-
-  
-  
-  
-  Semaphores
-
-  
-
-  
-  
-  
-  Mutexes
-
-  
-
-  
-  
-  
-  Memory Pools
-
-  
-
-  
-  
-  
-  Heap
-
-  
-
-  
-  
-  
-  Mbufs
-
-  
-  
-  
-  
-
-  Overview
-
-  
-
-  
-  
-  
-  Functions/Macros
-
-  
-  
-  
-  
-
-  OS_MBUF_PKTHDR
-
-  
-
-  
-  
-  
-
-  OS_MBUF_PKTHDR_TO_MBUF
-
-  
-
-  
-  
-  
-
-  OS_MBUF_PKTLEN
-
-  
-
-  
-  
-  
-
-  OS_MBUF_DATA
-
-  
-
-  
-  
-  
-
-  OS_MBUF_USRHDR
-
-  
-
-  
-  
-  
-
-  OS_MBUF_USRHDR_LEN
-
-  
-
-  
-  
-  
-
-  OS_MBUF_LEADINGSPACE
-
-  
-
-  
-  
-  
-
-  OS_MBUF_TRAILINGSPACE
-
-  
-
-  
-  
-  
-
-  os_mbuf_adj
-
-  
-
-  
-  
-  
-
-  os_mbuf_append
-
-  
-
-  
-  
-  
-
-  os_mbuf_concat
-
-  
-
-  
-  
-  
-
-  os_mbuf_copydata
-
-  
-
-  
-  
-  
-
-  os_mbuf_copyinto
-
-  
-
-  
-  
-  
-
-  os_mbuf_dup
-
-  
-
-  
-  
-  
-
-  os_mbuf_extend
-
-  
-
-  
-  
-  
-
-  os_mbuf_free_chain
-
-  
-
-  
-  
-  
-
-  os_mbuf_get
-
-  
-
-  
-  
-  
-
-  os_mbuf_get_pkthdr
-
-  
-
-  
-  
-  
-
-  os_mbuf_memcmp
-
-  
-
-  
-  
-  
-
-  os_mbuf_off
-
-  
-
-  
-  
-  
-
-  os_mbuf_pool_init
-
-  
-
-  
-  
-  
-
-  os_mbuf_prepend

[1/6] incubator-mynewt-site git commit: added shell functions. Added mbuf sections. This closes #24.

2016-03-03 Thread aditi
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/asf-site a993b8370 -> aa5b35dba


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/aa5b35db/os/modules/shell/shell_os_mpool_display_cmd/index.html
--
diff --git a/os/modules/shell/shell_os_mpool_display_cmd/index.html 
b/os/modules/shell/shell_os_mpool_display_cmd/index.html
deleted file mode 100644
index 9941de0..000
--- a/os/modules/shell/shell_os_mpool_display_cmd/index.html
+++ /dev/null
@@ -1,562 +0,0 @@
-
-
-
-
-
-
-
-
-http://mynewt.apache.org/os/modules/shell/shell_os_mpool_display_cmd/;>
-
-
-   shell_os_mpool_display_cmd - Apache Mynewt
-
-
-
-
-
-
-
-https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css;>
-
-
-
-
-
-
-
-
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
-(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
-
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
-
-ga('create', 'UA-72162311-1', 'mynewt.incubator.apache.org');
-ga('send', 'pageview');
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Toggle navigation
-
-
-
-
-
-
-
-
-
-
-
-
-Home
-
-
-Docs
-
-
-Download
-
-
-Community
-
-
-Events
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  
-
-  
-
-  
-
-  
-
-  
-
-  
-
-  
-  
-  Apache Mynewt Manual
-
-  
-  
-  
-  
-
-  Introduction
-
-  
-
-  
-  
-  
-  Get Started
-
-  
-
-  
-  
-  
-  Tutorials
-
-  
-
-  
-  
-  
-  OS User Guide
-
-  
-  
-  
-  
-  OS Core
-
-  
-
-  
-  
-  
-  Console
-
-  
-
-  
-  
-  
-  Shell
-
-  
-  
-  
-  
-
-  Overview
-
-  
-
-  
-  
-  
-  Functions
-
-  
-  
-  
-  
-
-  shell_cmd
-
-  
-
-  
-  
-  
-
-  shell_cmd_list_lock
-
-  
-
-  
-  
-  
-
-  shell_cmd_list_unlock
-
-  
-
-  
-  
-  
-
-  shell_cmd_register
-
-  
-
-  
-  
-  
-
-  shell_console_rx_cb
-
-  
-
-  
-  
-  
-
-  shell_echo_cmd
-
-  
-
-  
-  
-  
-
-  shell_help_cmd
-
-  
-
-  
-  
-  
-
-  shell_nlip_input_register
-
-  
-
-  
-  
-  
-
-  shell_nlip_mqueue_process
-
-  
-
-  
-  
-  
-
-  shell_nlip_mtx
-
-  
-
-  
-  
-  
-
-  shell_nlip_output
-
-  
-
-  
-  
-  
-
-  shell_nlip_process
-
-  
-
-  
-  
-  
-
-  shell_os_mpool_display_cmd
-
-  
-
-  
-  
-  
-
-  shell_os_tasks_display_cmd
-
-  
-
-  
-  
-  
-
-  shell_process_command
-
-  
-
-  
-  
-  
-
-  shell_read_console
-
-  
-
-  
-  
-  
-
-  shell_task_func
-
-  
-
-  
-  
-  
-
-  shell_task_init
-
-  
-
-  
-  
-
-  
-
-  
-  
-
-  
-
-  
-  
-  
-  Bootloader
-
-  
-
-  
-  
-  
-
-  File System Abstraction
-
-  
-
-  
-  
-  
-
-  Newtron Flash File System
-
-  
-
-  
-  
-  
-  Hardware Abstraction Layer
-
-  
-
-  
-  
-  
-  Test Utilities
-
-  
-
-  
-  
-  
-  Image Manager
-
-  
-
-  
-   

incubator-mynewt-site git commit: shell functions added. mbuf split up. This closes #24.

2016-03-03 Thread aditi
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/master c9bd0d5a8 -> 74514067b


shell functions added. mbuf split up. This closes #24.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/74514067
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/74514067
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/74514067

Branch: refs/heads/master
Commit: 74514067b4bcbfe37bdfa3c36da1bf72df8f2630
Parents: c9bd0d5
Author: aditihilbert 
Authored: Thu Mar 3 16:55:09 2016 -0800
Committer: aditihilbert 
Committed: Thu Mar 3 16:55:09 2016 -0800

--
 docs/os/core_os/mbuf/os_msys_get.md | 46 
 docs/os/core_os/mbuf/os_msys_get_pkthdr.md  | 48 
 docs/os/core_os/mbuf/os_msys_register.md| 35 -
 docs/os/core_os/mbuf/os_msys_reset.md   | 33 -
 docs/os/core_os/msys/msys.md|  0
 docs/os/core_os/msys/os_msys_get.md | 46 
 docs/os/core_os/msys/os_msys_get_pkthdr.md  | 48 
 docs/os/core_os/msys/os_msys_register.md| 35 +
 docs/os/core_os/msys/os_msys_reset.md   | 33 +
 docs/os/modules/shell/shell.md  | 12 +--
 docs/os/modules/shell/shell_cmd_register.md |  4 +-
 .../modules/shell/shell_nlip_input_register.md  |  2 +-
 docs/os/modules/shell/shell_nlip_output.md  |  2 +-
 docs/os/modules/shell/shell_task_init.md|  3 +-
 mkdocs.yml  | 78 ++--
 15 files changed, 215 insertions(+), 210 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/74514067/docs/os/core_os/mbuf/os_msys_get.md
--
diff --git a/docs/os/core_os/mbuf/os_msys_get.md 
b/docs/os/core_os/mbuf/os_msys_get.md
deleted file mode 100644
index 6b0c607..000
--- a/docs/os/core_os/mbuf/os_msys_get.md
+++ /dev/null
@@ -1,46 +0,0 @@
-## os_msys_get
-
-```no-highlight
-struct os_mbuf *os_msys_get(uint16_t dsize, uint16_t leadingspace)
-```
-
-Retrieve an mbuf from the system mbuf pools with *leadingspace* bytes 
available in the mbuf.
-
-
-
- Arguments
-
-| Arguments | Description |
-|---|-|
-| dsize | Minimum requested size of mbuf. Actual mbuf allocated may not 
accommodate *dsize* |
-| leadingspace | Number of bytes for leading space in mbuf (space at start of 
mbuf) |
-
-
-
- Returned values
-Pointer to mbuf or NULL if no mbufs were available.
-
-
-
- Notes
-As described in the overview section, `os_msys_get()` may return an mbuf that 
is smaller than dsize, meaning that the mbuf user data buffer does not have 
enough contiguous space to hold *dsize* bytes.
-
-This API will not return an mbuf from a larger mbuf pool if the appropriate 
msys mbuf pool is empty. See the overview for more information.
-
-
-
- Example
-
-```no-highlight
-struct os_mbuf *om;
-
-/* Allocate an mbuf with hopefully at least 100 bytes in its user data 
buffer */
-om = os_msys_get(100, 0);
-if (!om) {
-/* No mbufs available. */
-return -1;
-}
-}
-```
-
--

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/74514067/docs/os/core_os/mbuf/os_msys_get_pkthdr.md
--
diff --git a/docs/os/core_os/mbuf/os_msys_get_pkthdr.md 
b/docs/os/core_os/mbuf/os_msys_get_pkthdr.md
deleted file mode 100644
index 12d2f1a..000
--- a/docs/os/core_os/mbuf/os_msys_get_pkthdr.md
+++ /dev/null
@@ -1,48 +0,0 @@
-## os_msys_get_pkthdr
-
-```no-highlight
-struct os_mbuf *os_msys_get_pkthdr(uint16_t dsize, uint16_t user_hdr_len)
-```
-
-Retrieve a packet header mbuf from the system mbuf pools with *user_hdr_len* 
bytes available for the user header in the mbuf.
-
-
-
- Arguments
-
-| Arguments | Description |
-|---|-|
-| dsize | Minimum requested size of mbuf. Actual mbuf allocated may not 
accommodate *dsize* |
-| user_hdr_len | Size, in of bytes, of user header in the mbuf |
-
-
-
- Returned values
-Pointer to mbuf or NULL if no mbufs were available.
-
-
-
- Notes
-The same notes apply to this API as to `os_msys_get()`.
-
-
-
- Example
-
-```no-highlight
-struct os_mbuf *om;
-struct my_user_hdr_struct my_usr_hdr;
-
-/*
- * Allocate an mbuf with hopefully at least 100 bytes in its user data 
buffer
- * and that has a user header of size sizeof(struct my_user_hdr_struct)
- */
-om = os_msys_get_pkthdr(100, sizeof(struct my_user_hdr_struct));
-if (!om) {
-/* No mbufs available. */
-return -1;
-}
-}
-```
-

[25/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc.h
deleted file mode 100755
index 60b41c2..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc.h
+++ /dev/null
@@ -1,2488 +0,0 @@
-/**
- * \file
- *
- * \brief SAM TCC - Timer Counter for Control Applications Driver
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef TCC_H_INCLUDED
-#define TCC_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_tcc_group SAM Timer Counter for Control Applications 
(TCC) Driver
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides 
an interface for the configuration
- * and management of the TCC module within the device, for waveform
- * generation and timing operations. It also provides extended options for
- * control applications.
- *
- * The following driver API modes are covered
- * by this manual:
- *
- *  - Polled APIs
- * \if TCC_CALLBACK_MODE
- *  - Callback APIs
- * \endif
- *
- * The following peripheral is used by this module:
- *  - TCC (Timer/Counter for Control Applications)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D10/D11
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM DA1
- *  - Atmel | SMART SAM C20/C21
- *
- * The outline of this documentation is as follows:
- *  - \ref asfdoc_sam0_tcc_prerequisites
- *  - \ref asfdoc_sam0_tcc_module_overview
- *  - \ref asfdoc_sam0_tcc_special_considerations
- *  - \ref asfdoc_sam0_tcc_extra_info
- *  - \ref asfdoc_sam0_tcc_examples
- *  - \ref asfdoc_sam0_tcc_api_overview
- *
- * \section asfdoc_sam0_tcc_prerequisites Prerequisites
- *
- * There are no prerequisites for this module.
- *
- * \section asfdoc_sam0_tcc_module_overview Module Overview
- *
- * The Timer/Counter for Control Applications (TCC) module provides a set of
- * timing and counting related functionality, such as the generation of 
periodic
- * waveforms, the capturing of a periodic waveform's frequency/duty cycle,
- * software timekeeping for periodic operations, waveform extension control,
- * fault detection etc.
- *
- * The counter size of the TCC modules can be 16- or 24-bit depending on
- * the TCC instance.
- * Refer \ref asfdoc_sam0_tcc_special_considerations_tcc_d21 and
- * \ref asfdoc_sam0_tcc_special_considerations_tcc_d11 for details on TCC 
instances.
- *
- * The TCC module for the SAM includes the following functions:
- *
- * - Generation of PWM signals
- * - Generation of timestamps for events
- * - General time counting
- * - Waveform period capture
- * - Waveform frequency capture
- * - Additional control for generated waveform outputs
- * - Fault protection for waveform generation
- *
- * \ref asfdoc_sam0_tcc_block_diagram "The diagram below" shows the overview
- * of the TCC Module.
- *
- * \anchor asfdoc_sam0_tcc_block_diagram
- * \image html overview.svg "Overview of the TCC Module"
- *
- * \subsection asfdoc_sam0_tcc_module_overview_parts Functional 

[GitHub] incubator-mynewt-site pull request: Shell documentation

2016-03-03 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-mynewt-site/pull/24


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[4/4] incubator-mynewt-site git commit: Merge branch 'shell_doc' of https://github.com/mkiiskila/incubator-mynewt-site

2016-03-03 Thread aditi
Merge branch 'shell_doc' of https://github.com/mkiiskila/incubator-mynewt-site


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/c9bd0d5a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/c9bd0d5a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/c9bd0d5a

Branch: refs/heads/master
Commit: c9bd0d5a8e6639d87b35288af00666906d311f92
Parents: a0cbe90 438274f
Author: aditihilbert 
Authored: Thu Mar 3 12:52:07 2016 -0800
Committer: aditihilbert 
Committed: Thu Mar 3 12:52:07 2016 -0800

--
 docs/os/modules/shell/shell.md  | 44 +-
 docs/os/modules/shell/shell_cmd.md  | 39 -
 docs/os/modules/shell/shell_cmd_list_lock.md| 39 -
 docs/os/modules/shell/shell_cmd_list_unlock.md  | 38 
 docs/os/modules/shell/shell_cmd_register.md | 40 -
 docs/os/modules/shell/shell_console_rx_cb.md|  0
 docs/os/modules/shell/shell_echo_cmd.md |  0
 docs/os/modules/shell/shell_help_cmd.md |  0
 .../modules/shell/shell_nlip_input_register.md  | 43 +
 .../modules/shell/shell_nlip_mqueue_process.md  |  0
 docs/os/modules/shell/shell_nlip_mtx.md |  0
 docs/os/modules/shell/shell_nlip_output.md  | 36 
 docs/os/modules/shell/shell_nlip_process.md |  0
 .../modules/shell/shell_os_mpool_display_cmd.md |  0
 .../modules/shell/shell_os_tasks_display_cmd.md |  0
 docs/os/modules/shell/shell_process_command.md  |  0
 docs/os/modules/shell/shell_read_console.md |  0
 docs/os/modules/shell/shell_task_func.md|  0
 docs/os/modules/shell/shell_task_init.md| 46 ++
 docs/os/modules/shelltest/imgmgr_module_init.md |  0
 docs/os/modules/shelltest/imgr_boot_read.md |  0
 docs/os/modules/shelltest/imgr_boot_write.md|  0
 docs/os/modules/shelltest/imgr_file_download.md |  0
 docs/os/modules/shelltest/imgr_file_upload.md   |  0
 docs/os/modules/shelltest/imgr_list.md  |  0
 docs/os/modules/shelltest/imgr_noop.md  |  0
 docs/os/modules/shelltest/imgr_read_file.md |  0
 docs/os/modules/shelltest/imgr_read_main.md |  0
 docs/os/modules/shelltest/imgr_read_test.md |  0
 docs/os/modules/shelltest/imgr_read_ver.md  |  0
 docs/os/modules/shelltest/imgr_upload.md|  0
 docs/os/modules/shelltest/imgr_ver_jsonstr.md   |  0
 docs/os/modules/shelltest/imgr_ver_parse.md |  0
 docs/os/modules/shelltest/imgr_ver_str.md   |  0
 docs/os/modules/shelltest/imgr_write_file.md|  0
 docs/os/modules/shelltest/shelltest.md  | 92 
 mkdocs.yml  | 14 ---
 37 files changed, 163 insertions(+), 268 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/c9bd0d5a/mkdocs.yml
--



[1/4] incubator-mynewt-site git commit: Shell package documentation.

2016-03-03 Thread aditi
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/master a0cbe909e -> c9bd0d5a8


Shell package documentation.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/9041338c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/9041338c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/9041338c

Branch: refs/heads/master
Commit: 9041338cb4ea5963fbfae5e5b0cde2946531f48c
Parents: 9ee8142
Author: Marko Kiiskila 
Authored: Wed Mar 2 13:31:30 2016 -0800
Committer: Marko Kiiskila 
Committed: Wed Mar 2 13:34:15 2016 -0800

--
 docs/os/modules/shell/shell.md  | 42 +
 docs/os/modules/shell/shell_cmd.md  | 39 -
 docs/os/modules/shell/shell_cmd_list_lock.md| 39 -
 docs/os/modules/shell/shell_cmd_list_unlock.md  | 38 
 docs/os/modules/shell/shell_cmd_register.md | 40 -
 docs/os/modules/shell/shell_console_rx_cb.md|  0
 docs/os/modules/shell/shell_echo_cmd.md |  0
 docs/os/modules/shell/shell_help_cmd.md |  0
 .../modules/shell/shell_nlip_input_register.md  | 43 +
 .../modules/shell/shell_nlip_mqueue_process.md  |  0
 docs/os/modules/shell/shell_nlip_mtx.md |  0
 docs/os/modules/shell/shell_nlip_output.md  | 36 
 docs/os/modules/shell/shell_nlip_process.md |  0
 .../modules/shell/shell_os_mpool_display_cmd.md |  0
 .../modules/shell/shell_os_tasks_display_cmd.md |  0
 docs/os/modules/shell/shell_process_command.md  |  0
 docs/os/modules/shell/shell_read_console.md |  0
 docs/os/modules/shell/shell_task_func.md|  0
 docs/os/modules/shell/shell_task_init.md| 46 ++
 docs/os/modules/shelltest/imgmgr_module_init.md |  0
 docs/os/modules/shelltest/imgr_boot_read.md |  0
 docs/os/modules/shelltest/imgr_boot_write.md|  0
 docs/os/modules/shelltest/imgr_file_download.md |  0
 docs/os/modules/shelltest/imgr_file_upload.md   |  0
 docs/os/modules/shelltest/imgr_list.md  |  0
 docs/os/modules/shelltest/imgr_noop.md  |  0
 docs/os/modules/shelltest/imgr_read_file.md |  0
 docs/os/modules/shelltest/imgr_read_main.md |  0
 docs/os/modules/shelltest/imgr_read_test.md |  0
 docs/os/modules/shelltest/imgr_read_ver.md  |  0
 docs/os/modules/shelltest/imgr_upload.md|  0
 docs/os/modules/shelltest/imgr_ver_jsonstr.md   |  0
 docs/os/modules/shelltest/imgr_ver_parse.md |  0
 docs/os/modules/shelltest/imgr_ver_str.md   |  0
 docs/os/modules/shelltest/imgr_write_file.md|  0
 docs/os/modules/shelltest/shelltest.md  | 92 
 36 files changed, 161 insertions(+), 254 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/9041338c/docs/os/modules/shell/shell.md
--
diff --git a/docs/os/modules/shell/shell.md b/docs/os/modules/shell/shell.md
index db575bc..36568ad 100644
--- a/docs/os/modules/shell/shell.md
+++ b/docs/os/modules/shell/shell.md
@@ -1,14 +1,17 @@
 # Shell
 
-The shell is the program which puts up a prompt for a command, processes 
commands, and returns output. Interacting with the console of a device is done 
using a shell program.
-
+The shell is package sitting on top of console, handling 2 jobs. Processing 
console input and implementing newtmgr line protocol over serial. Shell runs on 
it's own task.
 
 ## Description
 
-Shell processes console input one line at a time. Eggs can register handlers 
for their commands. Shell parses the input, matches it against the set of 
registered commands, and then calls the handler it finds.
+First job is directing incoming commands to other subsystems. It parses the 
incoming character string, and splits it into tokens. Then shell looks for the 
subsystem to handle this command based on the first token of input.
+
+Subsystems register their command handlers using *shell_cmd_register()*. When 
shell calls the command handler, it passes the other tokens as arguments.
 
 A few commands are currently available in the shell - `tasks`, `log`, and 
`stat stat`. A $ prompt sign will be coming soon!
 
+Second job is doing framing, encoding and decoding newtmgr protocol when it's 
carried over the console. Protocol handler (libs/newtmgr) registers itself 
using *shell_nlip_input_register()*, and shell calls the registered handler for 
every frame. Outgoing frames for the protocol are sent using 
*shell_nlip_output()*.
+
 Create a sim target to check out these commands available in shell.
 
 ```no-highlight
@@ -84,7 +87,19 @@ stat stat
 
 ## Data structures
 
-Replace this with the list of data structures used, why, any neat features
+```no-highlight

[3/4] incubator-mynewt-site git commit: Update shell package links.

2016-03-03 Thread aditi
Update shell package links.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/438274f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/438274f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/438274f9

Branch: refs/heads/master
Commit: 438274f94dbc7b2ab2ce33847be9e5d4150a909d
Parents: 6918657
Author: Marko Kiiskila 
Authored: Wed Mar 2 13:54:38 2016 -0800
Committer: Marko Kiiskila 
Committed: Wed Mar 2 13:54:38 2016 -0800

--
 mkdocs.yml | 14 --
 1 file changed, 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/438274f9/mkdocs.yml
--
diff --git a/mkdocs.yml b/mkdocs.yml
index 517647d..3049e14 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -146,23 +146,9 @@ pages:
 - Shell: 
 - 'Overview': 'os/modules/shell/shell.md'
 - 'Functions': 
-- 'shell_cmd': 'os/modules/shell/shell_cmd.md'
-- 'shell_cmd_list_lock': 
'os/modules/shell/shell_cmd_list_lock.md'
-- 'shell_cmd_list_unlock': 
'os/modules/shell/shell_cmd_list_unlock.md'
 - 'shell_cmd_register': 
'os/modules/shell/shell_cmd_register.md'
-- 'shell_console_rx_cb': 
'os/modules/shell/shell_console_rx_cb.md'
-- 'shell_echo_cmd': 'os/modules/shell/shell_echo_cmd.md'
-- 'shell_help_cmd': 'os/modules/shell/shell_help_cmd.md'
 - 'shell_nlip_input_register': 
'os/modules/shell/shell_nlip_input_register.md'
-- 'shell_nlip_mqueue_process': 
'os/modules/shell/shell_nlip_mqueue_process.md'
-- 'shell_nlip_mtx': 'os/modules/shell/shell_nlip_mtx.md'
 - 'shell_nlip_output': 'os/modules/shell/shell_nlip_output.md'
-- 'shell_nlip_process': 
'os/modules/shell/shell_nlip_process.md'
-- 'shell_os_mpool_display_cmd': 
'os/modules/shell/shell_os_mpool_display_cmd.md'
-- 'shell_os_tasks_display_cmd': 
'os/modules/shell/shell_os_tasks_display_cmd.md'
-- 'shell_process_command': 
'os/modules/shell/shell_process_command.md'
-- 'shell_read_console': 
'os/modules/shell/shell_read_console.md'
-- 'shell_task_func': 'os/modules/shell/shell_task_func.md'
 - 'shell_task_init': 'os/modules/shell/shell_task_init.md'
 - Bootloader: 
 - 'Overview': 'os/modules/bootloader/bootloader.md'



[47/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc_sam_d_r/adc_feature.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc_sam_d_r/adc_feature.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc_sam_d_r/adc_feature.h
deleted file mode 100755
index c1ac7cb..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc_sam_d_r/adc_feature.h
+++ /dev/null
@@ -1,728 +0,0 @@
-/**
- * \file
- *
- * \brief SAM ADC functionality
- *
- * Copyright (C) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#ifndef ADC_FEATURE_H_INCLUDED
-#define ADC_FEATURE_H_INCLUDED
-
-/**
- * \addtogroup asfdoc_sam0_adc_group
- * @{
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if ADC_CALLBACK_MODE == true
-#  include 
-
-#if !defined(__DOXYGEN__)
-extern struct adc_module *_adc_instances[ADC_INST_NUM];
-#endif
-
-/** Forward definition of the device instance. */
-struct adc_module;
-
-/** Type of the callback functions. */
-typedef void (*adc_callback_t)(struct adc_module *const module);
-
-/**
- * \brief ADC Callback enum
- *
- * Callback types for ADC callback driver.
- *
- */
-enum adc_callback {
-   /** Callback for buffer received */
-   ADC_CALLBACK_READ_BUFFER,
-   /** Callback when window is hit */
-   ADC_CALLBACK_WINDOW,
-   /** Callback for error */
-   ADC_CALLBACK_ERROR,
-#  if !defined(__DOXYGEN__)
-   /** Number of available callbacks */
-   ADC_CALLBACK_N,
-#  endif
-};
-
-#endif
-
-/**
- * \brief ADC reference voltage enum
- *
- * Enum for the possible reference voltages for the ADC.
- *
- */
-enum adc_reference {
-   /** 1.0V voltage reference */
-   ADC_REFERENCE_INT1V   = ADC_REFCTRL_REFSEL_INT1V,
-   /** 1/1.48VCC reference */
-   ADC_REFERENCE_INTVCC0 = ADC_REFCTRL_REFSEL_INTVCC0,
-   /** 1/2VCC (only for internal VCC > 2.1V) */
-   ADC_REFERENCE_INTVCC1 = ADC_REFCTRL_REFSEL_INTVCC1,
-   /** External reference A */
-   ADC_REFERENCE_AREFA   = ADC_REFCTRL_REFSEL_AREFA,
-   /** External reference B */
-   ADC_REFERENCE_AREFB   = ADC_REFCTRL_REFSEL_AREFB,
-};
-
-/**
- * \brief ADC clock prescaler enum
- *
- * Enum for the possible clock prescaler values for the ADC.
- *
- */
-enum adc_clock_prescaler {
-   /** ADC clock division factor 4 */
-   ADC_CLOCK_PRESCALER_DIV4   = ADC_CTRLB_PRESCALER_DIV4,
-   /** ADC clock division factor 8 */
-   ADC_CLOCK_PRESCALER_DIV8   = ADC_CTRLB_PRESCALER_DIV8,
-   /** ADC clock division factor 16 */
-   ADC_CLOCK_PRESCALER_DIV16  = ADC_CTRLB_PRESCALER_DIV16,
-   /** ADC clock division factor 32 */
-   ADC_CLOCK_PRESCALER_DIV32  = ADC_CTRLB_PRESCALER_DIV32,
-   /** ADC clock division factor 64 */
-   ADC_CLOCK_PRESCALER_DIV64  = ADC_CTRLB_PRESCALER_DIV64,
-   /** ADC clock division factor 128 */
-   ADC_CLOCK_PRESCALER_DIV128 = ADC_CTRLB_PRESCALER_DIV128,
-   /** ADC clock division factor 256 */
-   ADC_CLOCK_PRESCALER_DIV256 = ADC_CTRLB_PRESCALER_DIV256,
-   /** ADC clock division factor 512 */
-   ADC_CLOCK_PRESCALER_DIV512 = ADC_CTRLB_PRESCALER_DIV512,
-};
-
-/**

[63/70] [abbrv] incubator-mynewt-larva git commit: Remove bin2img

2016-03-03 Thread ccollins
Remove bin2img


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/4934f2e6
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/4934f2e6
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/4934f2e6

Branch: refs/heads/master
Commit: 4934f2e60c3a4cf77b175243998a4c3d488a0386
Parents: ae87902
Author: Marko Kiiskila 
Authored: Wed Mar 2 17:37:47 2016 -0800
Committer: Marko Kiiskila 
Committed: Wed Mar 2 17:37:47 2016 -0800

--
 project/bin2img/LICENSE   | 202 -
 project/bin2img/README.md |   1 -
 project/bin2img/pkg.yml   |  31 --
 project/bin2img/src/bin2img.c | 143 --
 project/bin2img/src/crc32.c   | 123 --
 project/bin2img/src/crc32.h   |  25 -
 targets/bin2img/pkg.yml   |   9 --
 7 files changed, 534 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/4934f2e6/project/bin2img/LICENSE
--
diff --git a/project/bin2img/LICENSE b/project/bin2img/LICENSE
deleted file mode 100644
index 8f71f43..000
--- a/project/bin2img/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
- Apache License
-   Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-  "License" shall mean the terms and conditions for use, reproduction,
-  and distribution as defined by Sections 1 through 9 of this document.
-
-  "Licensor" shall mean the copyright owner or entity authorized by
-  the copyright owner that is granting the License.
-
-  "Legal Entity" shall mean the union of the acting entity and all
-  other entities that control, are controlled by, or are under common
-  control with that entity. For the purposes of this definition,
-  "control" means (i) the power, direct or indirect, to cause the
-  direction or management of such entity, whether by contract or
-  otherwise, or (ii) ownership of fifty percent (50%) or more of the
-  outstanding shares, or (iii) beneficial ownership of such entity.
-
-  "You" (or "Your") shall mean an individual or Legal Entity
-  exercising permissions granted by this License.
-
-  "Source" form shall mean the preferred form for making modifications,
-  including but not limited to software source code, documentation
-  source, and configuration files.
-
-  "Object" form shall mean any form resulting from mechanical
-  transformation or translation of a Source form, including but
-  not limited to compiled object code, generated documentation,
-  and conversions to other media types.
-
-  "Work" shall mean the work of authorship, whether in Source or
-  Object form, made available under the License, as indicated by a
-  copyright notice that is included in or attached to the work
-  (an example is provided in the Appendix below).
-
-  "Derivative Works" shall mean any work, whether in Source or Object
-  form, that is based on (or derived from) the Work and for which the
-  editorial revisions, annotations, elaborations, or other modifications
-  represent, as a whole, an original work of authorship. For the purposes
-  of this License, Derivative Works shall not include works that remain
-  separable from, or merely link (or bind by name) to the interfaces of,
-  the Work and Derivative Works thereof.
-
-  "Contribution" shall mean any work of authorship, including
-  the original version of the Work and any modifications or additions
-  to that Work or Derivative Works thereof, that is intentionally
-  submitted to Licensor for inclusion in the Work by the copyright owner
-  or by an individual or Legal Entity authorized to submit on behalf of
-  the copyright owner. For the purposes of this definition, "submitted"
-  means any form of electronic, verbal, or written communication sent
-  to the Licensor or its representatives, including but not limited to
-  communication on electronic mailing lists, source code control systems,
-  and issue tracking systems that are managed by, or on behalf of, the
-  Licensor for the purpose of discussing and improving the Work, but
-  excluding communication that is conspicuously marked or otherwise
-  designated in writing by the copyright owner as "Not a Contribution."
-
-  "Contributor" shall mean Licensor and any individual or Legal Entity
-  on behalf of whom a Contribution has been received by 

[26/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc_sam_d_r/tc.c
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc_sam_d_r/tc.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc_sam_d_r/tc.c
deleted file mode 100755
index 546c36c..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc_sam_d_r/tc.c
+++ /dev/null
@@ -1,685 +0,0 @@
-/**
- * \file
- *
- * \brief SAM TC - Timer Counter Driver
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#include "tc.h"
-
-#if TC_ASYNC == true
-#  include "tc_interrupt.h"
-#  include 
-
-/** \internal
- * Converts a given TC index to its interrupt vector index.
- */
-#  define _TC_INTERRUPT_VECT_NUM(n, unused) \
-   SYSTEM_INTERRUPT_MODULE_TC##n,
-#endif
-
-#if !defined(__DOXYGEN__)
-#  define _TC_GCLK_ID(n,unused)   TPASTE3(TC,n,_GCLK_ID)   ,
-#  define _TC_PM_APBCMASK(n,unused)   TPASTE2(PM_APBCMASK_TC,n) ,
-
-#  define TC_INST_GCLK_ID  { MRECURSION(TC_INST_NUM, _TC_GCLK_ID, 
TC_INST_MAX_ID) }
-#  define TC_INST_PM_APBCMASK  { MRECURSION(TC_INST_NUM, _TC_PM_APBCMASK, 
TC_INST_MAX_ID) }
-
-#endif
-
-/**
- * \internal Find the index of given TC module instance.
- *
- * \param[in] TC module instance pointer
- *
- * \return Index of the given TC module instance.
- */
-uint8_t _tc_get_inst_index(
-   Tc *const hw)
-{
-   /* List of available TC modules. */
-   Tc *const tc_modules[TC_INST_NUM] = TC_INSTS;
-
-   /* Find index for TC instance. */
-   for (uint32_t i = 0; i < TC_INST_NUM; i++) {
-   if (hw == tc_modules[i]) {
-   return i;
-   }
-   }
-
-   /* Invalid data given. */
-   Assert(false);
-   return 0;
-}
-
-
-/**
- * \brief Initializes a hardware TC module instance.
- *
- * Enables the clock and initializes the TC module, based on the given
- * configuration values.
- *
- * \param[in,out] module_inst  Pointer to the software module instance struct
- * \param[in] hw   Pointer to the TC hardware module
- * \param[in] config   Pointer to the TC configuration options struct
- *
- * \return Status of the initialization procedure.
- *
- * \retval STATUS_OK   The module was initialized successfully
- * \retval STATUS_BUSY Hardware module was busy when the
- * initialization procedure was attempted
- * \retval STATUS_INVALID_ARG  An invalid configuration option or argument
- * was supplied
- * \retval STATUS_ERR_DENIED   Hardware module was already enabled, or the
- * hardware module is configured in 32-bit
- * slave mode
- */
-enum status_code tc_init(
-   struct tc_module *const module_inst,
-   Tc *const hw,
-   const struct tc_config *const config)
-{
-   /* Sanity check arguments */
-   Assert(hw);
-   Assert(module_inst);
-   Assert(config);
-
-   /* Temporary variable to hold all updates to the CTRLA
-* register before they are written to it 

[23/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/adc.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/adc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/adc.h
deleted file mode 100755
index fbd0bdb..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/adc.h
+++ /dev/null
@@ -1,702 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for ADC
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_ADC_COMPONENT_
-#define _SAMD21_ADC_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR ADC */
-/* == 
*/
-/** \addtogroup SAMD21_ADC Analog Digital Converter */
-/*@{*/
-
-#define ADC_U2204
-#define REV_ADC 0x120
-
-/*  ADC_CTRLA : (ADC Offset: 0x00) (R/W  8) Control A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint8_t  ENABLE:1; /*!< bit:  1  Enable
 */
-uint8_t  RUNSTDBY:1;   /*!< bit:  2  Run in Standby
 */
-uint8_t  :5;   /*!< bit:  3.. 7  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} ADC_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define ADC_CTRLA_OFFSET0x00 /**< \brief (ADC_CTRLA 
offset) Control A */
-#define ADC_CTRLA_RESETVALUE0x00ul   /**< \brief (ADC_CTRLA 
reset_value) Control A */
-
-#define ADC_CTRLA_SWRST_Pos 0/**< \brief (ADC_CTRLA) 
Software Reset */
-#define ADC_CTRLA_SWRST (0x1ul << ADC_CTRLA_SWRST_Pos)
-#define ADC_CTRLA_ENABLE_Pos1/**< \brief (ADC_CTRLA) 
Enable */
-#define ADC_CTRLA_ENABLE(0x1ul << ADC_CTRLA_ENABLE_Pos)
-#define ADC_CTRLA_RUNSTDBY_Pos  2/**< \brief (ADC_CTRLA) Run 
in Standby */
-#define ADC_CTRLA_RUNSTDBY  (0x1ul << ADC_CTRLA_RUNSTDBY_Pos)
-#define ADC_CTRLA_MASK  0x07ul   /**< \brief (ADC_CTRLA) MASK 
Register */
-
-/*  ADC_REFCTRL : (ADC Offset: 0x01) (R/W  8) Reference Control 
 */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  REFSEL:4; /*!< bit:  0.. 3  Reference Selection   
 */
-uint8_t  :3;   /*!< bit:  4.. 6  Reserved  
 */
-uint8_t  REFCOMP:1;/*!< bit:  7  Reference Buffer Offset 
Compensation Enable */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used 

[43/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/i2s/i2s.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/i2s/i2s.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/i2s/i2s.h
deleted file mode 100755
index 5d1cc61..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/i2s/i2s.h
+++ /dev/null
@@ -1,1406 +0,0 @@
-/**
- * \file
- *
- * \brief SAM I2S - Inter-IC Sound Controller
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef I2S_H_INCLUDED
-#define I2S_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_i2s_group SAM Inter-IC Sound Controller (I2S) Driver
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides
- * an interface for the configuration and management of the device's Inter-IC
- * Sound Controller functionality.
- *
- * The following driver API modes are covered by this manual:
- * - Polled APIs
- * \if I2S_CALLBACK_MODE
- * - Callback APIs
- * \endif
- *
- * The following peripheral is used by this module:
- *  - I2S (Inter-IC Sound Controller)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D21
- *  - Atmel | SMART SAM DA1
- *
- * The outline of this documentation is as follows:
- *  - \ref asfdoc_sam0_i2s_prerequisites
- *  - \ref asfdoc_sam0_i2s_module_overview
- *  - \ref asfdoc_sam0_i2s_special_considerations
- *  - \ref asfdoc_sam0_i2s_extra_info
- *  - \ref asfdoc_sam0_i2s_examples
- *  - \ref asfdoc_sam0_i2s_api_overview
- *
- * \section asfdoc_sam0_i2s_prerequisites Prerequisites
- *
- * There are no prerequisites for this module.
- *
- * \section asfdoc_sam0_i2s_module_overview Module Overview
- *
- * The I2S provides bidirectional, synchronous, digital audio link with 
external
- * audio devices through these signal pins:
- *  - Serial Data (SDm)
- *  - Frame Sync (FSn)
- *  - Serial Clock (SCKn)
- *  - Master Clock (MCKn)
- *
- * The I2S consists of 2 Clock Units and 2 Serializers, which can be separately
- * configured and enabled, to provide varies functionalities as follow:
- *  - Communicate to Audio CODECs as Master or Slave, or provides clock and
- *frame sync signals as Controller
- *  - Communicate to DAC or ADC through dedicated I2S serial interface
- *  - Communicate to multi-slot or multiple stereo DACs or ADCs, via
- *Time Division Multiplexed (TDM) format
- *  - Reading mono or stereo MEMS microphones, using the Pulse Density
- *Modulation (PDM) interface
- *
- * The I2S supports compact stereo data word, where left channel data bits are
- * in lower half and right channel data bits are in upper half. It reduces the
- * number of data words for stereo audio data and the DMA bandwidth.
- *
- * In master mode, the frame is configured by number of slots and slot size, 
and
- * allows range covering 16fs to 1024fs MCK, to provide oversampling clock to 
an
- * external audio CODEC or digital signal processor (DSP).
- *
- * A block diagram of the I2S can be seen in
- * \ref asfdoc_sam0_i2s_module_block_diagram "the figure below".
- *
- * \anchor asfdoc_sam0_i2s_module_block_diagram
- * \image html i2s_blocks.svg "I2S Block Diagram"
- *
- * 

[50/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/common/utils/parts.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/common/utils/parts.h 
b/hw/mcu/atmel/samd21xx/src/common/utils/parts.h
deleted file mode 100755
index c887931..000
--- a/hw/mcu/atmel/samd21xx/src/common/utils/parts.h
+++ /dev/null
@@ -1,1630 +0,0 @@
-/**
- * \file
- *
- * \brief Atmel part identification macros
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef ATMEL_PARTS_H
-#define ATMEL_PARTS_H
-
-/**
- * \defgroup part_macros_group Atmel part identification macros
- *
- * This collection of macros identify which series and families that the 
various
- * Atmel parts belong to. These can be used to select part-dependent sections 
of
- * code at compile time.
- *
- * @{
- */
-
-/**
- * \name Convenience macros for part checking
- * @{
- */
-/* ! Check GCC and IAR part definition for 8-bit AVR */
-#define AVR8_PART_IS_DEFINED(part) \
-   (defined(__ ## part ## __) || defined(__AVR_ ## part ## __))
-
-/* ! Check GCC and IAR part definition for 32-bit AVR */
-#define AVR32_PART_IS_DEFINED(part) \
-   (defined(__AT32 ## part ## __) || defined(__AVR32_ ## part ## __))
-
-/* ! Check GCC and IAR part definition for SAM */
-#define SAM_PART_IS_DEFINED(part) (defined(__ ## part ## __))
-/** @} */
-
-/**
- * \defgroup uc3_part_macros_group AVR UC3 parts
- * @{
- */
-
-/**
- * \name AVR UC3 A series
- * @{
- */
-#define UC3A0 (\
-   AVR32_PART_IS_DEFINED(UC3A0128) || \
-   AVR32_PART_IS_DEFINED(UC3A0256) || \
-   AVR32_PART_IS_DEFINED(UC3A0512) \
-   )
-
-#define UC3A1 (\
-   AVR32_PART_IS_DEFINED(UC3A1128) || \
-   AVR32_PART_IS_DEFINED(UC3A1256) || \
-   AVR32_PART_IS_DEFINED(UC3A1512) \
-   )
-
-#define UC3A3 (\
-   AVR32_PART_IS_DEFINED(UC3A364)   || \
-   AVR32_PART_IS_DEFINED(UC3A364S)  || \
-   AVR32_PART_IS_DEFINED(UC3A3128)  || \
-   AVR32_PART_IS_DEFINED(UC3A3128S) || \
-   AVR32_PART_IS_DEFINED(UC3A3256)  || \
-   AVR32_PART_IS_DEFINED(UC3A3256S) \
-   )
-
-#define UC3A4 (\
-   AVR32_PART_IS_DEFINED(UC3A464)   || \
-   AVR32_PART_IS_DEFINED(UC3A464S)  || \
-   AVR32_PART_IS_DEFINED(UC3A4128)  || \
-   AVR32_PART_IS_DEFINED(UC3A4128S) || \
-   AVR32_PART_IS_DEFINED(UC3A4256)  || \
-   AVR32_PART_IS_DEFINED(UC3A4256S) \
-   )
-/** @} */
-
-/**
- * \name AVR UC3 B series
- * @{
- */
-#define UC3B0 (\
-   AVR32_PART_IS_DEFINED(UC3B064)  || \
-   AVR32_PART_IS_DEFINED(UC3B0128) || \
-   AVR32_PART_IS_DEFINED(UC3B0256) || \
-   AVR32_PART_IS_DEFINED(UC3B0512) \
-   )
-
-#define UC3B1 (\
-   AVR32_PART_IS_DEFINED(UC3B164)  || \
-   AVR32_PART_IS_DEFINED(UC3B1128) || \
-   AVR32_PART_IS_DEFINED(UC3B1256) || \
-   AVR32_PART_IS_DEFINED(UC3B1512) \
-   

[42/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/nvm/nvm.c
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/nvm/nvm.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/nvm/nvm.c
deleted file mode 100755
index 456f733..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/nvm/nvm.c
+++ /dev/null
@@ -1,1143 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Non Volatile Memory driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#include "nvm.h"
-#include 
-#include 
-#include 
-
-/**
- * \internal Internal device instance struct
- *
- * This struct contains information about the NVM module which is
- * often used by the different functions. The information is loaded
- * into the struct in the nvm_init() function.
- */
-struct _nvm_module {
-   /** Number of bytes contained per page. */
-   uint16_t page_size;
-   /** Total number of pages in the NVM memory. */
-   uint16_t number_of_pages;
-   /** If \c false, a page write command will be issued automatically when 
the
-*  page buffer is full. */
-   bool manual_page_write;
-};
-
-/**
- * \internal Instance of the internal device struct
- */
-static struct _nvm_module _nvm_dev;
-
-/**
- * \internal Pointer to the NVM MEMORY region start address
- */
-#define NVM_MEMORY((volatile uint16_t *)FLASH_ADDR)
-
-/**
- * \internal Pointer to the NVM USER MEMORY region start address
- */
-#define NVM_USER_MEMORY   ((volatile uint16_t *)NVMCTRL_USER)
-
-
-/**
- * \brief Sets the up the NVM hardware module based on the configuration.
- *
- * Writes a given configuration of an NVM controller configuration to the
- * hardware module, and initializes the internal device struct.
- *
- * \param[in] configConfiguration settings for the NVM controller
- *
- * \note The security bit must be cleared in order successfully use this
- *   function. This can only be done by a chip erase.
- *
- * \return Status of the configuration procedure.
- *
- * \retval STATUS_OK  If the initialization was a success
- * \retval STATUS_BUSYIf the module was busy when the operation was 
attempted
- * \retval STATUS_ERR_IO  If the security bit has been set, preventing the
- *EEPROM and/or auxiliary space configuration from 
being
- *altered
- */
-enum status_code nvm_set_config(
-   const struct nvm_config *const config)
-{
-   /* Sanity check argument */
-   Assert(config);
-
-   /* Get a pointer to the module hardware instance */
-   Nvmctrl *const nvm_module = NVMCTRL;
-
-#if (SAML21) || (SAML22) || (SAMC20) || (SAMC21)
-   /* Turn on the digital interface clock */
-   system_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBB, MCLK_APBBMASK_NVMCTRL);
-#else
-   /* Turn on the digital interface clock */
-   system_apb_clock_set_mask(SYSTEM_CLOCK_APB_APBB, PM_APBBMASK_NVMCTRL);
-#endif
-
-   /* Clear error flags */
-   nvm_module->STATUS.reg |= NVMCTRL_STATUS_MASK;
-
-   /* Check if the module is busy */
-   if (!nvm_is_ready()) {
-   return STATUS_BUSY;
-   }

[34/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.h
deleted file mode 100755
index c25f7e2..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.h
+++ /dev/null
@@ -1,1801 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Serial Peripheral Interface Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef SPI_H_INCLUDED
-#define SPI_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_sercom_spi_group SAM Serial Peripheral Interface 
(SERCOM SPI) Driver
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides
- * an interface for the configuration and management of the SERCOM module in
- * its SPI mode to transfer SPI  data frames. The following driver API modes
- * are covered by this manual:
- *
- * - Polled APIs
- * \if SPI_CALLBACK_MODE
- * - Callback APIs
- * \endif
- *
- * The following peripheral is used by this module:
- * - SERCOM (Serial Communication Interface)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D09/D10/D11
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM DA1
- *  - Atmel | SMART SAM C20/C21
- *
- * The outline of this documentation is as follows:
- * - \ref asfdoc_sam0_sercom_spi_prerequisites
- * - \ref asfdoc_sam0_sercom_spi_module_overview
- * - \ref asfdoc_sam0_sercom_spi_special_considerations
- * - \ref asfdoc_sam0_sercom_spi_extra_info
- * - \ref asfdoc_sam0_sercom_spi_examples
- * - \ref asfdoc_sam0_sercom_spi_api_overview
- *
- * \section asfdoc_sam0_sercom_spi_prerequisites Prerequisites
- * There are no prerequisites.
- *
- *
- * \section asfdoc_sam0_sercom_spi_module_overview Module Overview
- * The Serial Peripheral Interface (SPI) is a high-speed synchronous data
- * transfer interface using three or four pins. It allows fast communication
- * between a master device and one or more peripheral devices.
- *
- * A device connected to the bus must act as a master or a slave. The master
- * initiates and controls all data transactions.
- * The SPI master initiates a communication cycle by pulling low the Slave
- * Select (SS) pin of the desired slave. The Slave Select pin is active low.
- * Master and slave prepare data to be sent in their respective shift
- * registers, and the master generates the required clock pulses on the SCK
- * line to interchange data. Data is always shifted from master to slave on
- * the Master Out - Slave In (MOSI) line, and from slave to master on the
- * Master In - Slave Out (MISO) line. After each data transfer, the master can
- * synchronize to the slave by pulling the SS line high.
- *
- * \subsection asfdoc_sam0_sercom_spi_module_features Driver Feature Macro 
Definition
- * 
- *  
- *Driver feature macro
- *Supported devices
- *  
- *  
- *FEATURE_SPI_SLAVE_SELECT_LOW_DETECT
- *SAM D21/R21/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *FEATURE_SPI_HARDWARE_SLAVE_SELECT
- *

[32/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/usart/usart.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/usart/usart.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/usart/usart.h
deleted file mode 100755
index bb8c80c..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/usart/usart.h
+++ /dev/null
@@ -1,1592 +0,0 @@
-/**
- *
- * \file
- *
- * \brief SAM SERCOM USART Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#ifndef USART_H_INCLUDED
-#define USART_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_sercom_usart_group SAM Serial USART (SERCOM USART) 
Driver
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides
- * an interface for the configuration and management of the SERCOM module in
- * its USART mode to transfer or receive USART data frames. The following 
driver
- * API modes are covered by this manual:
- *
- *  - Polled APIs
- * \if USART_CALLBACK_MODE
- *  - Callback APIs
- * \endif
- *
- * The following peripheral is used by this module:
- * - SERCOM (Serial Communication Interface)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D09/D10/D11
- *  - Atmel | SMART SAM D10/D11
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM DA1
- *  - Atmel | SMART SAM C20/C21
- *
- * The outline of this documentation is as follows:
- * - \ref asfdoc_sam0_sercom_usart_prerequisites
- * - \ref asfdoc_sam0_sercom_usart_overview
- * - \ref asfdoc_sam0_sercom_usart_special_considerations
- * - \ref asfdoc_sam0_sercom_usart_extra_info
- * - \ref asfdoc_sam0_sercom_usart_examples
- * - \ref asfdoc_sam0_sercom_usart_api_overview
- *
- * \section asfdoc_sam0_sercom_usart_prerequisites Prerequisites
- *
- * To use the USART you need to have a GCLK generator enabled and running
- * that can be used as the SERCOM clock source. This can either be configured
- * in conf_clocks.h or by using the system clock driver.
- *
- * \section asfdoc_sam0_sercom_usart_overview Module Overview
- *
- * This driver will use one (or more) SERCOM interface(s) in the system
- * and configure it to run as a USART interface in either synchronous
- * or asynchronous mode.
- *
- * \subsection asfdoc_sam0_sercom_usart_features Driver Feature Macro 
Definition
- * 
- *  
- *Driver Feature Macro
- *Supported devices
- *  
- *  
- *FEATURE_USART_SYNC_SCHEME_V2
- *SAM D21/R21/D09/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *FEATURE_USART_OVER_SAMPLE
- *SAM D21/R21/D09/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *FEATURE_USART_HARDWARE_FLOW_CONTROL
- *SAM D21/R21/D09/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *FEATURE_USART_IRDA
- *SAM D21/R21/D09/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *FEATURE_USART_LIN_SLAVE
- *SAM D21/R21/D09/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *FEATURE_USART_COLLISION_DECTION
- *SAM D21/R21/D09/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *FEATURE_USART_START_FRAME_DECTION
- *SAM D21/R21/D09/D10/D11/L21/L22/DA1/C20/C21
- *  
- *  
- *  

[24/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc_callback.c
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc_callback.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc_callback.c
deleted file mode 100755
index b4da29a..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tcc/tcc_callback.c
+++ /dev/null
@@ -1,245 +0,0 @@
-/**
- * \file
- *
- * \brief SAM TCC - Timer Counter for Control Applications Callback Driver
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#include "tcc_callback.h"
-
-void *_tcc_instances[TCC_INST_NUM];
-
-void _tcc_interrupt_handler(uint8_t module_index);
-
-const uint32_t _tcc_intflag[TCC_CALLBACK_N] = {
-   TCC_INTFLAG_OVF,
-   TCC_INTFLAG_TRG,
-   TCC_INTFLAG_CNT,
-   TCC_INTFLAG_ERR,
-   TCC_INTFLAG_FAULTA,
-   TCC_INTFLAG_FAULTB,
-   TCC_INTFLAG_FAULT0,
-   TCC_INTFLAG_FAULT1,
-#define _TCC_INTFLAG_MC(n,dummy) TCC_INTFLAG_MC##n,
-   /* TCC_INTFLAG_MC0 ~ ... */
-   MREPEAT(TCC_NUM_CHANNELS, _TCC_INTFLAG_MC, 0)
-#undef _TCC_INTFLAG_MC
-};
-
-#  define _TCC_INTERRUPT_VECT_NUM(n, unused) \
- SYSTEM_INTERRUPT_MODULE_TCC##n,
-/**
- * \internal Get the interrupt vector for the given device instance
- *
- * \param[in] The TCC module instance number
- *
- * \return Interrupt vector for of the given TCC module instance.
- */
-static enum system_interrupt_vector _tcc_interrupt_get_interrupt_vector(
-   uint32_t inst_num)
-{
-   static uint8_t tcc_interrupt_vectors[TCC_INST_NUM] = {
-   MREPEAT(TCC_INST_NUM, _TCC_INTERRUPT_VECT_NUM, 0)
-   };
-
-   return (enum system_interrupt_vector)tcc_interrupt_vectors[inst_num];
-}
-
-/**
- * \brief Registers a callback
- *
- * Registers a callback function which is implemented by the user.
- *
- * \note The callback must be enabled by \ref tcc_enable_callback,
- * in order for the interrupt handler to call it when the conditions for the
- * callback type is met.
- *
- * \param[in] modulePointer to TCC software instance struct
- * \param[in] callback_func Pointer to callback function
- * \param[in] callback_type Callback type given by an enum
- */
-enum status_code tcc_register_callback(
-   struct tcc_module *const module,
-   tcc_callback_t callback_func,
-   const enum tcc_callback callback_type)
-{
-   /* Sanity check arguments */
-   Assert(module);
-   Assert(callback_func);
-
-   /* Register callback function */
-   module->callback[callback_type] = callback_func;
-
-   /* Set the bit corresponding to the callback_type */
-   module->register_callback_mask |= _tcc_intflag[callback_type];
-
-   return STATUS_OK;
-}
-
-/**
- * \brief Unregisters a callback
- *
- * Unregisters a callback function implemented by the user. The callback should
- * be disabled before it is unregistered.
- *
- * \param[in] module Pointer to TCC software instance struct
- * \param[in] callback_type Callback type given by an enum
- */
-enum status_code tcc_unregister_callback(
- 

[30/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock_feature.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock_feature.h
 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock_feature.h
deleted file mode 100755
index eadf4cc..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock_feature.h
+++ /dev/null
@@ -1,1492 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Clock Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#ifndef SYSTEM_CLOCK_FEATURE_H_INCLUDED
-#define SYSTEM_CLOCK_FEATURE_H_INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \defgroup asfdoc_sam0_system_clock_group SAM System Clock Management 
(SYSTEM CLOCK) Driver
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides 
an interface for the configuration
- * and management of the device's clocking related functions. This includes
- * the various clock sources, bus clocks, and generic clocks within the device,
- * with functions to manage the enabling, disabling, source selection, and
- * prescaling of clocks to various internal peripherals.
- *
- * The following peripherals are used by this module:
- *
- * - GCLK (Generic Clock Management)
- * - PM (Power Management)
- * - SYSCTRL (Clock Source Control)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D09/D10/D11
- *  - Atmel | SMART SAM DA1
- *
- * The outline of this documentation is as follows:
- *  - \ref asfdoc_sam0_system_clock_prerequisites
- *  - \ref asfdoc_sam0_system_clock_module_overview
- *  - \ref asfdoc_sam0_system_clock_special_considerations
- *  - \ref asfdoc_sam0_system_clock_extra_info
- *  - \ref asfdoc_sam0_system_clock_examples
- *  - \ref asfdoc_sam0_system_clock_api_overview
- *
- *
- * \section asfdoc_sam0_system_clock_prerequisites Prerequisites
- *
- * There are no prerequisites for this module.
- *
- *
- * \section asfdoc_sam0_system_clock_module_overview Module Overview
- * The SAM devices contain a sophisticated clocking system, which is designed
- * to give the maximum flexibility to the user application. This system allows
- * a system designer to tune the performance and power consumption of the 
device
- * in a dynamic manner, to achieve the best trade-off between the two for a
- * particular application.
- *
- * This driver provides a set of functions for the configuration and management
- * of the various clock related functionality within the device.
- *
- * \subsection asfdoc_sam0_system_clock_module_features Driver Feature Macro 
Definition
- * 
- * 
- * Driver Feature Macro
- * Supported devices
- * 
- * 
- * FEATURE_SYSTEM_CLOCK_DPLL
- * SAMD21, SAMR21, SAMD10, SAMD11, SAMDAx
- * 
- * 
- * \note The specific features are only available in the driver when the
- * selected device supports those features.
- *
- * \subsection 

[39/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_count_interrupt.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_count_interrupt.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_count_interrupt.h
deleted file mode 100755
index 02fdd5d..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_count_interrupt.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * \file
- *
- * \brief SAM RTC Driver (Count Interrupt Mode)
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef RTC_COUNT_INTERRUPT_H_INCLUDED
-#define RTC_COUNT_INTERRUPT_H_INCLUDED
-
-#include "rtc_count.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \addtogroup asfdoc_sam0_rtc_count_group
- * @{
- */
-
- /**
- * \name Callbacks
- * @{
- */
-enum status_code rtc_count_register_callback(
-   struct rtc_module *const module,
-   rtc_count_callback_t callback,
-   enum rtc_count_callback callback_type);
-
-enum status_code rtc_count_unregister_callback(
-   struct rtc_module *const module,
-   enum rtc_count_callback callback_type);
-
-void rtc_count_enable_callback(
-   struct rtc_module *const module,
-   enum rtc_count_callback callback_type);
-
-void rtc_count_disable_callback(
-   struct rtc_module *const module,
-   enum rtc_count_callback callback_type);
-
-/** @} */
-
-/** @} */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* RTC_COUNT_INTERRUPT_H_INCLUDED */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_sam_d_r/rtc_calendar.c
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_sam_d_r/rtc_calendar.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_sam_d_r/rtc_calendar.c
deleted file mode 100755
index 189aa55..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/rtc/rtc_sam_d_r/rtc_calendar.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/**
- * \file
- *
- * \brief SAM RTC Driver (Calendar Mode)
- *
- * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * 

[45/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/dma/dma_crc.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/dma/dma_crc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/dma/dma_crc.h
deleted file mode 100755
index 3d8c27c..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/dma/dma_crc.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/**
- * \file
- *
- * \brief SAM DMA cyclic redundancy check (CRC) Driver
- *
- * Copyright (C) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#ifndef DMA_CRC_H_INCLUDED
-#define DMA_CRC_H_INCLUDED
-
-#include 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** DMA channel n offset. */
-#define DMA_CRC_CHANNEL_N_OFFSET 0x20
-
-/** CRC Polynomial Type. */
-enum crc_polynomial_type {
-   /** CRC16 (CRC-CCITT). */
-   CRC_TYPE_16,
-   /** CRC32 (IEEE 802.3). */
-   CRC_TYPE_32,
-};
-
-/** CRC Beat Type. */
-enum crc_beat_size {
-   /** Byte bus access. */
-   CRC_BEAT_SIZE_BYTE,
-   /** Half-word bus access. */
-   CRC_BEAT_SIZE_HWORD,
-   /** Word bus access. */
-   CRC_BEAT_SIZE_WORD,
-};
-
-/** Configurations for CRC calculation. */
-struct dma_crc_config {
-   /** CRC polynomial type. */
-   enum crc_polynomial_type type;
-   /** CRC beat size. */
-   enum crc_beat_size size;
-};
-
-/**
- * \brief Get DMA CRC default configurations.
- *
- * The default configuration is as follows:
- *  \li Polynomial type is set to CRC-16(CRC-CCITT)
- *  \li CRC Beat size: BYTE
- *
- * \param[in] config default configurations
- */
-static inline void dma_crc_get_config_defaults(struct dma_crc_config *config)
-{
-   Assert(config);
-
-   config->type = CRC_TYPE_16;
-   config->size = CRC_BEAT_SIZE_BYTE;
-}
-
-/**
- * \brief Enable DMA CRC module with an DMA channel.
- *
- * This function enables a CRC calculation with an allocated DMA channel. This 
channel ID
- * can be gotten from a successful \ref dma_allocate.
- *
- * \param[in] channel_id DMA channel expected with CRC calculation
- * \param[in] config CRC calculation configurations
- *
- * \return Status of the DMC CRC.
- * \retval STATUS_OK Get the DMA CRC module
- * \retval STATUS_BUSY DMA CRC module is already taken and not ready yet
- */
-static inline enum status_code dma_crc_channel_enable(uint32_t channel_id,
-   struct dma_crc_config *config)
-{
-   if (DMAC->CRCSTATUS.reg & DMAC_CRCSTATUS_CRCBUSY) {
-   return STATUS_BUSY;
-   }
-
-   DMAC->CRCCTRL.reg = DMAC_CRCCTRL_CRCBEATSIZE(config->size) |
-   DMAC_CRCCTRL_CRCPOLY(config->type) |
-   DMAC_CRCCTRL_CRCSRC(channel_id+DMA_CRC_CHANNEL_N_OFFSET);
-
-   DMAC->CTRL.reg |= DMAC_CTRL_CRCENABLE;
-
-   return STATUS_OK;
-}
-
-/**
- * \brief Disable DMA CRC module.
- *
- */
-static inline void dma_crc_disable(void)
-{
-   DMAC->CTRL.reg &= ~DMAC_CTRL_CRCENABLE;
-   DMAC->CRCCTRL.reg = 0;
-}
-
-/**
- * \brief Get DMA CRC checksum value.
- *
- * \return Calculated CRC checksum.
- */
-static inline uint32_t dma_crc_get_checksum(void)
-{
-   if (DMAC->CRCCTRL.bit.CRCSRC == 

[49/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/ac/ac.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/ac/ac.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/ac/ac.h
deleted file mode 100755
index f6741d0..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/ac/ac.h
+++ /dev/null
@@ -1,1430 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Analog Comparator Driver
- *
- * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#ifndef AC_H_INCLUDED
-#define AC_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_ac_group SAM Analog Comparator (AC) Driver
- *
- * This driver for Atmel | SMART ARM-based microcontrollers
- * provides an interface for the configuration
- * and management of the device's Analog Comparator functionality, for the
- * comparison of analog voltages against a known reference voltage to determine
- * its relative level. The following driver API modes are covered by this
- * manual:
- * - Polled APIs
- * \if AC_CALLBACK_MODE
- * - Callback APIs
- * \endif
- *
- * The following peripherals are used by this module:
- *  - AC (Analog Comparator)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D10/D11
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM DA1
- *  - Atmel | SMART SAM C20/C21
- *
- * The outline of this documentation is as follows:
- *  - \ref asfdoc_sam0_ac_prerequisites
- *  - \ref asfdoc_sam0_ac_module_overview
- *  - \ref asfdoc_sam0_ac_special_considerations
- *  - \ref asfdoc_sam0_ac_extra_info
- *  - \ref asfdoc_sam0_ac_examples
- *  - \ref asfdoc_sam0_ac_api_overview
- *
- *
- * \section asfdoc_sam0_ac_prerequisites Prerequisites
- *
- * There are no prerequisites for this module.
- *
- *
- * \section asfdoc_sam0_ac_module_overview Module Overview
- *
- * The Analog Comparator module provides an interface for the comparison of one
- * or more analog voltage inputs (sourced from external or internal inputs)
- * against a known reference voltage, to determine if the unknown voltage is
- * higher or lower than the reference. Additionally, window functions are
- * provided so that two comparators can be connected together to determine if
- * an input is below, inside, above, or outside the two reference points of the
- * window.
- *
- * Each comparator requires two analog input voltages, a positive and negative
- * channel input. The result of the comparison is a binary \c true if the
- * comparator's positive channel input is higher than the comparator's negative
- * input channel, and \c false if otherwise.
- *
- *
- * \subsection asfdoc_sam0_ac_module_features Driver Feature Macro Definition
- * 
- *
- *  Driver Feature Macro
- *  Supported devices
- *
- *
- *  FEATURE_AC_HYSTERESIS_LEVEL
- *  SAM L21/L22/C20/C21
- *
- *
- *  FEATURE_AC_SYNCBUSY_SCHEME_VERSION_2
- *  SAM L21/L22/C20/C21
- *
- *
- *  FEATURE_AC_RUN_IN_STANDY_EACH_COMPARATOR
- *  SAM L21/L22/C20/C21
- *
- *
- *  FEATURE_AC_RUN_IN_STANDY_PAIR_COMPARATOR
- *  SAM 

[48/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc.h
deleted file mode 100755
index 27fae74..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/adc/adc.h
+++ /dev/null
@@ -1,1145 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Peripheral Analog-to-Digital Converter Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef ADC_H_INCLUDED
-#define ADC_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_adc_group SAM Analog-to-Digital Converter (ADC) Driver
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides 
an interface for the configuration
- * and management of the device's Analog-to-Digital Converter functionality, 
for
- * the conversion of analog voltages into a corresponding digital form.
- * The following driver Application Programming Interface (API) modes are 
covered by this manual:
- * - Polled APIs
- * \if ADC_CALLBACK_MODE
- * - Callback APIs
- * \endif
- *
- * The following peripheral is used by this module:
- *  - ADC (Analog-to-Digital Converter)
- *
- * The following devices can use this module:
- * \if DEVICE_SAML21_SUPPORT
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM C20/C21
- * \else
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D09/D10/D11
- *  - Atmel | SMART SAM DA1
- * \endif
- *
- * The outline of this documentation is as follows:
- *  - \ref asfdoc_sam0_adc_prerequisites
- *  - \ref asfdoc_sam0_adc_module_overview
- *  - \ref asfdoc_sam0_adc_special_considerations
- *  - \ref asfdoc_sam0_adc_extra_info
- *  - \ref asfdoc_sam0_adc_examples
- *  - \ref asfdoc_sam0_adc_api_overview
- *
- *
- * \section asfdoc_sam0_adc_prerequisites Prerequisites
- *
- * There are no prerequisites for this module.
- *
- *
- * \section asfdoc_sam0_adc_module_overview Module Overview
- *
- * This driver provides an interface for the Analog-to-Digital conversion
- * functions on the device, to convert analog voltages to a corresponding
- * digital value. The ADC has up to 12-bit resolution, and is capable of
- * \if DEVICE_SAML21_SUPPORT
- * converting up to 1,000,000 samples per second (MSPS).
- * \else
- * converting up to 500K samples per second (KSPS).
- * \endif
- *
- * The ADC has a compare function for accurate monitoring of user defined
- * thresholds with minimum software intervention required.
- * The ADC may be configured for 8-, 10-, or 12-bit result, reducing the
- * conversion time. ADC conversion results are provided left or right adjusted
- * which eases calculation when the result is represented as a signed integer.
- *
- * The input selection is flexible, and both single-ended and differential
- * measurements can be made. For differential measurements, an optional gain
- * stage is available to increase the dynamic range. In addition, several
- * internal signal inputs are available. The ADC can provide both signed and
- * unsigned results.
- *
- * The ADC measurements can either be started by application software or 

[37/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_sam0/i2c_master_interrupt.c
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_sam0/i2c_master_interrupt.c
 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_sam0/i2c_master_interrupt.c
deleted file mode 100755
index 10dfcdf..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_sam0/i2c_master_interrupt.c
+++ /dev/null
@@ -1,755 +0,0 @@
-/**
- * \file
- *
- * \brief SAM I2C Master Interrupt Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#include "i2c_master_interrupt.h"
-
-extern enum status_code _i2c_master_wait_for_bus(
-   struct i2c_master_module *const module);
-
-extern enum status_code _i2c_master_address_response(
-   struct i2c_master_module *const module);
-
-extern enum status_code _i2c_master_send_hs_master_code(
-   struct i2c_master_module *const module,
-   uint8_t hs_master_code);;
-
-/**
- * \internal
- * Read next data. Used by interrupt handler to get next data byte from slave.
- *
- * \param[in,out] module  Pointer to software module structure
- */
-static void _i2c_master_read(
-   struct i2c_master_module *const module)
-{
-   /* Sanity check arguments. */
-   Assert(module);
-   Assert(module->hw);
-
-   SercomI2cm *const i2c_module = &(module->hw->I2CM);
-   bool sclsm_flag = i2c_module->CTRLA.bit.SCLSM;
-
-   /* Find index to save next value in buffer */
-   uint16_t buffer_index = module->buffer_length;
-   buffer_index -= module->buffer_remaining;
-
-   module->buffer_remaining--;
-
-   if (sclsm_flag) {
-   if (module->send_nack && module->buffer_remaining == 1) {
-   /* Set action to NACK. */
-   i2c_module->CTRLB.reg |= SERCOM_I2CM_CTRLB_ACKACT;
-   }
-   } else {
-   if (module->send_nack && module->buffer_remaining == 0) {
-   /* Set action to NACK. */
-   i2c_module->CTRLB.reg |= SERCOM_I2CM_CTRLB_ACKACT;
-   }
-   }
-
-   if (module->buffer_remaining == 0) {
-   if (module->send_stop) {
-   /* Send stop condition */
-   _i2c_master_wait_for_sync(module);
-   i2c_module->CTRLB.reg |= SERCOM_I2CM_CTRLB_CMD(3);
-   }
-   }
-   
-   /* Read byte from slave and put in buffer */
-   _i2c_master_wait_for_sync(module);
-   module->buffer[buffer_index] = i2c_module->DATA.reg;
-}
-
-/**
- * \internal
- *
- * Write next data. Used by interrupt handler to send next data byte to slave.
- *
- * \param[in,out] module  Pointer to software module structure
- */
-static void _i2c_master_write(struct i2c_master_module *const module)
-{
-   /* Sanity check arguments. */
-   Assert(module);
-   Assert(module->hw);
-
-   SercomI2cm *const i2c_module = &(module->hw->I2CM);
-
-   /* Check for ack from slave */
-   if (i2c_module->STATUS.reg 

[36/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h
deleted file mode 100755
index cf1c436..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_slave_interrupt.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/**
- * \file
- *
- * \brief SAM SERCOM I2C Slave Interrupt Driver
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef I2C_SLAVE_INTERRUPT_H_INCLUDED
-#define I2C_SLAVE_INTERRUPT_H_INCLUDED
-
-#include "i2c_slave.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \addtogroup asfdoc_sam0_sercom_i2c_group
- * @{
- *
- */
-
-/**
- * \name Address Match Functionality
- * @{
- */
-
-void i2c_slave_enable_nack_on_address(
-   struct i2c_slave_module *const module);
-void i2c_slave_disable_nack_on_address(
-   struct i2c_slave_module *const module);
-
-/** @} */
-
-/**
- * \name Callbacks
- * @{
- */
-#if !defined(__DOXYGEN__)
-void _i2c_slave_interrupt_handler(uint8_t instance);
-#endif
-
-void i2c_slave_register_callback(
-   struct i2c_slave_module *const module,
-   i2c_slave_callback_t callback,
-   enum i2c_slave_callback callback_type);
-
-void i2c_slave_unregister_callback(
-   struct i2c_slave_module *const module,
-   enum i2c_slave_callback callback_type);
-
-/**
- * \brief Enables callback
- *
- * Enables the callback specified by the callback_type.
- *
- * \param[in,out]  module Pointer to the software module struct
- * \param[in]  callback_type  Callback type to enable
- */
-static inline void i2c_slave_enable_callback(
-   struct i2c_slave_module *const module,
-   enum i2c_slave_callback callback_type)
-{
-   /* Sanity check */
-   Assert(module);
-   Assert(module->hw);
-
-   /* Mark callback as enabled */
-   module->enabled_callback |= (1 << callback_type);
-
-   /* Enable address callback */
-   SercomI2cs *const i2c_hw = &(module->hw->I2CS);
-   if (callback_type == I2C_SLAVE_CALLBACK_READ_REQUEST ||
-   callback_type == I2C_SLAVE_CALLBACK_WRITE_REQUEST) {
-   i2c_hw->INTENSET.reg = SERCOM_I2CS_INTFLAG_AMATCH;
-   }
-}
-
-/**
- * \brief Disables callback
- *
- * Disables the callback specified by the callback_type.
- *
- * \param[in,out]  module Pointer to the software module struct
- * \param[in]  callback_type  Callback type to disable
- */
-static inline void i2c_slave_disable_callback(
-   struct i2c_slave_module *const module,
-   enum i2c_slave_callback callback_type)
-{
-   /* Sanity check */
-   Assert(module);
-   Assert(module->hw);
-
-   /* Mark callback as disabled */
-   module->enabled_callback &= ~(1 << callback_type);
-   SercomI2cs *const i2c_hw = &(module->hw->I2CS);
-   if (callback_type == I2C_SLAVE_CALLBACK_READ_REQUEST ||
-

[54/70] [abbrv] incubator-mynewt-larva git commit: Treat 'del' and left-arrow like backspace. Right-arrow inserts space, up/down arrows do nothing.

2016-03-03 Thread ccollins
Treat 'del' and left-arrow like backspace. Right-arrow inserts space,
up/down arrows do nothing.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/ef317077
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/ef317077
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/ef317077

Branch: refs/heads/master
Commit: ef317077d66b574c5b586e3c05cffd2eb2ee356e
Parents: c7e5c93
Author: Marko Kiiskila 
Authored: Tue Mar 1 15:38:42 2016 -0800
Committer: Marko Kiiskila 
Committed: Tue Mar 1 15:38:42 2016 -0800

--
 libs/console/full/src/cons_tty.c | 75 ++-
 1 file changed, 65 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ef317077/libs/console/full/src/cons_tty.c
--
diff --git a/libs/console/full/src/cons_tty.c b/libs/console/full/src/cons_tty.c
index 88597e9..2d254e4 100644
--- a/libs/console/full/src/cons_tty.c
+++ b/libs/console/full/src/cons_tty.c
@@ -6,7 +6,7 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing,
@@ -31,6 +31,14 @@ int console_is_midline;
 #define CONSOLE_TX_BUF_SZ  32  /* IO buffering, must be power of 2 */
 #define CONSOLE_RX_BUF_SZ  128
 
+
+#define CONSOLE_DEL0x7f/* del character */
+#define CONSOLE_ESC0x1b/* esc character */
+#define CONSOLE_LEFT   'D' /* esc-[-D emitted when moving left */
+#define CONSOLE_UP 'A' /* esc-[-A moving up */
+#define CONSOLE_RIGHT  'C' /* esc-[-C moving right */
+#define CONSOLE_DOWN   'B' /* esc-[-B moving down */
+
 #define CONSOLE_HEAD_INC(cr)   (((cr)->cr_head + 1) & ((cr)->cr_size - 1))
 #define CONSOLE_TAIL_INC(cr)   (((cr)->cr_tail + 1) & ((cr)->cr_size - 1))
 
@@ -52,6 +60,7 @@ struct console_tty {
 console_rx_cb ct_rx_cb;/* callback that input is ready */
 console_write_char ct_write_char;
 uint8_t ct_echo_off:1;
+uint8_t ct_esc_seq:2;
 } console_tty;
 
 static void
@@ -71,11 +80,14 @@ console_pull_char(struct console_ring *cr)
 return ch;
 }
 
-static void
+static int
 console_pull_char_head(struct console_ring *cr)
 {
 if (cr->cr_head != cr->cr_tail) {
 cr->cr_head = (cr->cr_head - 1) & (cr->cr_size - 1);
+return 0;
+} else {
+return -1;
 }
 }
 
@@ -254,21 +266,63 @@ console_rx_char(void *arg, uint8_t data)
 ct->ct_rx_cb(1);
 }
 break;
+case CONSOLE_ESC:
+ct->ct_esc_seq = 1;
+goto out;
+case '[':
+if (ct->ct_esc_seq == 1) {
+ct->ct_esc_seq = 2;
+goto out;
+} else {
+goto queue_char;
+}
+break;
+case CONSOLE_LEFT:
+if (ct->ct_esc_seq == 2) {
+goto backspace;
+} else {
+goto queue_char;
+}
+break;
+case CONSOLE_UP:
+case CONSOLE_DOWN:
+if (ct->ct_esc_seq == 2) {
+/*
+ * Do nothing.
+ */
+ct->ct_esc_seq = 0;
+goto out;
+}
+goto queue_char;
+case CONSOLE_RIGHT:
+if (ct->ct_esc_seq == 2) {
+data = ' '; /* add space */
+}
+goto queue_char;
 case '\b':
+case CONSOLE_DEL:
+backspace:
 /*
  * backspace
  */
-tx_buf[0] = '\b';
-tx_buf[1] = ' ';
-tx_buf[2] = '\b';
-tx_space = 3;
-console_pull_char_head(rx);
+ct->ct_esc_seq = 0;
+if (console_pull_char_head(rx) == 0) {
+/*
+ * Only wipe out char if we can pull stuff off from head.
+ */
+tx_buf[0] = '\b';
+tx_buf[1] = ' ';
+tx_buf[2] = '\b';
+tx_space = 3;
+} else {
+goto out;
+}
 break;
 default:
+queue_char:
 tx_buf[0] = data;
 tx_space = 1;
-if (!ct->ct_echo_off) {
-}
+ct->ct_esc_seq = 0;
 console_add_char(rx, data);
 break;
 }
@@ -281,10 +335,11 @@ console_rx_char(void *arg, uint8_t data)
 }
 hal_uart_start_tx(CONSOLE_UART);
 }
+out:
 return 0;
 }
 
-int 
+int
 console_is_init(void)
 {
 return (g_console_is_init);



[62/70] [abbrv] incubator-mynewt-larva git commit: Don't invoke bin2img from download scripts.

2016-03-03 Thread ccollins
Don't invoke bin2img from download scripts.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/ae87902d
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/ae87902d
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/ae87902d

Branch: refs/heads/master
Commit: ae87902d5d8f34b8752b2fa5d8fe913f5e563a27
Parents: cdf3a77
Author: Marko Kiiskila 
Authored: Wed Mar 2 17:20:49 2016 -0800
Committer: Marko Kiiskila 
Committed: Wed Mar 2 17:20:49 2016 -0800

--
 hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh  | 11 ---
 hw/bsp/nrf51dk/nrf51dk_download.sh  | 11 ---
 .../olimex_stm32-e407_devboard_download.sh  | 12 
 3 files changed, 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ae87902d/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
--
diff --git a/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh 
b/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
index 9f57060..4d8691e 100755
--- a/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
+++ b/hw/bsp/nrf51dk-16kbram/nrf51dk-16kbram_download.sh
@@ -30,8 +30,6 @@ fi
 
 IS_BOOTLOADER=0
 BASENAME=$1
-BIN2IMG=project/bin2img/bin/bin2img/bin2img.elf
-VER=11.22.33.0
 #JLINK_SCRIPT=.download.jlink
 GDB_CMD_FILE=.gdb_cmds
 
@@ -49,16 +47,7 @@ if [ $IS_BOOTLOADER -eq 1 ]; then
 FILE_NAME=$BASENAME.elf.bin
 else
 FLASH_OFFSET=0x7000
-ELF_FILE=$BASENAME.elf
-BIN_FILE=$BASENAME.elf.bin
 FILE_NAME=$BASENAME.img
-if [ \! -f $FILE_NAME -o $FILE_NAME -ot $ELF_FILE ]; then
-echo "Version is >" $VER "<"
-$BIN2IMG $BASENAME.elf.bin $FILE_NAME $VER
-if [ "$?" -ne 0 ]; then
-   exit 1
-   fi
-fi
 fi
 
 echo "Downloading" $FILE_NAME "to" $FLASH_OFFSET

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ae87902d/hw/bsp/nrf51dk/nrf51dk_download.sh
--
diff --git a/hw/bsp/nrf51dk/nrf51dk_download.sh 
b/hw/bsp/nrf51dk/nrf51dk_download.sh
index 78b7b29..4d8691e 100755
--- a/hw/bsp/nrf51dk/nrf51dk_download.sh
+++ b/hw/bsp/nrf51dk/nrf51dk_download.sh
@@ -30,8 +30,6 @@ fi
 
 IS_BOOTLOADER=0
 BASENAME=$1
-BIN2IMG=project/bin2img/bin/bin2img/bin2img.elf
-VER=11.22.33.0
 #JLINK_SCRIPT=.download.jlink
 GDB_CMD_FILE=.gdb_cmds
 
@@ -49,16 +47,7 @@ if [ $IS_BOOTLOADER -eq 1 ]; then
 FILE_NAME=$BASENAME.elf.bin
 else
 FLASH_OFFSET=0x7000
-ELF_FILE=$BASENAME.elf
-BIN_FILE=$BASENAME.elf.bin
 FILE_NAME=$BASENAME.img
-if [ \! -f $FILE_NAME -o $FILE_NAME -ot $ELF_FILE ]; then
-echo "Version is >" $VER "<"
-$BIN2IMG $BIN_FILE $FILE_NAME $VER
-if [ "$?" -ne 0 ]; then
- exit 1
-fi
-fi
 fi
 
 echo "Downloading" $FILE_NAME "to" $FLASH_OFFSET

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ae87902d/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
--
diff --git 
a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh 
b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
index 79e2439..3467e64 100755
--- a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
+++ b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
@@ -30,8 +30,6 @@ fi
 
 BASENAME=$1
 IS_BOOTLOADER=0
-BIN2IMG=project/bin2img/bin/bin2img/bin2img.elf
-VER=11.22.33.44
 
 # Look for 'bootloader' from 2nd arg onwards
 shift
@@ -47,17 +45,7 @@ if [ $IS_BOOTLOADER -eq 1 ]; then
 FILE_NAME=$BASENAME.elf.bin
 else
 FLASH_OFFSET=0x0802
-ELF_FILE=$BASENAME.elf
-BIN_FILE=$BASENAME.elf.bin
 FILE_NAME=$BASENAME.img
-# If there is no image file, or it is older than bin file, run bin2img.
-if [ ! -f $FILE_NAME -o $FILE_NAME -ot $ELF_FILE ]; then
-echo "Version is >" $VER "<"
-$BIN2IMG $BIN_FILE $FILE_NAME $VER
-if [ "$?" -ne 0 ]; then
-   exit 1
-   fi
-fi
 fi
 echo "Downloading" $FILE_NAME "to" $FLASH_OFFSET
 



[70/70] [abbrv] incubator-mynewt-larva git commit: Merge remote-tracking branch 'origin/develop'

2016-03-03 Thread ccollins
Merge remote-tracking branch 'origin/develop'


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/db0e97b1
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/db0e97b1
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/db0e97b1

Branch: refs/heads/master
Commit: db0e97b1e771798f23c0c2651621486b20c939a5
Parents: ba1586a 8bc63a5
Author: Christopher Collins 
Authored: Thu Mar 3 16:39:20 2016 -0800
Committer: Christopher Collins 
Committed: Thu Mar 3 16:39:20 2016 -0800

--
 .gitignore  |4 +
 LICENSE |2 +
 autotargets |   31 -
 compiler/arm-none-eabi-m0/compiler.yml  |   34 -
 compiler/arm-none-eabi-m0/pkg.yml   |   24 +
 compiler/arm-none-eabi-m4/compiler.yml  |   34 -
 compiler/arm-none-eabi-m4/pkg.yml   |   25 +
 compiler/sim/compiler.yml   |   32 -
 compiler/sim/linux-compiler.yml |   11 +
 compiler/sim/osx-compiler.yml   |   10 +
 compiler/sim/pkg.yml|   23 +
 fs/fs/include/fs/fs.h   |   28 +-
 fs/fs/pkg.yml   |   10 +
 fs/fs/src/fs_cli.c  |   33 +-
 fs/nffs/include/nffs/nffs.h |2 -
 fs/nffs/pkg.yml |   12 +-
 fs/nffs/src/nffs.c  |   44 +-
 fs/nffs/src/nffs_block.c|  122 +-
 fs/nffs/src/nffs_file.c |4 +-
 fs/nffs/src/nffs_flash.c|   20 +-
 fs/nffs/src/nffs_format.c   |4 +-
 fs/nffs/src/nffs_gc.c   |   25 +-
 fs/nffs/src/nffs_inode.c|  131 +-
 fs/nffs/src/nffs_misc.c |   12 +
 fs/nffs/src/nffs_priv.h |   11 +
 fs/nffs/src/nffs_restore.c  |  162 +-
 fs/nffs/src/test/arch/sim/nffs_test.c   |   56 +-
 hw/bsp/native/include/bsp/bsp.h |3 +
 hw/bsp/native/pkg.yml   |   11 +-
 hw/bsp/nrf51dk-16kbram/include/bsp/bsp.h|2 +
 .../nrf51dk-16kbram/nrf51dk-16kbram_download.sh |   11 -
 hw/bsp/nrf51dk-16kbram/pkg.yml  |   19 +-
 hw/bsp/nrf51dk/include/bsp/bsp.h|3 +
 hw/bsp/nrf51dk/nrf51dk_download.sh  |   11 -
 hw/bsp/nrf51dk/pkg.yml  |   11 +-
 hw/bsp/nrf52pdk/include/bsp/bsp.h   |2 +
 hw/bsp/nrf52pdk/pkg.yml |   19 +-
 .../include/bsp/bsp.h   |2 +
 .../olimex_stm32-e407_devboard_download.sh  |   12 -
 hw/bsp/olimex_stm32-e407_devboard/pkg.yml   |   12 +-
 hw/hal/include/hal/hal_gpio.h   |   24 +-
 hw/hal/pkg.yml  |6 +
 hw/mcu/native/pkg.yml   |   11 +-
 hw/mcu/native/src/hal_gpio.c|   20 +-
 hw/mcu/nordic/nrf51xxx/pkg.yml  |   10 +-
 hw/mcu/nordic/nrf51xxx/src/hal_gpio.c   |   34 +-
 hw/mcu/nordic/nrf52xxx/pkg.yml  |   10 +-
 hw/mcu/nordic/nrf52xxx/src/hal_gpio.c   |   34 +-
 hw/mcu/stm/stm32f4xx/pkg.yml|   11 +-
 hw/mcu/stm/stm32f4xx/src/hal_gpio.c |   38 +-
 libs/baselibc/pkg.yml   |7 +
 libs/baselibc/src/realloc.c |4 +-
 libs/bootutil/include/bootutil/image.h  |   25 +-
 libs/bootutil/include/bootutil/loader.h |3 +
 libs/bootutil/pkg.yml   |   11 +-
 libs/bootutil/src/bootutil_priv.h   |2 +
 libs/bootutil/src/image_validate.c  |  102 +
 libs/bootutil/src/loader.c  |   21 +-
 libs/bootutil/src/test/boot_test.c  |  248 +-
 .../include/cmsis-core/core_cm0plus.h   |4 +-
 libs/cmsis-core/pkg.yml |9 +-
 libs/cmsis-core/src/cmsis_nvic.c|   11 +-
 libs/console/full/pkg.yml   |6 +
 libs/console/full/src/cons_tty.c|   75 +-
 libs/console/stub/pkg.yml   |6 +
 libs/elua/elua_base/pkg.yml |   11 +
 libs/elua/elua_base/src/lmynewt.c   |9 +-
 libs/flash_test/include/flash_test/flash_test.h |   27 +
 libs/flash_test/pkg.yml |   30 +
 libs/flash_test/src/flash_test/flash_test.c |  153 +
 libs/imgmgr/pkg.yml |6 +
 libs/json/include/json/json.h   |   31 +-
 libs/json/pkg.yml  

[27/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc.h
deleted file mode 100755
index 728e9d4..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/tc/tc.h
+++ /dev/null
@@ -1,1785 +0,0 @@
-/**
- * \file
- *
- * \brief SAM TC - Timer Counter Driver
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef TC_H_INCLUDED
-#define TC_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_tc_group SAM Timer/Counter (TC) Driver 
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides 
an interface for the configuration
- * and management of the timer modules within the device, for waveform
- * generation and timing operations. The following driver API modes are covered
- * by this manual:
- *
- *  - Polled APIs
- * \if TC_CALLBACK_MODE
- *  - Callback APIs
- * \endif
- *
- *
- * The following peripheral is used by this module:
- *  - TC (Timer/Counter)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D09/D10/D11
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM DA1
- *  - Atmel | SMART SAM C20/C21
- *
- * The outline of this documentation is as follows:
- *  - \ref asfdoc_sam0_tc_prerequisites
- *  - \ref asfdoc_sam0_tc_module_overview
- *  - \ref asfdoc_sam0_tc_special_considerations
- *  - \ref asfdoc_sam0_tc_extra_info
- *  - \ref asfdoc_sam0_tc_examples
- *  - \ref asfdoc_sam0_tc_api_overview
- *
- *
- * \section asfdoc_sam0_tc_prerequisites Prerequisites
- *
- * There are no prerequisites for this module.
- *
- *
- * \section asfdoc_sam0_tc_module_overview Module Overview
- *
- * The Timer/Counter (TC) module provides a set of timing and counting related
- * functionality, such as the generation of periodic waveforms, the capturing
- * of a periodic waveform's frequency/duty cycle, and software timekeeping for
- * periodic operations. TC modules can be configured to use an 8-, 16-, or
- * 32-bit counter size.
- *
- * This TC module for the SAM is capable of the following functions:
- *
- * - Generation of PWM signals
- * - Generation of timestamps for events
- * - General time counting
- * - Waveform period capture
- * - Waveform frequency capture
- *
- * \ref asfdoc_sam0_tc_block_diagram "The diagram below" shows the overview
- * of the TC module design.
- *
- * \anchor asfdoc_sam0_tc_block_diagram
- * \image html overview.svg "Basic Overview of the TC Module"
- *
- *
- * \subsection asfdoc_sam0_tc_features Driver Feature Macro Definition
- * 
- *  
- *Driver Feature Macro
- *Supported devices
- *  
- *  
- *FEATURE_TC_DOUBLE_BUFFERED
- *SAM L21/L22/C20/C21
- *  
- *  
- *FEATURE_TC_SYNCBUSY_SCHEME_VERSION_2
- *SAM L21/L22/C20/C21
- *  
- *  
- *FEATURE_TC_STAMP_PW_CAPTURE
- *SAM L21/L22/C20/C21
- *  
- *  
- *FEATURE_TC_READ_SYNC
- *SAM L21/L22/C20/C21
- *  
- *  
- *FEATURE_TC_IO_CAPTURE
- *SAM L21/L22/C20/C21
- *  
- *  
- *FEATURE_TC_GENERATE_DMA_TRIGGER
- 

[58/70] [abbrv] incubator-mynewt-larva git commit: (MYNEWT-141) Account for changes to the newt tool.

2016-03-03 Thread ccollins
(MYNEWT-141) Account for changes to the newt tool.

(MYNEWT-141) Newt tool - Replace SQLite targets with directories / yml
files.

Changes to larva are:
* Delete the autotargets file; newt doesn't use it anymore.
* Add a target definition for bin2img (targets/bin2img/pkg.yml)
* Add "targets" to .gitignore; prevent accidental commits of
  personal targets.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/d204db2b
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/d204db2b
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/d204db2b

Branch: refs/heads/master
Commit: d204db2bd461a535b933ba73cb473e820f0b4e4a
Parents: ded5c1f
Author: Christopher Collins 
Authored: Tue Mar 1 19:29:05 2016 -0800
Committer: Christopher Collins 
Committed: Tue Mar 1 19:54:32 2016 -0800

--
 .gitignore  |  4 
 autotargets | 31 ---
 targets/bin2img/pkg.yml |  9 +
 3 files changed, 13 insertions(+), 31 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/d204db2b/.gitignore
--
diff --git a/.gitignore b/.gitignore
index 5d22f6c..b371678 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,7 @@ tags
 .DS_Store
 *.swp
 *.swo
+
+# Prevent accidental checkins of personal targets.  If you need to commit a
+# target, specify the -f option for "git add".
+targets

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/d204db2b/autotargets
--
diff --git a/autotargets b/autotargets
deleted file mode 100644
index 7619fb4..000
--- a/autotargets
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Common targets
-#
-@target=bin2img
-bsp=hw/bsp/native
-compiler=sim
-project=bin2img
-compiler_def=debug
-name=bin2img
-arch=sim
-@endtargets
-

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/d204db2b/targets/bin2img/pkg.yml
--
diff --git a/targets/bin2img/pkg.yml b/targets/bin2img/pkg.yml
new file mode 100644
index 000..90845f7
--- /dev/null
+++ b/targets/bin2img/pkg.yml
@@ -0,0 +1,9 @@
+### Target: bin2img
+
+pkg.arch: sim
+pkg.bsp: hw/bsp/native
+pkg.compiler: sim
+pkg.compiler_def: debug
+pkg.name: bin2img
+pkg.project: bin2img
+pkg.vers: 0.0.1



[20/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/eic.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/eic.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/eic.h
deleted file mode 100755
index 8c324a4..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/eic.h
+++ /dev/null
@@ -1,684 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for EIC
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_EIC_COMPONENT_
-#define _SAMD21_EIC_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR EIC */
-/* == 
*/
-/** \addtogroup SAMD21_EIC External Interrupt Controller */
-/*@{*/
-
-#define EIC_U2217
-#define REV_EIC 0x101
-
-/*  EIC_CTRL : (EIC Offset: 0x00) (R/W  8) Control  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint8_t  ENABLE:1; /*!< bit:  1  Enable
 */
-uint8_t  :6;   /*!< bit:  2.. 7  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} EIC_CTRL_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define EIC_CTRL_OFFSET 0x00 /**< \brief (EIC_CTRL offset) 
Control */
-#define EIC_CTRL_RESETVALUE 0x00ul   /**< \brief (EIC_CTRL 
reset_value) Control */
-
-#define EIC_CTRL_SWRST_Pos  0/**< \brief (EIC_CTRL) 
Software Reset */
-#define EIC_CTRL_SWRST  (0x1ul << EIC_CTRL_SWRST_Pos)
-#define EIC_CTRL_ENABLE_Pos 1/**< \brief (EIC_CTRL) Enable 
*/
-#define EIC_CTRL_ENABLE (0x1ul << EIC_CTRL_ENABLE_Pos)
-#define EIC_CTRL_MASK   0x03ul   /**< \brief (EIC_CTRL) MASK 
Register */
-
-/*  EIC_STATUS : (EIC Offset: 0x01) (R/   8) Status  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  :7;   /*!< bit:  0.. 6  Reserved  
 */
-uint8_t  SYNCBUSY:1;   /*!< bit:  7  Synchronization Busy  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} EIC_STATUS_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define EIC_STATUS_OFFSET   0x01 /**< \brief (EIC_STATUS 
offset) Status */
-#define EIC_STATUS_RESETVALUE   0x00ul   /**< \brief (EIC_STATUS 
reset_value) Status */
-
-#define EIC_STATUS_SYNCBUSY_Pos 7

[01/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/master ba1586a4f -> db0e97b1e


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16bu.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16bu.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16bu.h
deleted file mode 100755
index ab890b5..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16bu.h
+++ /dev/null
@@ -1,641 +0,0 @@
-/**
- * \file
- *
- * \brief Peripheral I/O description for SAMD21E16BU
- *
- * Copyright (c) 2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-
-#ifndef _SAMD21E16BU_PIO_
-#define _SAMD21E16BU_PIO_
-
-#define PIN_PA00   0  /**< \brief Pin Number for PA00 
*/
-#define PORT_PA00 (1ul <<  0) /**< \brief PORT Mask  for PA00 
*/
-#define PIN_PA01   1  /**< \brief Pin Number for PA01 
*/
-#define PORT_PA01 (1ul <<  1) /**< \brief PORT Mask  for PA01 
*/
-#define PIN_PA02   2  /**< \brief Pin Number for PA02 
*/
-#define PORT_PA02 (1ul <<  2) /**< \brief PORT Mask  for PA02 
*/
-#define PIN_PA03   3  /**< \brief Pin Number for PA03 
*/
-#define PORT_PA03 (1ul <<  3) /**< \brief PORT Mask  for PA03 
*/
-#define PIN_PA04   4  /**< \brief Pin Number for PA04 
*/
-#define PORT_PA04 (1ul <<  4) /**< \brief PORT Mask  for PA04 
*/
-#define PIN_PA05   5  /**< \brief Pin Number for PA05 
*/
-#define PORT_PA05 (1ul <<  5) /**< \brief PORT Mask  for PA05 
*/
-#define PIN_PA06   6  /**< \brief Pin Number for PA06 
*/
-#define PORT_PA06 (1ul <<  6) /**< \brief PORT Mask  for PA06 
*/
-#define PIN_PA07   7  /**< \brief Pin Number for PA07 
*/
-#define PORT_PA07 (1ul <<  7) /**< \brief PORT Mask  for PA07 
*/
-#define PIN_PA08   8  /**< \brief Pin Number for PA08 
*/
-#define PORT_PA08 (1ul <<  8) /**< \brief PORT Mask  for PA08 
*/
-#define PIN_PA09   9  /**< \brief Pin Number for PA09 
*/
-#define PORT_PA09 (1ul <<  9) /**< \brief PORT Mask  for PA09 
*/
-#define PIN_PA10  10  /**< \brief Pin Number for PA10 
*/
-#define PORT_PA10 (1ul << 10) /**< \brief PORT Mask  for PA10 
*/
-#define PIN_PA11  11  /**< \brief Pin Number for PA11 
*/
-#define PORT_PA11 (1ul << 11) /**< \brief PORT Mask  for PA11 
*/
-#define PIN_PA14  14  /**< \brief Pin Number for PA14 
*/
-#define PORT_PA14 (1ul << 14) /**< \brief PORT Mask  for PA14 
*/
-#define PIN_PA15  15  /**< \brief Pin Number for PA15 
*/
-#define PORT_PA15 (1ul << 15) /**< \brief PORT Mask  for PA15 
*/
-#define PIN_PA16  16  /**< \brief Pin Number for PA16 
*/
-#define PORT_PA16 (1ul << 16) /**< \brief PORT Mask  

[35/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.c
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.c
deleted file mode 100755
index 3945d20..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi/spi.c
+++ /dev/null
@@ -1,1265 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Serial Peripheral Interface Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#include "spi.h"
-
-/**
- * \brief Resets the SPI module
- *
- * This function will reset the SPI module to its power on default values and
- * disable it.
- *
- * \param[in,out] module Pointer to the software instance struct
- */
-void spi_reset(
-   struct spi_module *const module)
-{
-   /* Sanity check arguments */
-   Assert(module);
-   Assert(module->hw);
-
-   SercomSpi *const spi_module = &(module->hw->SPI);
-
-   /* Disable the module */
-   spi_disable(module);
-
-   while (spi_is_syncing(module)) {
-   /* Wait until the synchronization is complete */
-   }
-
-   /* Software reset the module */
-   spi_module->CTRLA.reg |= SERCOM_SPI_CTRLA_SWRST;
-}
-
-/**
- * \brief Set the baudrate of the SPI module
- *
- * This function will set the baudrate of the SPI module.
- *
- * \param[in]  module  Pointer to the software instance struct
- * \param[in]  baudrate  The baudrate wanted
- *
- * \return The status of the configuration.
- * \retval STATUS_ERR_INVALID_ARG  If invalid argument(s) were provided
- * \retval STATUS_OK   If the configuration was written
- */
-enum status_code spi_set_baudrate(
-   struct spi_module *const module,
-   uint32_t baudrate)
-{
-   /* Sanity check arguments */
-   Assert(module);
-   Assert(baudrate);
-   Assert(module->hw);
-
-   /* Value to write to BAUD register */
-   uint16_t baud = 0;
-
-   SercomSpi *const spi_module = &(module->hw->SPI);
-
-   /* Disable the module */
-   spi_disable(module);
-
-   while (spi_is_syncing(module)) {
-   /* Wait until the synchronization is complete */
-   }
-
-   /* Find frequency of the internal SERCOMi_GCLK_ID_CORE */
-   uint32_t sercom_index = _sercom_get_sercom_inst_index(module->hw);
-   uint32_t gclk_index   = sercom_index + SERCOM0_GCLK_ID_CORE;
-   uint32_t internal_clock = system_gclk_chan_get_hz(gclk_index);
-
-   /* Get baud value, based on baudrate and the internal clock frequency */
-   enum status_code error_code = _sercom_get_sync_baud_val(
-   baudrate, internal_clock, );
-
-   if (error_code != STATUS_OK) {
-   /* Baud rate calculation error, return status code */
-   return STATUS_ERR_INVALID_ARG;
-   }
-
-   spi_module->BAUD.reg = (uint8_t)baud;
-
-   while (spi_is_syncing(module)) {
-   /* Wait until the synchronization is complete */
-   }
-
-   /* Enable the module */
-   spi_enable(module);
-
-   while 

[68/70] [abbrv] incubator-mynewt-larva git commit: Some changes to make doc examples clearer.

2016-03-03 Thread ccollins
Some changes to make doc examples clearer.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/6660ec0c
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/6660ec0c
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/6660ec0c

Branch: refs/heads/master
Commit: 6660ec0ce2c81f6385298f173c1d60395b2958bb
Parents: 9ad54b8
Author: Christopher Collins 
Authored: Wed Mar 2 12:13:25 2016 -0800
Committer: Christopher Collins 
Committed: Thu Mar 3 15:28:02 2016 -0800

--
 fs/fs/include/fs/fs.h   | 28 ++--
 fs/nffs/include/nffs/nffs.h |  2 --
 fs/nffs/pkg.yml |  4 ++--
 fs/nffs/src/nffs.c  | 37 -
 fs/nffs/src/nffs_block.c|  4 ++--
 fs/nffs/src/nffs_file.c |  4 ++--
 fs/nffs/src/nffs_flash.c| 10 +-
 fs/nffs/src/nffs_inode.c|  2 +-
 fs/nffs/src/nffs_misc.c | 12 
 fs/nffs/src/nffs_priv.h |  1 +
 fs/nffs/src/nffs_restore.c  |  2 +-
 project/slinky/pkg.yml  |  5 +++--
 project/slinky/src/main.c   |  9 +
 13 files changed, 64 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/fs/include/fs/fs.h
--
diff --git a/fs/fs/include/fs/fs.h b/fs/fs/include/fs/fs.h
index f304d88..e29f7f3 100644
--- a/fs/fs/include/fs/fs.h
+++ b/fs/fs/include/fs/fs.h
@@ -60,19 +60,19 @@ int fs_dirent_is_dir(const struct fs_dirent *);
 /*
  * File access return codes.
  */
-#define FS_EOK  0   /* OK */
-#define FS_ECORRUPT 1   /* Filesystem corrupt */
-#define FS_EHW  2   /* Error access storage medium */
-#define FS_ERANGE   3
-#define FS_EINVAL   4
-#define FS_ENOMEM   5   /* out of memory */
-#define FS_ENOENT   6   /* no such file */
-#define FS_EEMPTY   7
-#define FS_EFULL8
-#define FS_EUNEXP   9
-#define FS_EOS  10
-#define FS_EEXIST   11
-#define FS_EACCESS  12
-#define FS_EUNINIT  13
+#define FS_EOK  0  /* Success */
+#define FS_ECORRUPT 1  /* File system corrupt */
+#define FS_EHW  2  /* Error accessing storage medium */
+#define FS_EOFFSET  3  /* Invalid offset */
+#define FS_EINVAL   4  /* Invalid argument */
+#define FS_ENOMEM   5  /* Insufficient memory */
+#define FS_ENOENT   6  /* No such file or directory */
+#define FS_EEMPTY   7  /* Specified region is empty (internal only) */
+#define FS_EFULL8  /* Disk full */
+#define FS_EUNEXP   9  /* Disk contains unexpected metadata */
+#define FS_EOS  10  /* OS error */
+#define FS_EEXIST   11  /* File or directory already exists */
+#define FS_EACCESS  12  /* Operation prohibited by file open mode */
+#define FS_EUNINIT  13  /* File system not initialized */
 
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/nffs/include/nffs/nffs.h
--
diff --git a/fs/nffs/include/nffs/nffs.h b/fs/nffs/include/nffs/nffs.h
index 41519bd..73a0ec1 100644
--- a/fs/nffs/include/nffs/nffs.h
+++ b/fs/nffs/include/nffs/nffs.h
@@ -57,7 +57,5 @@ struct nffs_area_desc {
 int nffs_init(void);
 int nffs_detect(const struct nffs_area_desc *area_descs);
 int nffs_format(const struct nffs_area_desc *area_descs);
-int nffs_ready(void);
-
 
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/nffs/pkg.yml
--
diff --git a/fs/nffs/pkg.yml b/fs/nffs/pkg.yml
index 3866598..d1878ac 100644
--- a/fs/nffs/pkg.yml
+++ b/fs/nffs/pkg.yml
@@ -30,8 +30,8 @@ pkg.keywords:
 
 pkg.identities: NFFS
 pkg.deps:
-- sys/log
 - fs/fs
+- hw/hal
 - libs/os
 - libs/testutil
-- hw/hal
+- sys/log

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/nffs/src/nffs.c
--
diff --git a/fs/nffs/src/nffs.c b/fs/nffs/src/nffs.c
index ede074b..c90c4ef 100644
--- a/fs/nffs/src/nffs.c
+++ b/fs/nffs/src/nffs.c
@@ -146,7 +146,7 @@ nffs_open(const char *path, uint8_t access_flags, struct 
fs_file **out_fs_file)
 
 nffs_lock();
 
-if (!nffs_ready()) {
+if (!nffs_misc_ready()) {
 rc = FS_EUNINIT;
 goto done;
 }
@@ -257,8 +257,7 @@ nffs_file_len(const struct fs_file *fs_file, uint32_t 
*out_len)
 
 /**
  * Reads data from the specified file.  If 

[33/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi_master_vec/spi_master_vec.c
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi_master_vec/spi_master_vec.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi_master_vec/spi_master_vec.c
deleted file mode 100755
index 39a7327..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/spi_master_vec/spi_master_vec.c
+++ /dev/null
@@ -1,586 +0,0 @@
-/**
- * \file
- *
- * \brief SERCOM SPI master with vectored I/O driver implementation
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#include "spi_master_vec.h"
-#include 
-#include 
-#include 
-
-/**
- * \ingroup asfdoc_sam0_sercom_spi_master_vec_group
- *
- * @{
- */
-
-/**
- * \name Internal functions
- * @{
- */
-
-/** \cond INTERNAL */
-
-static void _spi_master_vec_int_handler(uint8_t sercom_index);
-
-/**
- * \brief Wait for SERCOM SPI to synchronize
- *
- * \param[in] sercom_spi SERCOM SPI to check for synchronization.
- *
- * \note The implementation of this function depends on the SERCOM revision.
- */
-static inline void _spi_master_vec_wait_for_sync(SercomSpi *const sercom_spi)
-{
-#if defined(FEATURE_SERCOM_SYNCBUSY_SCHEME_VERSION_1)
-   while (sercom_spi->STATUS.reg & SERCOM_SPI_STATUS_SYNCBUSY) {
-   /* Intentionally left empty */
-   }
-#elif defined(FEATURE_SERCOM_SYNCBUSY_SCHEME_VERSION_2)
-   while (sercom_spi->SYNCBUSY.reg) {
-   /* Intentionally left empty */
-   }
-#else
-#  error Unknown SERCOM SYNCBUSY scheme!
-#endif
-}
-
-/**
- * \brief Pin MUX configuration helper
- *
- * \param[in] pinmux Pin MUX setting to apply. Special values:
- * \arg \c PINMUX_UNUSED to do nothing.
- * \arg \c PINMUX_DEFAULT to use default pin MUX for the SERCOM pad.
- * \param[in] sercom,padnum SERCOM pad specification, for \ref PINMUX_DEFAULT.
- */
-static inline void _spi_master_vec_pinmux_helper(uint32_t pinmux,
-   Sercom *const sercom, uint8_t padnum)
-{
-   struct system_pinmux_config pin_conf;
-
-   if (pinmux == PINMUX_DEFAULT) {
-   pinmux = _sercom_get_default_pad(sercom, padnum);
-   }
-
-   if (pinmux == PINMUX_UNUSED) {
-   return;
-   }
-
-   system_pinmux_get_config_defaults(_conf);
-   pin_conf.mux_position = pinmux & 0x;
-   system_pinmux_pin_set_config(pinmux >> 16, _conf);
-};
-
-/** \endcond */
-
-/** @} */
-
-/**
- * \brief Initialize hardware and driver instance
- *
- * This function configures the clock system for the specified SERCOM module,
- * sets up the related pins and their MUX, initializes the SERCOM in SPI master
- * mode, and prepares the driver instance for operation.
- *
- * \pre \ref system_init() must have been called prior to this function.
- *
- * The SERCOM SPI module is left disabled after initialization, and must be
- * enabled with \ref spi_master_vec_enable() before a transfer can be done.
- *
- * \param[out] module Driver instance to initialize.
- * \param[in,out] sercom SERCOM module to initialize and associate driver
- * instance with.
- * 

[38/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_common.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_common.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_common.h
deleted file mode 100755
index 66a5e6d..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/sercom/i2c/i2c_common.h
+++ /dev/null
@@ -1,606 +0,0 @@
-/**
- * \file
- *
- * \brief SAM SERCOM I2C Common Driver
- *
- * Copyright (c) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#ifndef I2C_COMMON_H_INCLUDED
-#define I2C_COMMON_H_INCLUDED
-
-#include 
-#include 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * \if (I2C_MASTER_MODE && I2C_SLAVE_MODE)
- *   \defgroup asfdoc_sam0_sercom_i2c_group SAM I2C (SERCOM I2C) Driver
- * \elseif I2C_MASTER_MODE
- *   \defgroup asfdoc_sam0_sercom_i2c_group SAM I2C Master Mode (SERCOM I2C) 
Driver
- * \elseif I2C_SLAVE_MODE
- *   \defgroup asfdoc_sam0_sercom_i2c_group SAM I2C Slave Mode (SERCOM I2C) 
Driver
- * \endif
- *
- * This driver for Atmel | SMART ARM-based microcontrollers provides
- * an interface for the configuration and management of the device's SERCOM
- * I2C module, for the transfer of data via an I2C bus.
- * The following driver API modes are covered by this manual:
- *
- * \if I2C_MASTER_MODE
- * - Master Mode Polled APIs
- * \endif
- * \if I2C_MASTER_CALLBACK_MODE
- * - Master Mode Callback APIs
- * \endif
- * \if I2C_SLAVE_MODE
- * - Slave Mode Polled APIs
- * \endif
- * \if I2C_SLAVE_CALLBACK_MODE
- * - Slave Mode Callback APIs
- * \endif
- *
- * The following peripheral is used by this module:
- * - SERCOM (Serial Communication Interface)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D09/D10/D11
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM DA1
- *  - Atmel | SMART SAM C20/C21
- *
- * The outline of this documentation is as follows:
- * - \ref asfdoc_sam0_sercom_i2c_prerequisites
- * - \ref asfdoc_sam0_sercom_i2c_overview
- * - \ref asfdoc_sam0_sercom_i2c_special_considerations
- * - \ref asfdoc_sam0_sercom_i2c_extra
- * - \ref asfdoc_sam0_sercom_i2c_examples
- * - \ref asfdoc_sam0_sercom_i2c_api_overview
- *
- * \section asfdoc_sam0_sercom_i2c_prerequisites Prerequisites
- * There are no prerequisites.
- *
- * \section asfdoc_sam0_sercom_i2c_overview Module Overview
- * The outline of this section is as follows:
- * - \ref asfdoc_sam0_sercom_i2c_module_features
- * - \ref asfdoc_sam0_sercom_i2c_functional_desc
- * - \ref asfdoc_sam0_sercom_i2c_bus_topology
- * - \ref asfdoc_sam0_sercom_i2c_transactions
- * - \ref asfdoc_sam0_sercom_i2c_multi_master
- * - \ref asfdoc_sam0_sercom_i2c_bus_states
- * - \ref asfdoc_sam0_sercom_i2c_timeout
- * - \ref asfdoc_sam0_sercom_i2c_sleep_modes
- *
- * \subsection asfdoc_sam0_sercom_i2c_module_features Driver Feature Macro 
Definition
- * 
- * 
- * Driver Feature Macro
- * Supported devices
- * 
- * 
- * FEATURE_I2C_FAST_MODE_PLUS_AND_HIGH_SPEED
- * SAM 

[15/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/rtc.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/rtc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/rtc.h
deleted file mode 100755
index a006274..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/rtc.h
+++ /dev/null
@@ -1,1065 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for RTC
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_RTC_COMPONENT_
-#define _SAMD21_RTC_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR RTC */
-/* == 
*/
-/** \addtogroup SAMD21_RTC Real-Time Counter */
-/*@{*/
-
-#define RTC_U2202
-#define REV_RTC 0x101
-
-/*  RTC_MODE0_CTRL : (RTC Offset: 0x00) (R/W 16) MODE0 MODE0 Control 
 */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint16_t SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint16_t ENABLE:1; /*!< bit:  1  Enable
 */
-uint16_t MODE:2;   /*!< bit:  2.. 3  Operating Mode
 */
-uint16_t :3;   /*!< bit:  4.. 6  Reserved  
 */
-uint16_t MATCHCLR:1;   /*!< bit:  7  Clear on Match
 */
-uint16_t PRESCALER:4;  /*!< bit:  8..11  Prescaler 
 */
-uint16_t :4;   /*!< bit: 12..15  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint16_t reg;/*!< Type  used for register access 
 */
-} RTC_MODE0_CTRL_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define RTC_MODE0_CTRL_OFFSET   0x00 /**< \brief (RTC_MODE0_CTRL 
offset) MODE0 Control */
-#define RTC_MODE0_CTRL_RESETVALUE   0xul /**< \brief (RTC_MODE0_CTRL 
reset_value) MODE0 Control */
-
-#define RTC_MODE0_CTRL_SWRST_Pos0/**< \brief (RTC_MODE0_CTRL) 
Software Reset */
-#define RTC_MODE0_CTRL_SWRST(0x1ul << RTC_MODE0_CTRL_SWRST_Pos)
-#define RTC_MODE0_CTRL_ENABLE_Pos   1/**< \brief (RTC_MODE0_CTRL) 
Enable */
-#define RTC_MODE0_CTRL_ENABLE   (0x1ul << RTC_MODE0_CTRL_ENABLE_Pos)
-#define RTC_MODE0_CTRL_MODE_Pos 2/**< \brief (RTC_MODE0_CTRL) 
Operating Mode */
-#define RTC_MODE0_CTRL_MODE_Msk (0x3ul << RTC_MODE0_CTRL_MODE_Pos)
-#define RTC_MODE0_CTRL_MODE(value)  ((RTC_MODE0_CTRL_MODE_Msk & ((value) << 
RTC_MODE0_CTRL_MODE_Pos)))
-#define   RTC_MODE0_CTRL_MODE_COUNT32_Val 0x0ul  /**< \brief (RTC_MODE0_CTRL) 
Mode 0: 32-bit Counter */
-#define   RTC_MODE0_CTRL_MODE_COUNT16_Val 0x1ul  /**< \brief (RTC_MODE0_CTRL) 
Mode 1: 16-bit Counter */
-#define   RTC_MODE0_CTRL_MODE_CLOCK_Val   

[41/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/pac/pac.h
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/pac/pac.h 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/pac/pac.h
deleted file mode 100755
index 188d1f8..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/pac/pac.h
+++ /dev/null
@@ -1,1016 +0,0 @@
-/**
- * \file
- *
- * \brief SAM Peripheral Access Controller Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#ifndef PAC_H_INCLUDED
-#define PAC_H_INCLUDED
-
-/**
- * \defgroup asfdoc_sam0_pac_group SAM Peripheral Access Controller (PAC) 
Driver
- *
- * This driver for Atmel | SMART ARM-based microcontroller provides
- * an interface for the locking and unlocking of peripheral registers within
- * the device. When a peripheral is locked, accidental writes to the peripheral
- * will be blocked and a CPU exception will be raised.
- *
- * The following peripherals are used by this module:
- *  - PAC (Peripheral Access Controller)
- *
- * The following devices can use this module:
- *  - Atmel | SMART SAM D20/D21
- *  - Atmel | SMART SAM R21
- *  - Atmel | SMART SAM D09/D10/D11
- *  - Atmel | SMART SAM L21/L22
- *  - Atmel | SMART SAM DA1
- *  - Atmel | SMART SAM C20/C21
- *
- * The outline of this documentation is as follows:
- *  - \ref asfdoc_sam0_pac_prerequisites
- *  - \ref asfdoc_sam0_pac_module_overview
- *  - \ref asfdoc_sam0_pac_special_considerations
- *  - \ref asfdoc_sam0_pac_extra_info
- *  - \ref asfdoc_sam0_pac_examples
- *  - \ref asfdoc_sam0_pac_api_overview
- *
- *
- * \section asfdoc_sam0_pac_prerequisites Prerequisites
- *
- * There are no prerequisites for this module.
- *
- *
- * \section asfdoc_sam0_pac_module_overview Module Overview
- *
- * The SAM devices are fitted with a Peripheral Access Controller (PAC)
- * that can be used to lock and unlock write access to a peripheral's
- * registers (see \ref asfdoc_sam0_pac_non_write_protected). Locking a
- * peripheral minimizes the risk of unintended configuration changes to a
- * peripheral as a consequence of \ref asfdoc_sam0_pac_code_run_away
- * or use of a \ref asfdoc_sam0_pac_module_pointer.
- *
- * Physically, the PAC restricts write access through the AHB bus to registers
- * used by the peripheral, making the register non-writable. PAC locking of
- * modules should be implemented in configuration critical applications where
- * avoiding unintended peripheral configuration changes are to be regarded in
- * the highest of priorities.
- *
- * All interrupt must be disabled while a peripheral is unlocked to make sure
- * correct lock/unlock scheme is upheld.
- *
- * \subsection asfdoc_sam0_pac_locking_scheme Locking Scheme
- * The module has a built in safety feature requiring that an already locked
- * peripheral is not relocked, and that already unlocked peripherals are not
- * unlocked again. Attempting to unlock and already unlocked peripheral, or
- * attempting to lock a peripheral that is currently locked will generate a
- * CPU exception. This implies that the implementer must keep
- * strict control over the peripheral's lock-state 

[10/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc_lighting.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc_lighting.h
 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc_lighting.h
deleted file mode 100755
index 41ae22a..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc_lighting.h
+++ /dev/null
@@ -1,1838 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for TCC
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-
-#ifndef _SAMD21_TCC_COMPONENT_
-#define _SAMD21_TCC_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR TCC */
-/* == 
*/
-/** \addtogroup SAMD21_TCC Timer Counter Control */
-/*@{*/
-
-#define TCC_U2213
-#define REV_TCC 0x121
-
-/*  TCC_CTRLA : (TCC Offset: 0x00) (R/W 32) Control A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint32_t SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint32_t ENABLE:1; /*!< bit:  1  Enable
 */
-uint32_t :3;   /*!< bit:  2.. 4  Reserved  
 */
-uint32_t RESOLUTION:2; /*!< bit:  5.. 6  Enhanced Resolution   
 */
-uint32_t :1;   /*!< bit:  7  Reserved  
 */
-uint32_t PRESCALER:3;  /*!< bit:  8..10  Prescaler 
 */
-uint32_t RUNSTDBY:1;   /*!< bit: 11  Run in Standby
 */
-uint32_t PRESCSYNC:2;  /*!< bit: 12..13  Prescaler and Counter 
Synchronization Selection */
-uint32_t ALOCK:1;  /*!< bit: 14  Auto Lock 
 */
-uint32_t :9;   /*!< bit: 15..23  Reserved  
 */
-uint32_t CPTEN0:1; /*!< bit: 24  Capture Channel 0 Enable  
 */
-uint32_t CPTEN1:1; /*!< bit: 25  Capture Channel 1 Enable  
 */
-uint32_t CPTEN2:1; /*!< bit: 26  Capture Channel 2 Enable  
 */
-uint32_t CPTEN3:1; /*!< bit: 27  Capture Channel 3 Enable  
 */
-uint32_t :4;   /*!< bit: 28..31  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  struct {
-uint32_t :24;  /*!< bit:  0..23  Reserved  
 */
-uint32_t CPTEN:4;  /*!< bit: 24..27  Capture Channel x Enable  
 */
-uint32_t :4;   /*!< bit: 28..31  Reserved  
 */
-  } vec;   /*!< Structure used for vec  access 
 */
-  uint32_t reg;/*!< Type  used for register access 
 */
-} TCC_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define TCC_CTRLA_OFFSET0x00 /**< 

[64/70] [abbrv] incubator-mynewt-larva git commit: Update pkg-list with the latest.

2016-03-03 Thread ccollins
Update pkg-list with the latest.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/4e2c53c5
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/4e2c53c5
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/4e2c53c5

Branch: refs/heads/master
Commit: 4e2c53c538c1483b4fa42307e90e6f00e3bc245c
Parents: 4934f2e
Author: Marko Kiiskila 
Authored: Thu Mar 3 11:42:45 2016 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 3 11:42:45 2016 -0800

--
 pkg-list.yml | 442 --
 1 file changed, 263 insertions(+), 179 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/4e2c53c5/pkg-list.yml
--
diff --git a/pkg-list.yml b/pkg-list.yml
index aa81016..3edb569 100644
--- a/pkg-list.yml
+++ b/pkg-list.yml
@@ -20,281 +20,365 @@
 name: larva
 url: https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva
 pkgs:
-sys/config:
-vers: 0.1.0
-hash: 8a2318901967e44df05e68d6f03eba91d8491e8a
+bletest:
+vers: 0.8.0
+hash: 325d6ff98eb71341c4f3e47bce3c37a74ea819b4
 deps:
+- net/nimble/controller@none#stable
+- net/nimble/host@none#stable
 - libs/os@none#stable
 - libs/console/full@none#stable
+- libs/baselibc@none#stable
 - libs/shell@none#stable
-- libs/newtmgr@none#stable
 - libs/imgmgr@none#stable
+- libs/newtmgr@none#stable
 - sys/config@none#stable
 - sys/log@none#stable
 - sys/stats@none#stable
-sys/log:
-vers: 0.1.0
-hash: 2b358d4461786c92bf492807743ceee463d34fef
+libs/console/stub:
+vers: 0.8.0
+hash: d41aedc5941495ca9320cc013f68ee73d4e349ab
+caps:
+- console@none#stable
+libs/os:
+vers: 0.8.0
+hash: 999a3419d9959d3c39b11dcc67d79c7888b4b765
 deps:
-- libs/os@none#stable
-- libs/util@none#stable
 - libs/testutil@none#stable
-project/bin2img:
-vers: 0.1.0
-hash: 25a2173d8a47cf031933e19e54bb165b5de3a04c
-deps:
-- libs/bootutil@none#stable
-- libs/console/stub@none#stable
-libs/imgmgr:
-vers: 0.1.0
-hash: 529d9416d46d4c907a6a7e0e4fde61754aff275e
+req_caps:
+- console@none#stable
+project/blinky:
+vers: 0.8.0
+hash: 8be3527ec83fad088e4d9bf87eb0ecaf35842900
 deps:
+- libs/console/full@none#stable
 - libs/newtmgr@none#stable
-- libs/bootutil@none#stable
-net/nimble/drivers/nrf51:
-vers: 0.1.0
-hash: 3f1b843ccf32a16519cf22b04c67fd38ffef86bc
-deps:
-- net/nimble@none#stable
-- net/nimble/controller@none#stable
-caps:
-- ble_driver@none#stable
-hw/mcu/stm/stm32f4xx:
-vers: 0.0.0
-hash: 3198e51a11fb5dce063d4f2edb07960a2f3e4080
+- libs/os@none#stable
+- libs/shell@none#stable
+- sys/config@none#stable
+- sys/log@none#stable
+- sys/stats@none#stable
+project/boot:
+vers: 0.8.0
+hash: 3a38b2fcb865c466060cd3354b1b8b10b68b24c2
 deps:
-- hw/hal@none#stable
-- libs/cmsis-core@none#stable
-- compiler/arm-none-eabi-m4@none#stable
+- fs/nffs@none#stable
+- libs/baselibc@none#stable
+- libs/bootutil@none#stable
+- libs/console/stub@none#stable
+- libs/mbedtls@none#stable
+- libs/os@none#stable
+- libs/util@none#stable
 net/nimble/drivers/native:
-vers: 0.1.0
-hash: 6fca9ed4ea5ddb41058ab84885534b0ad784ad6f
+vers: 0.8.0
+hash: 513cc71e129320e3e2d80a9cdfc748db6c83fbb4
 deps:
 - net/nimble/controller@none#stable
 caps:
 - ble_driver@none#stable
-hw/mcu/nordic/nrf52xxx:
-vers: 0.0.0
-hash: 9c4508f4a14f03ca0103f53693e63956aa527b68
-deps:
-- hw/hal@none#stable
-- libs/cmsis-core@none#stable
-- compiler/arm-none-eabi-m4@none#stable
-net/nimble:
-vers: 0.1.0
-hash: 8977b8da604d9779d51baf4aacabef5af2771bf7
-deps:
-- libs/os@none#stable
-hw/bsp/olimex_stm32-e407_devboard:
-vers: 0.0.0
-hash: c0b075092ddd4a817825ff54d3b75452e83c1ac1
-deps:
-- hw/mcu/stm/stm32f4xx@none#stable
-net/nimble/host:
-vers: 0.1.0
- 

[13/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sysctrl.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sysctrl.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sysctrl.h
deleted file mode 100755
index 1583d88..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sysctrl.h
+++ /dev/null
@@ -1,951 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for SYSCTRL
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_SYSCTRL_COMPONENT_
-#define _SAMD21_SYSCTRL_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR SYSCTRL */
-/* == 
*/
-/** \addtogroup SAMD21_SYSCTRL System Control */
-/*@{*/
-
-#define SYSCTRL_U2100
-#define REV_SYSCTRL 0x201
-
-/*  SYSCTRL_INTENCLR : (SYSCTRL Offset: 0x00) (R/W 32) Interrupt 
Enable Clear  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint32_t XOSCRDY:1;/*!< bit:  0  XOSC Ready Interrupt Enable   
 */
-uint32_t XOSC32KRDY:1; /*!< bit:  1  XOSC32K Ready Interrupt 
Enable */
-uint32_t OSC32KRDY:1;  /*!< bit:  2  OSC32K Ready Interrupt Enable 
 */
-uint32_t OSC8MRDY:1;   /*!< bit:  3  OSC8M Ready Interrupt Enable  
 */
-uint32_t DFLLRDY:1;/*!< bit:  4  DFLL Ready Interrupt Enable   
 */
-uint32_t DFLLOOB:1;/*!< bit:  5  DFLL Out Of Bounds Interrupt 
Enable */
-uint32_t DFLLLCKF:1;   /*!< bit:  6  DFLL Lock Fine Interrupt 
Enable*/
-uint32_t DFLLLCKC:1;   /*!< bit:  7  DFLL Lock Coarse Interrupt 
Enable  */
-uint32_t DFLLRCS:1;/*!< bit:  8  DFLL Reference Clock Stopped 
Interrupt Enable */
-uint32_t BOD33RDY:1;   /*!< bit:  9  BOD33 Ready Interrupt Enable  
 */
-uint32_t BOD33DET:1;   /*!< bit: 10  BOD33 Detection Interrupt 
Enable   */
-uint32_t B33SRDY:1;/*!< bit: 11  BOD33 Synchronization Ready 
Interrupt Enable */
-uint32_t :3;   /*!< bit: 12..14  Reserved  
 */
-uint32_t DPLLLCKR:1;   /*!< bit: 15  DPLL Lock Rise Interrupt 
Enable*/
-uint32_t DPLLLCKF:1;   /*!< bit: 16  DPLL Lock Fall Interrupt 
Enable*/
-uint32_t DPLLLTO:1;/*!< bit: 17  DPLL Lock Timeout Interrupt 
Enable */
-uint32_t :14;  /*!< bit: 18..31  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint32_t reg;/*!< Type  used for register access 
 */
-} SYSCTRL_INTENCLR_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define SYSCTRL_INTENCLR_OFFSET 0x00 /**< \brief (SYSCTRL_INTENCLR 
offset) Interrupt Enable Clear */
-#define 

[61/70] [abbrv] incubator-mynewt-larva git commit: MYNEWT-189: add bounds checking to os_mbuf_get() and os_mbuf_get_pkthdr(). Add test case to make sure a user packet header cannot be too big, as well

2016-03-03 Thread ccollins
MYNEWT-189: add bounds checking to os_mbuf_get() and os_mbuf_get_pkthdr(). Add 
test case to make sure a user packet header cannot be too big, as well as the 
amount of leading space requested


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/20700036
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/20700036
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/20700036

Branch: refs/heads/master
Commit: 207000366ff247e675d5666eb0e3122d1ce2788c
Parents: 5d97f53
Author: wes3 
Authored: Wed Mar 2 11:53:08 2016 -0800
Committer: wes3 
Committed: Wed Mar 2 11:57:29 2016 -0800

--
 libs/os/src/os_mbuf.c| 22 +++---
 libs/os/src/test/mbuf_test.c | 27 ---
 2 files changed, 39 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/20700036/libs/os/src/os_mbuf.c
--
diff --git a/libs/os/src/os_mbuf.c b/libs/os/src/os_mbuf.c
index 27d9443..788987f 100644
--- a/libs/os/src/os_mbuf.c
+++ b/libs/os/src/os_mbuf.c
@@ -177,8 +177,6 @@ _os_msys_find_pool(uint16_t dsize)
 return (pool);
 }
 
-
-
 struct os_mbuf *
 os_msys_get(uint16_t dsize, uint16_t leadingspace)
 {
@@ -196,7 +194,6 @@ err:
 return (NULL);
 }
 
-
 struct os_mbuf *
 os_msys_get_pkthdr(uint16_t dsize, uint16_t user_hdr_len)
 {
@@ -228,8 +225,8 @@ err:
  * @return 0 on success, error code on failure. 
  */
 int 
-os_mbuf_pool_init(struct os_mbuf_pool *omp, struct os_mempool *mp, uint16_t 
buf_len, 
-uint16_t nbufs)
+os_mbuf_pool_init(struct os_mbuf_pool *omp, struct os_mempool *mp, 
+  uint16_t buf_len, uint16_t nbufs)
 {
 omp->omp_databuf_len = buf_len - sizeof(struct os_mbuf);
 omp->omp_mbuf_count = nbufs;
@@ -253,6 +250,10 @@ os_mbuf_get(struct os_mbuf_pool *omp, uint16_t 
leadingspace)
 {
 struct os_mbuf *om;
 
+if (leadingspace > omp->omp_databuf_len) {
+goto err;
+}
+
 om = os_memblock_get(omp->omp_pool);
 if (!om) {
 goto err;
@@ -274,13 +275,20 @@ err:
 struct os_mbuf *
 os_mbuf_get_pkthdr(struct os_mbuf_pool *omp, uint8_t user_pkthdr_len)
 {
+uint16_t pkthdr_len;
 struct os_mbuf_pkthdr *pkthdr;
 struct os_mbuf *om;
 
+/* User packet header must fit inside mbuf */
+pkthdr_len = user_pkthdr_len + sizeof(struct os_mbuf_pkthdr);
+if ((pkthdr_len > omp->omp_databuf_len) || (pkthdr_len > 255)) {
+return NULL;
+}
+
 om = os_mbuf_get(omp, 0);
 if (om) {
-om->om_pkthdr_len = user_pkthdr_len + sizeof(struct os_mbuf_pkthdr);
-om->om_data += user_pkthdr_len + sizeof(struct os_mbuf_pkthdr);
+om->om_pkthdr_len = pkthdr_len;
+om->om_data += pkthdr_len;
 
 pkthdr = OS_MBUF_PKTHDR(om);
 pkthdr->omp_len = 0;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/20700036/libs/os/src/test/mbuf_test.c
--
diff --git a/libs/os/src/test/mbuf_test.c b/libs/os/src/test/mbuf_test.c
index 2016021..dd4121d 100644
--- a/libs/os/src/test/mbuf_test.c
+++ b/libs/os/src/test/mbuf_test.c
@@ -23,10 +23,14 @@
 
 #include 
 
-#define MBUF_TEST_POOL_BUF_SIZE (256)
-#define MBUF_TEST_POOL_BUF_COUNT (10)
+/* 
+ * NOTE: currently, the buffer size cannot be changed as some tests are
+ * hard-coded for this size.
+ */
+#define MBUF_TEST_POOL_BUF_SIZE (256)
+#define MBUF_TEST_POOL_BUF_COUNT(10)
 
-#define MBUF_TEST_DATA_LEN  (1024)
+#define MBUF_TEST_DATA_LEN  (1024)
 
 static os_membuf_t os_mbuf_membuf[OS_MEMPOOL_SIZE(MBUF_TEST_POOL_BUF_SIZE,
 MBUF_TEST_POOL_BUF_COUNT)];
@@ -106,6 +110,22 @@ TEST_CASE(os_mbuf_test_alloc)
 TEST_ASSERT_FATAL(rc == 0, "Error free'ing mbuf %d", rc);
 }
 
+TEST_CASE(os_mbuf_test_get_pkthdr)
+{
+struct os_mbuf *m;
+ 
+os_mbuf_test_setup();
+
+#if (MBUF_TEST_POOL_BUF_SIZE <= 256)
+m = os_mbuf_get_pkthdr(_mbuf_pool, MBUF_TEST_POOL_BUF_SIZE - 1);
+TEST_ASSERT_FATAL(m == NULL, "Error: should not have returned mbuf");
+#endif
+
+m = os_mbuf_get(_mbuf_pool, MBUF_TEST_POOL_BUF_SIZE);
+TEST_ASSERT_FATAL(m == NULL, "Error: should not have returned mbuf");
+}
+
+
 TEST_CASE(os_mbuf_test_dup)
 {
 struct os_mbuf *om;
@@ -396,4 +416,5 @@ TEST_SUITE(os_mbuf_test_suite)
 os_mbuf_test_pullup();
 os_mbuf_test_extend();
 os_mbuf_test_adj();
+os_mbuf_test_get_pkthdr();
 }



[05/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/tc7.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/tc7.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/tc7.h
deleted file mode 100755
index ebb32ce..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/tc7.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * \file
- *
- * \brief Instance description for TC7
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_TC7_INSTANCE_
-#define _SAMD21_TC7_INSTANCE_
-
-/* == Register definition for TC7 peripheral == */
-#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-#define REG_TC7_CTRLA  (0x42003C00U) /**< \brief (TC7) Control A */
-#define REG_TC7_READREQ(0x42003C02U) /**< \brief (TC7) Read 
Request */
-#define REG_TC7_CTRLBCLR   (0x42003C04U) /**< \brief (TC7) Control B 
Clear */
-#define REG_TC7_CTRLBSET   (0x42003C05U) /**< \brief (TC7) Control B 
Set */
-#define REG_TC7_CTRLC  (0x42003C06U) /**< \brief (TC7) Control C */
-#define REG_TC7_DBGCTRL(0x42003C08U) /**< \brief (TC7) Debug 
Control */
-#define REG_TC7_EVCTRL (0x42003C0AU) /**< \brief (TC7) Event 
Control */
-#define REG_TC7_INTENCLR   (0x42003C0CU) /**< \brief (TC7) Interrupt 
Enable Clear */
-#define REG_TC7_INTENSET   (0x42003C0DU) /**< \brief (TC7) Interrupt 
Enable Set */
-#define REG_TC7_INTFLAG(0x42003C0EU) /**< \brief (TC7) Interrupt 
Flag Status and Clear */
-#define REG_TC7_STATUS (0x42003C0FU) /**< \brief (TC7) Status */
-#define REG_TC7_COUNT16_COUNT  (0x42003C10U) /**< \brief (TC7) COUNT16 
Counter Value */
-#define REG_TC7_COUNT16_CC0(0x42003C18U) /**< \brief (TC7) COUNT16 
Compare/Capture 0 */
-#define REG_TC7_COUNT16_CC1(0x42003C1AU) /**< \brief (TC7) COUNT16 
Compare/Capture 1 */
-#define REG_TC7_COUNT32_COUNT  (0x42003C10U) /**< \brief (TC7) COUNT32 
Counter Value */
-#define REG_TC7_COUNT32_CC0(0x42003C18U) /**< \brief (TC7) COUNT32 
Compare/Capture 0 */
-#define REG_TC7_COUNT32_CC1(0x42003C1CU) /**< \brief (TC7) COUNT32 
Compare/Capture 1 */
-#define REG_TC7_COUNT8_COUNT   (0x42003C10U) /**< \brief (TC7) COUNT8 
Counter Value */
-#define REG_TC7_COUNT8_PER (0x42003C14U) /**< \brief (TC7) COUNT8 
Period Value */
-#define REG_TC7_COUNT8_CC0 (0x42003C18U) /**< \brief (TC7) COUNT8 
Compare/Capture 0 */
-#define REG_TC7_COUNT8_CC1 (0x42003C19U) /**< \brief (TC7) COUNT8 
Compare/Capture 1 */
-#else
-#define REG_TC7_CTRLA  (*(RwReg16*)0x42003C00U) /**< \brief (TC7) 
Control A */
-#define REG_TC7_READREQ(*(RwReg16*)0x42003C02U) /**< \brief (TC7) 
Read Request */
-#define REG_TC7_CTRLBCLR   (*(RwReg8 *)0x42003C04U) /**< \brief (TC7) 
Control B Clear */
-#define REG_TC7_CTRLBSET   (*(RwReg8 *)0x42003C05U) /**< \brief (TC7) 
Control B Set */
-#define REG_TC7_CTRLC  (*(RwReg8 

[44/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/extint/extint_callback.c
--
diff --git a/hw/mcu/atmel/samd21xx/src/sam0/drivers/extint/extint_callback.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/extint/extint_callback.c
deleted file mode 100755
index 52424d7..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/extint/extint_callback.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- * \file
- *
- * \brief SAM External Interrupt Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#include "extint.h"
-#include "extint_callback.h"
-
-/**
- * \internal
- * Internal driver device instance struct, declared in the main module driver.
- */
-extern struct _extint_module _extint_dev;
-
-/**
- * \internal
- * This is the number of the channel whose callback is currently running.
- */
-uint8_t _current_channel;
-
-/**
- * \brief Registers an asynchronous callback function with the driver.
- *
- * Registers an asynchronous callback with the EXTINT driver, fired when a
- * channel detects the configured channel detection criteria
- * (e.g. edge or level). Callbacks are fired once for each detected channel.
- *
- * \note NMI channel callbacks cannot be registered via this function; the
- *   device's NMI interrupt should be hooked directly in the user
- *   application and the NMI flags manually cleared via
- *   \ref extint_nmi_clear_detected().
- *
- * \param[in] callback  Pointer to the callback function to register
- * \param[in] channel   Logical channel to register callback for
- * \param[in] type  Type of callback function to register
- *
- * \return Status of the registration operation.
- * \retval STATUS_OK   The callback was registered successfully
- * \retval STATUS_ERR_INVALID_ARG  If an invalid callback type was supplied
- * \retval STATUS_ERR_ALREADY_INITIALIZEDCallback function has been
- *  registered, need unregister first
- */
-enum status_code extint_register_callback(
-   const extint_callback_t callback,
-   const uint8_t channel,
-   const enum extint_callback_type type)
-{
-   /* Sanity check arguments */
-   Assert(callback);
-
-   if (type != EXTINT_CALLBACK_TYPE_DETECT) {
-   Assert(false);
-   return STATUS_ERR_INVALID_ARG;
-   }
-
-   if (_extint_dev.callbacks[channel] == NULL) {
-   _extint_dev.callbacks[channel] = callback;
-   return STATUS_OK;
-   } else if (_extint_dev.callbacks[channel] == callback) {
-   return STATUS_OK;
-   }
-
-   return STATUS_ERR_ALREADY_INITIALIZED;
-}
-
-/**
- * \brief Unregisters an asynchronous callback function with the driver.
- *
- * Unregisters an asynchronous callback with the EXTINT driver, removing it
- * from the internal callback registration table.
- *
- * \param[in] callback  Pointer to the callback function to unregister
- * \param[in] channel   Logical channel to unregister callback for
- * \param[in] type  Type of callback function to unregister
- *
- * \return Status of the de-registration operation.
- 

[19/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/evsys.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/evsys.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/evsys.h
deleted file mode 100755
index f4aa3ae..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/evsys.h
+++ /dev/null
@@ -1,607 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for EVSYS
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_EVSYS_COMPONENT_
-#define _SAMD21_EVSYS_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR EVSYS */
-/* == 
*/
-/** \addtogroup SAMD21_EVSYS Event System Interface */
-/*@{*/
-
-#define EVSYS_U2208
-#define REV_EVSYS   0x101
-
-/*  EVSYS_CTRL : (EVSYS Offset: 0x00) ( /W  8) Control  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint8_t  :3;   /*!< bit:  1.. 3  Reserved  
 */
-uint8_t  GCLKREQ:1;/*!< bit:  4  Generic Clock Requests
 */
-uint8_t  :3;   /*!< bit:  5.. 7  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} EVSYS_CTRL_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define EVSYS_CTRL_OFFSET   0x00 /**< \brief (EVSYS_CTRL 
offset) Control */
-#define EVSYS_CTRL_RESETVALUE   0x00ul   /**< \brief (EVSYS_CTRL 
reset_value) Control */
-
-#define EVSYS_CTRL_SWRST_Pos0/**< \brief (EVSYS_CTRL) 
Software Reset */
-#define EVSYS_CTRL_SWRST(0x1ul << EVSYS_CTRL_SWRST_Pos)
-#define EVSYS_CTRL_GCLKREQ_Pos  4/**< \brief (EVSYS_CTRL) 
Generic Clock Requests */
-#define EVSYS_CTRL_GCLKREQ  (0x1ul << EVSYS_CTRL_GCLKREQ_Pos)
-#define EVSYS_CTRL_MASK 0x11ul   /**< \brief (EVSYS_CTRL) MASK 
Register */
-
-/*  EVSYS_CHANNEL : (EVSYS Offset: 0x04) (R/W 32) Channel  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint32_t CHANNEL:4;/*!< bit:  0.. 3  Channel Selection 
 */
-uint32_t :4;   /*!< bit:  4.. 7  Reserved  
 */
-uint32_t SWEVT:1;  /*!< bit:  8  Software Event
 */
-uint32_t :7;   /*!< bit:  9..15  Reserved  
 */
-uint32_t EVGEN:7;  /*!< bit: 16..22  Event Generator Selection 
 */
-uint32_t :1;   /*!< bit: 23  Reserved  
 */
-uint32_t 

[17/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/nvmctrl.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/nvmctrl.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/nvmctrl.h
deleted file mode 100755
index bd48b7f..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/nvmctrl.h
+++ /dev/null
@@ -1,644 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for NVMCTRL
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_NVMCTRL_COMPONENT_
-#define _SAMD21_NVMCTRL_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR NVMCTRL */
-/* == 
*/
-/** \addtogroup SAMD21_NVMCTRL Non-Volatile Memory Controller */
-/*@{*/
-
-#define NVMCTRL_U2207
-#define REV_NVMCTRL 0x201
-
-/*  NVMCTRL_CTRLA : (NVMCTRL Offset: 0x00) (R/W 16) Control A  
*/
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint16_t CMD:7;/*!< bit:  0.. 6  Command   
 */
-uint16_t :1;   /*!< bit:  7  Reserved  
 */
-uint16_t CMDEX:8;  /*!< bit:  8..15  Command Execution 
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint16_t reg;/*!< Type  used for register access 
 */
-} NVMCTRL_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define NVMCTRL_CTRLA_OFFSET0x00 /**< \brief (NVMCTRL_CTRLA 
offset) Control A */
-#define NVMCTRL_CTRLA_RESETVALUE0xul /**< \brief (NVMCTRL_CTRLA 
reset_value) Control A */
-
-#define NVMCTRL_CTRLA_CMD_Pos   0/**< \brief (NVMCTRL_CTRLA) 
Command */
-#define NVMCTRL_CTRLA_CMD_Msk   (0x7Ful << NVMCTRL_CTRLA_CMD_Pos)
-#define NVMCTRL_CTRLA_CMD(value)((NVMCTRL_CTRLA_CMD_Msk & ((value) << 
NVMCTRL_CTRLA_CMD_Pos)))
-#define   NVMCTRL_CTRLA_CMD_ER_Val0x2ul  /**< \brief (NVMCTRL_CTRLA) 
Erase Row - Erases the row addressed by the ADDR register. */
-#define   NVMCTRL_CTRLA_CMD_WP_Val0x4ul  /**< \brief (NVMCTRL_CTRLA) 
Write Page - Writes the contents of the page buffer to the page addressed by 
the ADDR register. */
-#define   NVMCTRL_CTRLA_CMD_EAR_Val   0x5ul  /**< \brief (NVMCTRL_CTRLA) 
Erase Auxiliary Row - Erases the auxiliary row addressed by the ADDR register. 
This command can be given only when the security bit is not set and only to the 
user configuration row. */
-#define   NVMCTRL_CTRLA_CMD_WAP_Val   0x6ul  /**< \brief (NVMCTRL_CTRLA) 
Write Auxiliary Page - Writes the contents of the page buffer to the page 
addressed by the ADDR register. This command can be given only when the 
security bit is not set and only to the user configuration row. */
-#define   NVMCTRL_CTRLA_CMD_SF_Val

[57/70] [abbrv] incubator-mynewt-larva git commit: Change shell_cmd_register arguments to take struct for the command only. Caller has to fill it in.

2016-03-03 Thread ccollins
Change shell_cmd_register arguments to take struct for the command
only. Caller has to fill it in.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/ded5c1fd
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/ded5c1fd
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/ded5c1fd

Branch: refs/heads/master
Commit: ded5c1fd77b28ff6da019911bde84eeb62f46789
Parents: 57542c8
Author: Marko Kiiskila 
Authored: Tue Mar 1 18:23:42 2016 -0800
Committer: Marko Kiiskila 
Committed: Tue Mar 1 18:23:42 2016 -0800

--
 fs/fs/src/fs_cli.c  | 33 
 libs/elua/elua_base/src/lmynewt.c   |  9 -
 libs/flash_test/src/flash_test/flash_test.c |  8 +++-
 libs/shell/include/shell/shell.h|  8 ++--
 libs/shell/src/shell.c  | 50 ++--
 libs/shell/src/shell_os.c   |  3 +-
 libs/shell/src/shell_priv.h | 26 
 project/bletiny/src/cmd.c   |  8 +++-
 sys/config/src/config_cli.c |  9 -
 sys/log/src/log.c   |  9 +++--
 sys/stats/src/stats_shell.c | 10 +++--
 11 files changed, 124 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ded5c1fd/fs/fs/src/fs_cli.c
--
diff --git a/fs/fs/src/fs_cli.c b/fs/fs/src/fs_cli.c
index 5eb43c7..459533e 100644
--- a/fs/fs/src/fs_cli.c
+++ b/fs/fs/src/fs_cli.c
@@ -27,10 +27,27 @@
 
 #include "fs/fs.h"
 
-static struct shell_cmd fs_ls_struct;
-static struct shell_cmd fs_rm_struct;
-static struct shell_cmd fs_mkdir_struct;
-static struct shell_cmd fs_mv_struct;
+static int fs_ls_cmd(int argc, char **argv);
+static int fs_rm_cmd(int argc, char **argv);
+static int fs_mkdir_cmd(int argc, char **argv);
+static int fs_mv_cmd(int argc, char **argv);
+
+static struct shell_cmd fs_ls_struct = {
+.sc_cmd = "ls",
+.sc_cmd_func = fs_ls_cmd
+};
+static struct shell_cmd fs_rm_struct = {
+.sc_cmd = "rm",
+.sc_cmd_func = fs_rm_cmd
+};
+static struct shell_cmd fs_mkdir_struct = {
+.sc_cmd = "mkdir",
+.sc_cmd_func = fs_mkdir_cmd
+};
+static struct shell_cmd fs_mv_struct = {
+.sc_cmd = "mv",
+.sc_cmd_func = fs_mv_cmd
+};
 
 static void
 fs_ls_file(const char *name, struct fs_file *file)
@@ -166,9 +183,9 @@ out:
 void
 fs_cli_init(void)
 {
-shell_cmd_register(_ls_struct, "ls", fs_ls_cmd);
-shell_cmd_register(_rm_struct, "rm", fs_rm_cmd);
-shell_cmd_register(_mkdir_struct, "mkdir", fs_mkdir_cmd);
-shell_cmd_register(_mv_struct, "mv", fs_mv_cmd);
+shell_cmd_register(_ls_struct);
+shell_cmd_register(_rm_struct);
+shell_cmd_register(_mkdir_struct);
+shell_cmd_register(_mv_struct);
 }
 #endif /* SHELL_PRESENT */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ded5c1fd/libs/elua/elua_base/src/lmynewt.c
--
diff --git a/libs/elua/elua_base/src/lmynewt.c 
b/libs/elua/elua_base/src/lmynewt.c
index 0c4a7d3..e7eda1e 100644
--- a/libs/elua/elua_base/src/lmynewt.c
+++ b/libs/elua/elua_base/src/lmynewt.c
@@ -22,7 +22,12 @@
 #ifdef MYNEWT
 
 #ifdef SHELL_PRESENT
-static struct shell_cmd lua_shell_cmd;
+static int lua_cmd(int argc, char **argv);
+
+static struct shell_cmd lua_shell_cmd = {
+.sc_cmd = "lua",
+.sc_cmd_func = lua_cmd
+};
 
 static int
 lua_cmd(int argc, char **argv)
@@ -36,7 +41,7 @@ int
 lua_init(void)
 {
 #ifdef SHELL_PRESENT
-return shell_cmd_register(_shell_cmd, "lua", lua_cmd);
+return shell_cmd_register(_shell_cmd);
 #else
 return 0;
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/ded5c1fd/libs/flash_test/src/flash_test/flash_test.c
--
diff --git a/libs/flash_test/src/flash_test/flash_test.c 
b/libs/flash_test/src/flash_test/flash_test.c
index 9985a70..2db72b5 100644
--- a/libs/flash_test/src/flash_test/flash_test.c
+++ b/libs/flash_test/src/flash_test/flash_test.c
@@ -25,7 +25,11 @@
 #include 
 #include 
 
-static struct shell_cmd flash_cmd_struct;
+static int flash_cli_cmd(int argc, char **argv);
+static struct shell_cmd flash_cmd_struct = {
+.sc_cmd = "flash",
+.sc_cmd_func = flash_cli_cmd
+};
 
 static int
 flash_cli_cmd(int argc, char **argv)
@@ -144,6 +148,6 @@ err:
 
 int
 flash_test_init(void) {
-shell_cmd_register(_cmd_struct, "flash", flash_cli_cmd);
+shell_cmd_register(_cmd_struct);
 return 0;
 }


[29/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/interrupt/system_interrupt.c
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/interrupt/system_interrupt.c 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/interrupt/system_interrupt.c
deleted file mode 100755
index 24ee27f..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/interrupt/system_interrupt.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/**
- * \file
- *
- * \brief SAM System Interrupt Driver
- *
- * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#include "system_interrupt.h"
-
-/**
- * \brief Check if a interrupt line is pending.
- *
- * Checks if the requested interrupt vector is pending.
- *
- * \param[in] vector  Interrupt vector number to check
- *
- * \returns A boolean identifying if the requested interrupt vector is pending.
- *
- * \retval true   Specified interrupt vector is pending
- * \retval false  Specified interrupt vector is not pending
- *
- */
-bool system_interrupt_is_pending(
-   const enum system_interrupt_vector vector)
-{
-   bool result;
-
-   if (vector >= _SYSTEM_INTERRUPT_EXTERNAL_VECTOR_START) {
-   result = ((NVIC->ISPR[0] & (1 << vector)) != 0);
-   } else if (vector == SYSTEM_INTERRUPT_SYSTICK) {
-   result = ((SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) != 0);
-   } else {
-   Assert(false);
-   result = false;
-   }
-
-   return result;
-}
-
-/**
- * \brief Set a interrupt vector as pending.
- *
- * Set the requested interrupt vector as pending (i.e. issues a software
- * interrupt request for the specified vector). The software handler will be
- * handled (if enabled) in a priority order based on vector number and
- * configured priority settings.
- *
- * \param[in] vector  Interrupt vector number which is set as pending
- *
- * \returns Status code identifying if the vector was successfully set as
- *  pending.
- *
- * \retval STATUS_OK   If no error was detected
- * \retval STATUS_INVALID_ARG  If an unsupported interrupt vector number was 
given
- */
-enum status_code system_interrupt_set_pending(
-   const enum system_interrupt_vector vector)
-{
-   enum status_code status = STATUS_OK;
-
-   if (vector >= _SYSTEM_INTERRUPT_EXTERNAL_VECTOR_START) {
-   NVIC->ISPR[0] = (1 << vector);
-   } else if (vector == SYSTEM_INTERRUPT_NON_MASKABLE) {
-   /* Note: Because NMI has highest priority it will be executed
-* immediately after it has been set pending */
-   SCB->ICSR = SCB_ICSR_NMIPENDSET_Msk;
-   } else if (vector == SYSTEM_INTERRUPT_SYSTICK) {
-   SCB->ICSR = SCB_ICSR_PENDSTSET_Msk;
-   } else {
-   /* The user want to set something unsupported as pending */
-   Assert(false);
-   status = STATUS_ERR_INVALID_ARG;
-   }
-
-   return status;
-}
-
-/**
- * \brief Clear pending interrupt vector.
- *
- * Clear a pending interrupt vector, so the software handler is not executed.
- *
- * \param[in] 

[18/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/i2s.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/i2s.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/i2s.h
deleted file mode 100755
index d10f5d4..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/i2s.h
+++ /dev/null
@@ -1,642 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for I2S
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_I2S_COMPONENT_
-#define _SAMD21_I2S_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR I2S */
-/* == 
*/
-/** \addtogroup SAMD21_I2S Inter-IC Sound Interface */
-/*@{*/
-
-#define I2S_U2224
-#define REV_I2S 0x110
-
-/*  I2S_CTRLA : (I2S Offset: 0x00) (R/W  8) Control A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint8_t  ENABLE:1; /*!< bit:  1  Enable
 */
-uint8_t  CKEN0:1;  /*!< bit:  2  Clock Unit 0 Enable   
 */
-uint8_t  CKEN1:1;  /*!< bit:  3  Clock Unit 1 Enable   
 */
-uint8_t  SEREN0:1; /*!< bit:  4  Serializer 0 Enable   
 */
-uint8_t  SEREN1:1; /*!< bit:  5  Serializer 1 Enable   
 */
-uint8_t  :2;   /*!< bit:  6.. 7  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  struct {
-uint8_t  :2;   /*!< bit:  0.. 1  Reserved  
 */
-uint8_t  CKEN:2;   /*!< bit:  2.. 3  Clock Unit x Enable   
 */
-uint8_t  SEREN:2;  /*!< bit:  4.. 5  Serializer x Enable   
 */
-uint8_t  :2;   /*!< bit:  6.. 7  Reserved  
 */
-  } vec;   /*!< Structure used for vec  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} I2S_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define I2S_CTRLA_OFFSET0x00 /**< \brief (I2S_CTRLA 
offset) Control A */
-#define I2S_CTRLA_RESETVALUE0x00ul   /**< \brief (I2S_CTRLA 
reset_value) Control A */
-
-#define I2S_CTRLA_SWRST_Pos 0/**< \brief (I2S_CTRLA) 
Software Reset */
-#define I2S_CTRLA_SWRST (0x1ul << I2S_CTRLA_SWRST_Pos)
-#define I2S_CTRLA_ENABLE_Pos1/**< \brief (I2S_CTRLA) 
Enable */
-#define I2S_CTRLA_ENABLE(0x1ul << I2S_CTRLA_ENABLE_Pos)
-#define I2S_CTRLA_CKEN0_Pos 2/**< \brief (I2S_CTRLA) Clock 
Unit 0 Enable */
-#define I2S_CTRLA_CKEN0 

[02/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16a.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16a.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16a.h
deleted file mode 100755
index 8ebe8bb..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e16a.h
+++ /dev/null
@@ -1,644 +0,0 @@
-/**
- * \file
- *
- * \brief Peripheral I/O description for SAMD21E16A
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21E16A_PIO_
-#define _SAMD21E16A_PIO_
-
-#define PIN_PA00   0  /**< \brief Pin Number for PA00 
*/
-#define PORT_PA00 (1ul <<  0) /**< \brief PORT Mask  for PA00 
*/
-#define PIN_PA01   1  /**< \brief Pin Number for PA01 
*/
-#define PORT_PA01 (1ul <<  1) /**< \brief PORT Mask  for PA01 
*/
-#define PIN_PA02   2  /**< \brief Pin Number for PA02 
*/
-#define PORT_PA02 (1ul <<  2) /**< \brief PORT Mask  for PA02 
*/
-#define PIN_PA03   3  /**< \brief Pin Number for PA03 
*/
-#define PORT_PA03 (1ul <<  3) /**< \brief PORT Mask  for PA03 
*/
-#define PIN_PA04   4  /**< \brief Pin Number for PA04 
*/
-#define PORT_PA04 (1ul <<  4) /**< \brief PORT Mask  for PA04 
*/
-#define PIN_PA05   5  /**< \brief Pin Number for PA05 
*/
-#define PORT_PA05 (1ul <<  5) /**< \brief PORT Mask  for PA05 
*/
-#define PIN_PA06   6  /**< \brief Pin Number for PA06 
*/
-#define PORT_PA06 (1ul <<  6) /**< \brief PORT Mask  for PA06 
*/
-#define PIN_PA07   7  /**< \brief Pin Number for PA07 
*/
-#define PORT_PA07 (1ul <<  7) /**< \brief PORT Mask  for PA07 
*/
-#define PIN_PA08   8  /**< \brief Pin Number for PA08 
*/
-#define PORT_PA08 (1ul <<  8) /**< \brief PORT Mask  for PA08 
*/
-#define PIN_PA09   9  /**< \brief Pin Number for PA09 
*/
-#define PORT_PA09 (1ul <<  9) /**< \brief PORT Mask  for PA09 
*/
-#define PIN_PA10  10  /**< \brief Pin Number for PA10 
*/
-#define PORT_PA10 (1ul << 10) /**< \brief PORT Mask  for PA10 
*/
-#define PIN_PA11  11  /**< \brief Pin Number for PA11 
*/
-#define PORT_PA11 (1ul << 11) /**< \brief PORT Mask  for PA11 
*/
-#define PIN_PA14  14  /**< \brief Pin Number for PA14 
*/
-#define PORT_PA14 (1ul << 14) /**< \brief PORT Mask  for PA14 
*/
-#define PIN_PA15  15  /**< \brief Pin Number for PA15 
*/
-#define PORT_PA15 (1ul << 15) /**< \brief PORT Mask  for PA15 
*/
-#define PIN_PA16  16  /**< \brief Pin Number for PA16 
*/
-#define PORT_PA16 (1ul << 16) /**< \brief PORT Mask  for PA16 
*/

[09/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/usb.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/usb.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/usb.h
deleted file mode 100755
index 7586ee5..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/usb.h
+++ /dev/null
@@ -1,1807 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for USB
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_USB_COMPONENT_
-#define _SAMD21_USB_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR USB */
-/* == 
*/
-/** \addtogroup SAMD21_USB Universal Serial Bus */
-/*@{*/
-
-#define USB_U
-#define REV_USB 0x103
-
-/*  USB_CTRLA : (USB Offset: 0x000) (R/W  8) Control A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint8_t  ENABLE:1; /*!< bit:  1  Enable
 */
-uint8_t  RUNSTDBY:1;   /*!< bit:  2  Run in Standby Mode   
 */
-uint8_t  :4;   /*!< bit:  3.. 6  Reserved  
 */
-uint8_t  MODE:1;   /*!< bit:  7  Operating Mode
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} USB_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define USB_CTRLA_OFFSET0x000/**< \brief (USB_CTRLA 
offset) Control A */
-#define USB_CTRLA_RESETVALUE0x00ul   /**< \brief (USB_CTRLA 
reset_value) Control A */
-
-#define USB_CTRLA_SWRST_Pos 0/**< \brief (USB_CTRLA) 
Software Reset */
-#define USB_CTRLA_SWRST (0x1ul << USB_CTRLA_SWRST_Pos)
-#define USB_CTRLA_ENABLE_Pos1/**< \brief (USB_CTRLA) 
Enable */
-#define USB_CTRLA_ENABLE(0x1ul << USB_CTRLA_ENABLE_Pos)
-#define USB_CTRLA_RUNSTDBY_Pos  2/**< \brief (USB_CTRLA) Run 
in Standby Mode */
-#define USB_CTRLA_RUNSTDBY  (0x1ul << USB_CTRLA_RUNSTDBY_Pos)
-#define USB_CTRLA_MODE_Pos  7/**< \brief (USB_CTRLA) 
Operating Mode */
-#define USB_CTRLA_MODE  (0x1ul << USB_CTRLA_MODE_Pos)
-#define   USB_CTRLA_MODE_DEVICE_Val   0x0ul  /**< \brief (USB_CTRLA) 
Device Mode */
-#define   USB_CTRLA_MODE_HOST_Val 0x1ul  /**< \brief (USB_CTRLA) Host 
Mode */
-#define USB_CTRLA_MODE_DEVICE   (USB_CTRLA_MODE_DEVICE_Val << 
USB_CTRLA_MODE_Pos)
-#define USB_CTRLA_MODE_HOST (USB_CTRLA_MODE_HOST_Val   << 
USB_CTRLA_MODE_Pos)
-#define USB_CTRLA_MASK  0x87ul   /**< \brief (USB_CTRLA) 

[59/70] [abbrv] incubator-mynewt-larva git commit: MYNEWT-188: controller code now uses correct mbuf API to free a mbuf chain.

2016-03-03 Thread ccollins
MYNEWT-188: controller code now uses correct mbuf API to free a mbuf chain.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/cdf3a777
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/cdf3a777
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/cdf3a777

Branch: refs/heads/master
Commit: cdf3a9540cb52bea1049f81195542bf2f559
Parents: 2070003
Author: wes3 
Authored: Wed Mar 2 11:57:17 2016 -0800
Committer: wes3 
Committed: Wed Mar 2 11:57:29 2016 -0800

--
 net/nimble/controller/src/ble_ll.c   | 12 ++--
 net/nimble/controller/src/ble_ll_adv.c   |  4 ++--
 net/nimble/controller/src/ble_ll_conn.c  | 14 +++---
 net/nimble/controller/src/ble_ll_conn_priv.h |  2 +-
 net/nimble/controller/src/ble_ll_ctrl.c  |  4 ++--
 net/nimble/controller/src/ble_ll_scan.c  |  2 +-
 6 files changed, 19 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/cdf3a777/net/nimble/controller/src/ble_ll.c
--
diff --git a/net/nimble/controller/src/ble_ll.c 
b/net/nimble/controller/src/ble_ll.c
index 2229c89..bddc365 100644
--- a/net/nimble/controller/src/ble_ll.c
+++ b/net/nimble/controller/src/ble_ll.c
@@ -381,7 +381,7 @@ ble_ll_tx_pkt_in(void)
 if ((pkthdr->omp_len != length) || (pb > 0x1000) || (length == 0)) {
 /* This is a bad ACL packet. Count a stat and free it */
 STATS_INC(ble_ll_stats, bad_acl_hdr);
-os_mbuf_free(om);
+os_mbuf_free_chain(om);
 continue;
 }
 
@@ -483,7 +483,7 @@ ble_ll_rx_pkt_in(void)
 }
 
 /* Free the packet buffer */
-os_mbuf_free(m);
+os_mbuf_free_chain(m);
 }
 }
 }
@@ -696,7 +696,7 @@ ble_ll_rx_end(struct os_mbuf *rxpdu, struct ble_mbuf_hdr 
*ble_hdr)
 /* If this is a malformed packet, just kill it here */
 if (badpkt) {
 STATS_INC(ble_ll_stats, rx_adv_malformed_pkts);
-os_mbuf_free(rxpdu);
+os_mbuf_free_chain(rxpdu);
 rxpdu = NULL;
 rc = -1;
 }
@@ -863,7 +863,7 @@ ble_ll_flush_pkt_queue(struct ble_ll_pkt_q *pktq)
 
 /* Remove from queue and free the mbuf */
 STAILQ_REMOVE_HEAD(pktq, omp_next);
-os_mbuf_free(om);
+os_mbuf_free_chain(om);
 }
 }
 
@@ -935,8 +935,8 @@ ble_ll_reset(void)
 memset(_ble_ll_log, 0, sizeof(g_ble_ll_log));
 #endif
 
-/* End all connections */
-ble_ll_conn_reset();
+/* Reset connection module */
+ble_ll_conn_module_reset();
 
 /* All this does is re-initialize the event masks so call the hci init */
 ble_ll_hci_init();

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/cdf3a777/net/nimble/controller/src/ble_ll_adv.c
--
diff --git a/net/nimble/controller/src/ble_ll_adv.c 
b/net/nimble/controller/src/ble_ll_adv.c
index 515dabf..c8a3255 100644
--- a/net/nimble/controller/src/ble_ll_adv.c
+++ b/net/nimble/controller/src/ble_ll_adv.c
@@ -1267,8 +1267,8 @@ ble_ll_adv_reset(void)
 ble_ll_adv_sm_stop(advsm);
 
 /* Free advertiser pdu's */
-os_mbuf_free(advsm->adv_pdu);
-os_mbuf_free(advsm->scan_rsp_pdu);
+os_mbuf_free_chain(advsm->adv_pdu);
+os_mbuf_free_chain(advsm->scan_rsp_pdu);
 
 /* re-initialize the advertiser state machine */
 ble_ll_adv_init();

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/cdf3a777/net/nimble/controller/src/ble_ll_conn.c
--
diff --git a/net/nimble/controller/src/ble_ll_conn.c 
b/net/nimble/controller/src/ble_ll_conn.c
index 4cd4439..1d61c3d 100644
--- a/net/nimble/controller/src/ble_ll_conn.c
+++ b/net/nimble/controller/src/ble_ll_conn.c
@@ -1153,7 +1153,7 @@ ble_ll_conn_end(struct ble_ll_conn_sm *connsm, uint8_t 
ble_err)
 STAILQ_REMOVE_HEAD(>conn_txq, omp_next);
 
 m = (struct os_mbuf *)((uint8_t *)pkthdr - sizeof(struct os_mbuf));
-os_mbuf_free(m);
+os_mbuf_free_chain(m);
 }
 
 /* Make sure events off queue */
@@ -1965,7 +1965,7 @@ ble_ll_conn_rx_data_pdu(struct os_mbuf *rxpdu, struct 
ble_mbuf_hdr *hdr)
 
 /* Free buffer */
 conn_rx_data_pdu_end:
-os_mbuf_free(rxpdu);
+os_mbuf_free_chain(rxpdu);
 }
 
 /**
@@ -2093,7 +2093,7 @@ ble_ll_conn_rx_isr_end(struct os_mbuf *rxpdu, uint32_t aa)
  txpdu->om_data[0])) {
 connsm->csmflags.cfbit.terminate_ind_txd = 1;
 

[14/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sercom.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sercom.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sercom.h
deleted file mode 100755
index d26df24..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/sercom.h
+++ /dev/null
@@ -1,1511 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for SERCOM
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_SERCOM_COMPONENT_
-#define _SAMD21_SERCOM_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR SERCOM */
-/* == 
*/
-/** \addtogroup SAMD21_SERCOM Serial Communication Interface */
-/*@{*/
-
-#define SERCOM_U2201
-#define REV_SERCOM  0x201
-
-/*  SERCOM_I2CM_CTRLA : (SERCOM Offset: 0x00) (R/W 32) I2CM I2CM 
Control A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint32_t SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint32_t ENABLE:1; /*!< bit:  1  Enable
 */
-uint32_t MODE:3;   /*!< bit:  2.. 4  Operating Mode
 */
-uint32_t :2;   /*!< bit:  5.. 6  Reserved  
 */
-uint32_t RUNSTDBY:1;   /*!< bit:  7  Run in Standby
 */
-uint32_t :8;   /*!< bit:  8..15  Reserved  
 */
-uint32_t PINOUT:1; /*!< bit: 16  Pin Usage 
 */
-uint32_t :3;   /*!< bit: 17..19  Reserved  
 */
-uint32_t SDAHOLD:2;/*!< bit: 20..21  SDA Hold Time 
 */
-uint32_t MEXTTOEN:1;   /*!< bit: 22  Master SCL Low Extend Timeout 
 */
-uint32_t SEXTTOEN:1;   /*!< bit: 23  Slave SCL Low Extend Timeout  
 */
-uint32_t SPEED:2;  /*!< bit: 24..25  Transfer Speed
 */
-uint32_t :1;   /*!< bit: 26  Reserved  
 */
-uint32_t SCLSM:1;  /*!< bit: 27  SCL Clock Stretch Mode
 */
-uint32_t INACTOUT:2;   /*!< bit: 28..29  Inactive Time-Out 
 */
-uint32_t LOWTOUTEN:1;  /*!< bit: 30  SCL Low Timeout Enable
 */
-uint32_t :1;   /*!< bit: 31  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint32_t reg;/*!< Type  used for register access 
 */
-} SERCOM_I2CM_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define SERCOM_I2CM_CTRLA_OFFSET0x00 /**< \brief 
(SERCOM_I2CM_CTRLA offset) I2CM Control A */
-#define 

[12/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tc.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tc.h
deleted file mode 100755
index f631f96..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tc.h
+++ /dev/null
@@ -1,687 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for TC
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_TC_COMPONENT_
-#define _SAMD21_TC_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR TC */
-/* == 
*/
-/** \addtogroup SAMD21_TC Basic Timer Counter */
-/*@{*/
-
-#define TC_U2212
-#define REV_TC  0x131
-
-/*  TC_CTRLA : (TC Offset: 0x00) (R/W 16) Control A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint16_t SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint16_t ENABLE:1; /*!< bit:  1  Enable
 */
-uint16_t MODE:2;   /*!< bit:  2.. 3  TC Mode   
 */
-uint16_t :1;   /*!< bit:  4  Reserved  
 */
-uint16_t WAVEGEN:2;/*!< bit:  5.. 6  Waveform Generation Operation 
 */
-uint16_t :1;   /*!< bit:  7  Reserved  
 */
-uint16_t PRESCALER:3;  /*!< bit:  8..10  Prescaler 
 */
-uint16_t RUNSTDBY:1;   /*!< bit: 11  Run in Standby
 */
-uint16_t PRESCSYNC:2;  /*!< bit: 12..13  Prescaler and Counter 
Synchronization */
-uint16_t :2;   /*!< bit: 14..15  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint16_t reg;/*!< Type  used for register access 
 */
-} TC_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define TC_CTRLA_OFFSET 0x00 /**< \brief (TC_CTRLA offset) 
Control A */
-#define TC_CTRLA_RESETVALUE 0xul /**< \brief (TC_CTRLA 
reset_value) Control A */
-
-#define TC_CTRLA_SWRST_Pos  0/**< \brief (TC_CTRLA) 
Software Reset */
-#define TC_CTRLA_SWRST  (0x1ul << TC_CTRLA_SWRST_Pos)
-#define TC_CTRLA_ENABLE_Pos 1/**< \brief (TC_CTRLA) Enable 
*/
-#define TC_CTRLA_ENABLE (0x1ul << TC_CTRLA_ENABLE_Pos)
-#define TC_CTRLA_MODE_Pos   2/**< \brief (TC_CTRLA) TC 
Mode */
-#define TC_CTRLA_MODE_Msk   (0x3ul << TC_CTRLA_MODE_Pos)
-#define TC_CTRLA_MODE(value)((TC_CTRLA_MODE_Msk & ((value) << 
TC_CTRLA_MODE_Pos)))
-#define   TC_CTRLA_MODE_COUNT16_Val   0x0ul  /**< \brief (TC_CTRLA) 
Counter in 16-bit mode 

[31/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock.c
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock.c
 
b/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock.c
deleted file mode 100755
index 2bf74f1..000
--- 
a/hw/mcu/atmel/samd21xx/src/sam0/drivers/system/clock/clock_samd21_r21_da/clock.c
+++ /dev/null
@@ -1,1038 +0,0 @@
-/**
- * \file
- *
- * \brief SAM D21/R21/DA0/DA1 Clock Driver
- *
- * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-#include 
-#include 
-#include 
-
-#ifndef SYSCTRL_FUSES_OSC32K_ADDR
-#if (SAMR21) || (SAMD)
-#  define SYSCTRL_FUSES_OSC32K_ADDR FUSES_OSC32K_CAL_ADDR
-#  define SYSCTRL_FUSES_OSC32K_Pos  FUSES_OSC32K_CAL_Pos
-#elif (SAML21)
-#  define SYSCTRL_FUSES_OSC32K_ADDR NVMCTRL_OTP4
-#  define SYSCTRL_FUSES_OSC32K_Pos  6
-
-#else
-#  define SYSCTRL_FUSES_OSC32K_ADDR SYSCTRL_FUSES_OSC32K_CAL_ADDR
-#  define SYSCTRL_FUSES_OSC32K_Pos  SYSCTRL_FUSES_OSC32K_CAL_Pos
-#endif
-#endif
-
-/**
- * \internal
- * \brief DFLL-specific data container.
- */
-struct _system_clock_dfll_config {
-   uint32_t control;
-   uint32_t val;
-   uint32_t mul;
-};
-
-/**
- * \internal
- * \brief DPLL-specific data container.
- */
-struct _system_clock_dpll_config {
-   uint32_t frequency;
-};
-
-
-/**
- * \internal
- * \brief XOSC-specific data container.
- */
-struct _system_clock_xosc_config {
-   uint32_t frequency;
-};
-
-/**
- * \internal
- * \brief System clock module data container.
- */
-struct _system_clock_module {
-   volatile struct _system_clock_dfll_config dfll;
-
-#ifdef FEATURE_SYSTEM_CLOCK_DPLL
-   volatile struct _system_clock_dpll_config dpll;
-#endif
-
-   volatile struct _system_clock_xosc_config xosc;
-   volatile struct _system_clock_xosc_config xosc32k;
-};
-
-/**
- * \internal
- * \brief Internal module instance to cache configuration values.
- */
-static struct _system_clock_module _system_clock_inst = {
-   .dfll = {
-   .control = 0,
-   .val = 0,
-   .mul = 0,
-   },
-
-#ifdef FEATURE_SYSTEM_CLOCK_DPLL
-   .dpll = {
-   .frequency   = 0,
-   },
-#endif
-   .xosc = {
-   .frequency   = 0,
-   },
-   .xosc32k = {
-   .frequency   = 0,
-   },
-   };
-
-/**
- * \internal
- * \brief Wait for sync to the DFLL control registers.
- */
-static inline void _system_dfll_wait_for_sync(void)
-{
-   while (!(SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY)) {
-   /* Wait for DFLL sync */
-   }
-}
-
-/**
- * \internal
- * \brief Wait for sync to the OSC32K control registers.
- */
-static inline void _system_osc32k_wait_for_sync(void)
-{
-   while (!(SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_OSC32KRDY)) {
-   /* Wait for OSC32K sync */
-   }
-}
-
-static inline void 

[52/70] [abbrv] incubator-mynewt-larva git commit: add macro to init sanity check

2016-03-03 Thread ccollins
add macro to init sanity check


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/2e28d273
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/2e28d273
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/2e28d273

Branch: refs/heads/master
Commit: 2e28d273bb1d3c98a6909237ac14c03810e920ca
Parents: a280628
Author: Sterling Hughes 
Authored: Fri Feb 26 23:53:01 2016 -0800
Committer: Sterling Hughes 
Committed: Fri Feb 26 23:54:13 2016 -0800

--
 libs/os/include/os/os_sanity.h | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/2e28d273/libs/os/include/os/os_sanity.h
--
diff --git a/libs/os/include/os/os_sanity.h b/libs/os/include/os/os_sanity.h
index f1829b5..6af9808 100644
--- a/libs/os/include/os/os_sanity.h
+++ b/libs/os/include/os/os_sanity.h
@@ -36,7 +36,12 @@ struct os_sanity_check {
 
 SLIST_ENTRY(os_sanity_check) sc_next;
 
-}; 
+};
+
+#define OS_SANITY_CHECK_SETFUNC(__sc, __f, __arg, __itvl)  \
+(__sc)->sc_func = (__f);   \
+(__sc)->sc_arg = (__arg);  \
+(__sc)->sc_checkin_itvl = (__itvl) * OS_TICKS_PER_SEC;
 
 int os_sanity_task_init(int);
 struct os_task;



[67/70] [abbrv] incubator-mynewt-larva git commit: This closes #8. I also committed a very minor change with this as something went wrong when I tried to amend the commit. All I did was remove the ini

2016-03-03 Thread ccollins
This closes #8. I also committed a very minor change with this as something 
went wrong when I tried to amend the commit. All I did was remove the 
initialization of the global variable os_time to 0


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/9ad54b8d
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/9ad54b8d
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/9ad54b8d

Branch: refs/heads/master
Commit: 9ad54b8d7f6fef1cff43760fc89a8a33ef73af89
Parents: f4c430c
Author: wes3 
Authored: Thu Mar 3 15:11:55 2016 -0800
Committer: wes3 
Committed: Thu Mar 3 15:11:55 2016 -0800

--
 libs/os/src/os_time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/9ad54b8d/libs/os/src/os_time.c
--
diff --git a/libs/os/src/os_time.c b/libs/os/src/os_time.c
index 28aaced..1b703e0 100644
--- a/libs/os/src/os_time.c
+++ b/libs/os/src/os_time.c
@@ -22,7 +22,7 @@
 
 #define OS_USEC_PER_TICK(100 / OS_TICKS_PER_SEC)
 
-os_time_t g_os_time = 0;
+os_time_t g_os_time;
 
 /*
  * Time-of-day collateral.



[11/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc.h
deleted file mode 100755
index ddbf7bb..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/tcc.h
+++ /dev/null
@@ -1,1820 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for TCC
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_TCC_COMPONENT_
-#define _SAMD21_TCC_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR TCC */
-/* == 
*/
-/** \addtogroup SAMD21_TCC Timer Counter Control */
-/*@{*/
-
-#define TCC_U2213
-#define REV_TCC 0x121
-
-/*  TCC_CTRLA : (TCC Offset: 0x00) (R/W 32) Control A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint32_t SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint32_t ENABLE:1; /*!< bit:  1  Enable
 */
-uint32_t :3;   /*!< bit:  2.. 4  Reserved  
 */
-uint32_t RESOLUTION:2; /*!< bit:  5.. 6  Enhanced Resolution   
 */
-uint32_t :1;   /*!< bit:  7  Reserved  
 */
-uint32_t PRESCALER:3;  /*!< bit:  8..10  Prescaler 
 */
-uint32_t RUNSTDBY:1;   /*!< bit: 11  Run in Standby
 */
-uint32_t PRESCSYNC:2;  /*!< bit: 12..13  Prescaler and Counter 
Synchronization Selection */
-uint32_t ALOCK:1;  /*!< bit: 14  Auto Lock 
 */
-uint32_t :9;   /*!< bit: 15..23  Reserved  
 */
-uint32_t CPTEN0:1; /*!< bit: 24  Capture Channel 0 Enable  
 */
-uint32_t CPTEN1:1; /*!< bit: 25  Capture Channel 1 Enable  
 */
-uint32_t CPTEN2:1; /*!< bit: 26  Capture Channel 2 Enable  
 */
-uint32_t CPTEN3:1; /*!< bit: 27  Capture Channel 3 Enable  
 */
-uint32_t :4;   /*!< bit: 28..31  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  struct {
-uint32_t :24;  /*!< bit:  0..23  Reserved  
 */
-uint32_t CPTEN:4;  /*!< bit: 24..27  Capture Channel x Enable  
 */
-uint32_t :4;   /*!< bit: 28..31  Reserved  
 */
-  } vec;   /*!< Structure used for vec  access 
 */
-  uint32_t reg;/*!< Type  used for register access 
 */
-} TCC_CTRLA_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define 

[16/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/pm.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/pm.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/pm.h
deleted file mode 100755
index 7e522db..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/pm.h
+++ /dev/null
@@ -1,561 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for PM
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_PM_COMPONENT_
-#define _SAMD21_PM_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR PM */
-/* == 
*/
-/** \addtogroup SAMD21_PM Power Manager */
-/*@{*/
-
-#define PM_U2206
-#define REV_PM  0x211
-
-/*  PM_CTRL : (PM Offset: 0x00) (R/W  8) Control  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  uint8_t reg; /*!< Type  used for register access 
 */
-} PM_CTRL_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define PM_CTRL_OFFSET  0x00 /**< \brief (PM_CTRL offset) 
Control */
-#define PM_CTRL_RESETVALUE  0x00ul   /**< \brief (PM_CTRL 
reset_value) Control */
-
-#define PM_CTRL_MASK0x00ul   /**< \brief (PM_CTRL) MASK 
Register */
-
-/*  PM_SLEEP : (PM Offset: 0x01) (R/W  8) Sleep Mode  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  IDLE:2;   /*!< bit:  0.. 1  Idle Mode Configuration   
 */
-uint8_t  :6;   /*!< bit:  2.. 7  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} PM_SLEEP_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define PM_SLEEP_OFFSET 0x01 /**< \brief (PM_SLEEP offset) 
Sleep Mode */
-#define PM_SLEEP_RESETVALUE 0x00ul   /**< \brief (PM_SLEEP 
reset_value) Sleep Mode */
-
-#define PM_SLEEP_IDLE_Pos   0/**< \brief (PM_SLEEP) Idle 
Mode Configuration */
-#define PM_SLEEP_IDLE_Msk   (0x3ul << PM_SLEEP_IDLE_Pos)
-#define PM_SLEEP_IDLE(value)((PM_SLEEP_IDLE_Msk & ((value) << 
PM_SLEEP_IDLE_Pos)))
-#define   PM_SLEEP_IDLE_CPU_Val   0x0ul  /**< \brief (PM_SLEEP) The 
CPU clock domain is stopped */
-#define   PM_SLEEP_IDLE_AHB_Val   0x1ul  /**< \brief (PM_SLEEP) The 
CPU and AHB clock domains are stopped */
-#define   PM_SLEEP_IDLE_APB_Val   0x2ul  /**< \brief (PM_SLEEP) The 
CPU, AHB and APB clock domains are stopped */
-#define PM_SLEEP_IDLE_CPU   (PM_SLEEP_IDLE_CPU_Val << 
PM_SLEEP_IDLE_Pos)
-#define PM_SLEEP_IDLE_AHB   

[07/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/mtb.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/mtb.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/mtb.h
deleted file mode 100755
index 21508c7..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/instance/mtb.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- * \file
- *
- * \brief Instance description for MTB
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_MTB_INSTANCE_
-#define _SAMD21_MTB_INSTANCE_
-
-/* == Register definition for MTB peripheral == */
-#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-#define REG_MTB_POSITION   (0x41006000U) /**< \brief (MTB) MTB 
Position */
-#define REG_MTB_MASTER (0x41006004U) /**< \brief (MTB) MTB Master 
*/
-#define REG_MTB_FLOW   (0x41006008U) /**< \brief (MTB) MTB Flow */
-#define REG_MTB_BASE   (0x4100600CU) /**< \brief (MTB) MTB Base */
-#define REG_MTB_ITCTRL (0x41006F00U) /**< \brief (MTB) MTB 
Integration Mode Control */
-#define REG_MTB_CLAIMSET   (0x41006FA0U) /**< \brief (MTB) MTB Claim 
Set */
-#define REG_MTB_CLAIMCLR   (0x41006FA4U) /**< \brief (MTB) MTB Claim 
Clear */
-#define REG_MTB_LOCKACCESS (0x41006FB0U) /**< \brief (MTB) MTB Lock 
Access */
-#define REG_MTB_LOCKSTATUS (0x41006FB4U) /**< \brief (MTB) MTB Lock 
Status */
-#define REG_MTB_AUTHSTATUS (0x41006FB8U) /**< \brief (MTB) MTB 
Authentication Status */
-#define REG_MTB_DEVARCH(0x41006FBCU) /**< \brief (MTB) MTB Device 
Architecture */
-#define REG_MTB_DEVID  (0x41006FC8U) /**< \brief (MTB) MTB Device 
Configuration */
-#define REG_MTB_DEVTYPE(0x41006FCCU) /**< \brief (MTB) MTB Device 
Type */
-#define REG_MTB_PID4   (0x41006FD0U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_PID5   (0x41006FD4U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_PID6   (0x41006FD8U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_PID7   (0x41006FDCU) /**< \brief (MTB) CoreSight */
-#define REG_MTB_PID0   (0x41006FE0U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_PID1   (0x41006FE4U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_PID2   (0x41006FE8U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_PID3   (0x41006FECU) /**< \brief (MTB) CoreSight */
-#define REG_MTB_CID0   (0x41006FF0U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_CID1   (0x41006FF4U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_CID2   (0x41006FF8U) /**< \brief (MTB) CoreSight */
-#define REG_MTB_CID3   (0x41006FFCU) /**< \brief (MTB) CoreSight */
-#else
-#define REG_MTB_POSITION   (*(RwReg  *)0x41006000U) /**< \brief (MTB) 
MTB Position */
-#define REG_MTB_MASTER (*(RwReg  *)0x41006004U) /**< \brief (MTB) 
MTB Master */
-#define REG_MTB_FLOW   (*(RwReg  

[04/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e15a.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e15a.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e15a.h
deleted file mode 100755
index 152aaa0..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/pio/samd21e15a.h
+++ /dev/null
@@ -1,644 +0,0 @@
-/**
- * \file
- *
- * \brief Peripheral I/O description for SAMD21E15A
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21E15A_PIO_
-#define _SAMD21E15A_PIO_
-
-#define PIN_PA00   0  /**< \brief Pin Number for PA00 
*/
-#define PORT_PA00 (1ul <<  0) /**< \brief PORT Mask  for PA00 
*/
-#define PIN_PA01   1  /**< \brief Pin Number for PA01 
*/
-#define PORT_PA01 (1ul <<  1) /**< \brief PORT Mask  for PA01 
*/
-#define PIN_PA02   2  /**< \brief Pin Number for PA02 
*/
-#define PORT_PA02 (1ul <<  2) /**< \brief PORT Mask  for PA02 
*/
-#define PIN_PA03   3  /**< \brief Pin Number for PA03 
*/
-#define PORT_PA03 (1ul <<  3) /**< \brief PORT Mask  for PA03 
*/
-#define PIN_PA04   4  /**< \brief Pin Number for PA04 
*/
-#define PORT_PA04 (1ul <<  4) /**< \brief PORT Mask  for PA04 
*/
-#define PIN_PA05   5  /**< \brief Pin Number for PA05 
*/
-#define PORT_PA05 (1ul <<  5) /**< \brief PORT Mask  for PA05 
*/
-#define PIN_PA06   6  /**< \brief Pin Number for PA06 
*/
-#define PORT_PA06 (1ul <<  6) /**< \brief PORT Mask  for PA06 
*/
-#define PIN_PA07   7  /**< \brief Pin Number for PA07 
*/
-#define PORT_PA07 (1ul <<  7) /**< \brief PORT Mask  for PA07 
*/
-#define PIN_PA08   8  /**< \brief Pin Number for PA08 
*/
-#define PORT_PA08 (1ul <<  8) /**< \brief PORT Mask  for PA08 
*/
-#define PIN_PA09   9  /**< \brief Pin Number for PA09 
*/
-#define PORT_PA09 (1ul <<  9) /**< \brief PORT Mask  for PA09 
*/
-#define PIN_PA10  10  /**< \brief Pin Number for PA10 
*/
-#define PORT_PA10 (1ul << 10) /**< \brief PORT Mask  for PA10 
*/
-#define PIN_PA11  11  /**< \brief Pin Number for PA11 
*/
-#define PORT_PA11 (1ul << 11) /**< \brief PORT Mask  for PA11 
*/
-#define PIN_PA14  14  /**< \brief Pin Number for PA14 
*/
-#define PORT_PA14 (1ul << 14) /**< \brief PORT Mask  for PA14 
*/
-#define PIN_PA15  15  /**< \brief Pin Number for PA15 
*/
-#define PORT_PA15 (1ul << 15) /**< \brief PORT Mask  for PA15 
*/
-#define PIN_PA16  16  /**< \brief Pin Number for PA16 
*/
-#define PORT_PA16 (1ul << 16) /**< \brief PORT Mask  for PA16 
*/

[60/70] [abbrv] incubator-mynewt-larva git commit: MYNEWT-187: make os task flags a byte since we only use 3 bits and we can save some space in the os_task_info structure

2016-03-03 Thread ccollins
MYNEWT-187: make os task flags a byte since we only use 3 bits and we can save 
some space in the os_task_info structure


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/5d97f537
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/5d97f537
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/5d97f537

Branch: refs/heads/master
Commit: 5d97f53745862e9c3df1fa7d28e6799d12a2defc
Parents: d204db2
Author: wes3 
Authored: Wed Mar 2 11:50:58 2016 -0800
Committer: wes3 
Committed: Wed Mar 2 11:57:29 2016 -0800

--
 libs/os/include/os/os_task.h | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/5d97f537/libs/os/include/os/os_task.h
--
diff --git a/libs/os/include/os/os_task.h b/libs/os/include/os/os_task.h
index 044368c..b4a16b1 100644
--- a/libs/os/include/os/os_task.h
+++ b/libs/os/include/os/os_task.h
@@ -28,10 +28,6 @@
 #define OS_TASK_PRI_HIGHEST (0)
 #define OS_TASK_PRI_LOWEST  (0xff)
 
-#ifndef OS_TASK_NAME_SIZE
-#define OS_TASK_NAME_SIZE (36) 
-#endif 
-
 /* 
  * Generic "object" structure. All objects that a task can wait on must
  * have a SLIST_HEAD(, os_task) head_name as the first element in the object 
@@ -50,9 +46,9 @@ typedef enum os_task_state {
 } os_task_state_t;
 
 /* Task flags */
-#define OS_TASK_FLAG_NO_TIMEOUT (0x0001U)
-#define OS_TASK_FLAG_SEM_WAIT   (0x0002U)
-#define OS_TASK_FLAG_MUTEX_WAIT (0x0004U)
+#define OS_TASK_FLAG_NO_TIMEOUT (0x01U)
+#define OS_TASK_FLAG_SEM_WAIT   (0x02U)
+#define OS_TASK_FLAG_MUTEX_WAIT (0x04U)
 
 typedef void (*os_task_func_t)(void *);
 
@@ -63,12 +59,12 @@ struct os_task {
 os_stack_t *t_stacktop;
 
 uint16_t t_stacksize;
-uint16_t t_flags;
+uint16_t t_pad;
 
 uint8_t t_taskid;
 uint8_t t_prio;
 uint8_t t_state;
-uint8_t t_pad;
+uint8_t t_flags;
 
 char *t_name;
 os_task_func_t t_func;
@@ -101,9 +97,7 @@ struct os_task_info {
 uint8_t oti_prio;
 uint8_t oti_taskid;
 uint8_t oti_state;
-uint8_t oti_pad1;
-uint8_t oti_pad2;
-uint16_t oti_flags;
+uint8_t oti_flags;
 uint16_t oti_stkusage;
 uint16_t oti_stksize;
 uint32_t oti_cswcnt;



[21/70] [abbrv] [partial] incubator-mynewt-larva git commit: Arduino zero BSP and Atmel MCU in a different repository.

2016-03-03 Thread ccollins
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/a280628a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/dsu.h
--
diff --git 
a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/dsu.h 
b/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/dsu.h
deleted file mode 100755
index fc7b5ec..000
--- a/hw/mcu/atmel/samd21xx/src/sam0/utils/cmsis/samd21/include/component/dsu.h
+++ /dev/null
@@ -1,554 +0,0 @@
-/**
- * \file
- *
- * \brief Component description for DSU
- *
- * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved.
- *
- * \asf_license_start
- *
- * \page License
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- *this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- *this list of conditions and the following disclaimer in the documentation
- *and/or other materials provided with the distribution.
- *
- * 3. The name of Atmel may not be used to endorse or promote products derived
- *from this software without specific prior written permission.
- *
- * 4. This software may only be redistributed and used in connection with an
- *Atmel microcontroller product.
- *
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- *
- * \asf_license_stop
- *
- */
-/*
- * Support and FAQ: visit http://www.atmel.com/design-support/;>Atmel 
Support
- */
-
-#ifndef _SAMD21_DSU_COMPONENT_
-#define _SAMD21_DSU_COMPONENT_
-
-/* == 
*/
-/**  SOFTWARE API DEFINITION FOR DSU */
-/* == 
*/
-/** \addtogroup SAMD21_DSU Device Service Unit */
-/*@{*/
-
-#define DSU_U2209
-#define REV_DSU 0x202
-
-/*  DSU_CTRL : (DSU Offset: 0x) ( /W  8) Control  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  SWRST:1;  /*!< bit:  0  Software Reset
 */
-uint8_t  :1;   /*!< bit:  1  Reserved  
 */
-uint8_t  CRC:1;/*!< bit:  2  32-bit Cyclic Redundancy 
Check */
-uint8_t  MBIST:1;  /*!< bit:  3  Memory Built-In Self-Test 
 */
-uint8_t  CE:1; /*!< bit:  4  Chip Erase
 */
-uint8_t  :3;   /*!< bit:  5.. 7  Reserved  
 */
-  } bit;   /*!< Structure used for bit  access 
 */
-  uint8_t reg; /*!< Type  used for register access 
 */
-} DSU_CTRL_Type;
-#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
-
-#define DSU_CTRL_OFFSET 0x   /**< \brief (DSU_CTRL offset) 
Control */
-#define DSU_CTRL_RESETVALUE 0x00ul   /**< \brief (DSU_CTRL 
reset_value) Control */
-
-#define DSU_CTRL_SWRST_Pos  0/**< \brief (DSU_CTRL) 
Software Reset */
-#define DSU_CTRL_SWRST  (0x1ul << DSU_CTRL_SWRST_Pos)
-#define DSU_CTRL_CRC_Pos2/**< \brief (DSU_CTRL) 32-bit 
Cyclic Redundancy Check */
-#define DSU_CTRL_CRC(0x1ul << DSU_CTRL_CRC_Pos)
-#define DSU_CTRL_MBIST_Pos  3/**< \brief (DSU_CTRL) Memory 
Built-In Self-Test */
-#define DSU_CTRL_MBIST  (0x1ul << DSU_CTRL_MBIST_Pos)
-#define DSU_CTRL_CE_Pos 4/**< \brief (DSU_CTRL) Chip 
Erase */
-#define DSU_CTRL_CE (0x1ul << DSU_CTRL_CE_Pos)
-#define DSU_CTRL_MASK   0x1Dul   /**< \brief (DSU_CTRL) MASK 
Register */
-
-/*  DSU_STATUSA : (DSU Offset: 0x0001) (R/W  8) Status A  */
-#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
-typedef union {
-  struct {
-uint8_t  DONE:1;   /*!< bit:  0  Done  
 */

incubator-mynewt-larva git commit: MYNEWT-95: fix whitelist enable/disable in the controller code.

2016-03-03 Thread wes3
Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/develop 8bc63a55b -> 8b94064d7


MYNEWT-95: fix whitelist enable/disable in the controller code.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/8b94064d
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/8b94064d
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/8b94064d

Branch: refs/heads/develop
Commit: 8b94064d7e45e7bc9336a8c25f3df6fdf96d553c
Parents: 8bc63a5
Author: wes3 
Authored: Thu Mar 3 16:32:59 2016 -0800
Committer: wes3 
Committed: Thu Mar 3 16:33:16 2016 -0800

--
 net/nimble/controller/src/ble_ll_adv.c  | 18 +++---
 net/nimble/controller/src/ble_ll_conn.c |  3 +++
 net/nimble/controller/src/ble_ll_scan.c | 17 +++--
 project/bletest/src/main.c  |  4 ++--
 4 files changed, 19 insertions(+), 23 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8b94064d/net/nimble/controller/src/ble_ll_adv.c
--
diff --git a/net/nimble/controller/src/ble_ll_adv.c 
b/net/nimble/controller/src/ble_ll_adv.c
index c8a3255..352cfb1 100644
--- a/net/nimble/controller/src/ble_ll_adv.c
+++ b/net/nimble/controller/src/ble_ll_adv.c
@@ -387,6 +387,13 @@ ble_ll_adv_tx_start_cb(struct ble_ll_sched_item *sch)
 STATS_INC(ble_ll_stats, adv_late_starts);
 }
 
+/* Enable/disable whitelisting based on filter policy */
+if (advsm->adv_filter_policy != BLE_HCI_ADV_FILT_NONE) {
+ble_ll_whitelist_enable();
+} else {
+ble_ll_whitelist_disable();
+}
+
 /* Set link layer state to advertising */
 ble_ll_state_set(BLE_LL_STATE_ADV);
 
@@ -587,9 +594,6 @@ ble_ll_adv_sm_stop(struct ble_ll_adv_sm *advsm)
 os_sr_t sr;
 
 if (advsm->enabled) {
-/* Disable whitelisting (just in case) */
-ble_ll_whitelist_disable();
-
 /* Remove any scheduled advertising items */
 ble_ll_sched_rmv_elem(>adv_sch);
 os_eventq_remove(_ble_ll_data.ll_evq, >adv_txdone_ev);
@@ -660,13 +664,6 @@ ble_ll_adv_sm_start(struct ble_ll_adv_sm *advsm)
 adv_chan = ble_ll_adv_first_chan(advsm);
 advsm->adv_chan = adv_chan;
 
-/* Enable/disable whitelisting based on filter policy */
-if (advsm->adv_filter_policy != BLE_HCI_ADV_FILT_NONE) {
-ble_ll_whitelist_enable();
-} else {
-ble_ll_whitelist_disable();
-}
-
 /* 
  * Schedule advertising. We set the initial schedule start and end
  * times to the earliest possible start/end.
@@ -1197,7 +1194,6 @@ ble_ll_adv_event_done(void *arg)
 if (advsm->adv_pdu_start_time >= advsm->adv_dir_hd_end_time) {
 /* Disable advertising */
 advsm->enabled = 0;
-ble_ll_whitelist_disable();
 ble_ll_conn_comp_event_send(NULL, BLE_ERR_DIR_ADV_TMO);
 ble_ll_scan_chk_resume();
 return;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8b94064d/net/nimble/controller/src/ble_ll_conn.c
--
diff --git a/net/nimble/controller/src/ble_ll_conn.c 
b/net/nimble/controller/src/ble_ll_conn.c
index 1d61c3d..36c63e3 100644
--- a/net/nimble/controller/src/ble_ll_conn.c
+++ b/net/nimble/controller/src/ble_ll_conn.c
@@ -789,6 +789,9 @@ ble_ll_conn_event_start_cb(struct ble_ll_sched_item *sch)
 g_ble_ll_conn_cur_sm = connsm;
 assert(connsm);
 
+/* Disable whitelisting as connections do not use it */
+ble_ll_whitelist_disable();
+
 /* Set LL state */
 ble_ll_state_set(BLE_LL_STATE_CONNECTION);
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8b94064d/net/nimble/controller/src/ble_ll_scan.c
--
diff --git a/net/nimble/controller/src/ble_ll_scan.c 
b/net/nimble/controller/src/ble_ll_scan.c
index 32aee48..1f6704f 100644
--- a/net/nimble/controller/src/ble_ll_scan.c
+++ b/net/nimble/controller/src/ble_ll_scan.c
@@ -502,6 +502,13 @@ ble_ll_scan_start(struct ble_ll_scan_sm *scansm, uint8_t 
chan)
 /* Start receiving */
 rc = ble_phy_rx();
 if (!rc) {
+/* Enable/disable whitelisting */
+if (scansm->scan_filt_policy & 1) {
+ble_ll_whitelist_enable();
+} else {
+ble_ll_whitelist_disable();
+}
+
 /* Set link layer state to scanning */
 if (scansm->scan_type == BLE_SCAN_TYPE_INITIATE) {
 ble_ll_state_set(BLE_LL_STATE_INITIATING);
@@ -590,9 +597,6 @@ ble_ll_scan_sm_stop(int chk_disable)
 /* Disable phy 

incubator-mynewt-larva git commit: Fix some version discrepencies in pkg.yml files.

2016-03-03 Thread ccollins
Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/develop 6660ec0ce -> 8bc63a55b


Fix some version discrepencies in pkg.yml files.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/8bc63a55
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/8bc63a55
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/8bc63a55

Branch: refs/heads/develop
Commit: 8bc63a55befe19933ac84f169058051f2cbdca7f
Parents: 6660ec0
Author: Christopher Collins 
Authored: Thu Mar 3 15:48:24 2016 -0800
Committer: Christopher Collins 
Committed: Thu Mar 3 15:48:24 2016 -0800

--
 hw/bsp/native/pkg.yml | 1 +
 hw/bsp/nrf51dk-16kbram/pkg.yml| 1 +
 hw/bsp/nrf51dk/pkg.yml| 1 +
 hw/bsp/nrf52pdk/pkg.yml   | 1 +
 hw/bsp/olimex_stm32-e407_devboard/pkg.yml | 1 +
 hw/hal/pkg.yml| 2 +-
 hw/mcu/native/pkg.yml | 1 +
 hw/mcu/nordic/nrf51xxx/pkg.yml| 1 +
 hw/mcu/nordic/nrf52xxx/pkg.yml| 1 +
 hw/mcu/stm/stm32f4xx/pkg.yml  | 1 +
 libs/baselibc/pkg.yml | 2 +-
 libs/flash_test/pkg.yml   | 2 +-
 libs/imgmgr/pkg.yml   | 1 +
 13 files changed, 13 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8bc63a55/hw/bsp/native/pkg.yml
--
diff --git a/hw/bsp/native/pkg.yml b/hw/bsp/native/pkg.yml
index e1d5a19..8267691 100644
--- a/hw/bsp/native/pkg.yml
+++ b/hw/bsp/native/pkg.yml
@@ -18,6 +18,7 @@
 #
 
 pkg.name: hw/bsp/native
+pkg.vers: 0.8.0
 pkg.description: BSP definition for native (amd64) applications.
 pkg.author: Christopher Collins 
 pkg.homepage:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8bc63a55/hw/bsp/nrf51dk-16kbram/pkg.yml
--
diff --git a/hw/bsp/nrf51dk-16kbram/pkg.yml b/hw/bsp/nrf51dk-16kbram/pkg.yml
index 9bfb7bf..ca82ca5 100644
--- a/hw/bsp/nrf51dk-16kbram/pkg.yml
+++ b/hw/bsp/nrf51dk-16kbram/pkg.yml
@@ -18,6 +18,7 @@
 #
 
 pkg.name: hw/bsp/nrf51dk-16kbram
+pkg.vers: 0.8.0
 pkg.description: BSP definition for a Nordic nRF51 DK SoC with 16kB RAM.
 pkg.author: Christopher Collins 
 pkg.homepage:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8bc63a55/hw/bsp/nrf51dk/pkg.yml
--
diff --git a/hw/bsp/nrf51dk/pkg.yml b/hw/bsp/nrf51dk/pkg.yml
index 11b98ba..94cd052 100644
--- a/hw/bsp/nrf51dk/pkg.yml
+++ b/hw/bsp/nrf51dk/pkg.yml
@@ -18,6 +18,7 @@
 #
 
 pkg.name: hw/bsp/nrf51dk
+pkg.vers: 0.8.0
 pkg.description: BSP definition for the Nordic nRF51 DK SoC.
 pkg.author: wes3 
 pkg.homepage:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8bc63a55/hw/bsp/nrf52pdk/pkg.yml
--
diff --git a/hw/bsp/nrf52pdk/pkg.yml b/hw/bsp/nrf52pdk/pkg.yml
index e97e7fb..06e12f9 100644
--- a/hw/bsp/nrf52pdk/pkg.yml
+++ b/hw/bsp/nrf52pdk/pkg.yml
@@ -18,6 +18,7 @@
 #
 
 pkg.name: hw/bsp/nrf52pdk
+pkg.vers: 0.8.0
 pkg.description: BSP definition for the Nordic nRF52 Preview DK SoC.
 pkg.author: wes3 
 pkg.homepage:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8bc63a55/hw/bsp/olimex_stm32-e407_devboard/pkg.yml
--
diff --git a/hw/bsp/olimex_stm32-e407_devboard/pkg.yml 
b/hw/bsp/olimex_stm32-e407_devboard/pkg.yml
index c6e3fc0..9aa47bf 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/pkg.yml
+++ b/hw/bsp/olimex_stm32-e407_devboard/pkg.yml
@@ -18,6 +18,7 @@
 #
 
 pkg.name: hw/bsp/olimex_stm32-e407_devboard
+pkg.vers: 0.8.0
 pkg.description: BSP definition for the Olimex STM32-E407 board.
 pkg.author: Sterling Hughes 
 pkg.homepage:

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/8bc63a55/hw/hal/pkg.yml
--
diff --git a/hw/hal/pkg.yml b/hw/hal/pkg.yml
index 9feba52..f7ba490 100644
--- a/hw/hal/pkg.yml
+++ b/hw/hal/pkg.yml
@@ -18,13 +18,13 @@
 #
 
 pkg.name: hw/hal
+pkg.vers: 0.8.0
 pkg.description: Hardware Abstraction Layer.
 pkg.author: wes3 
 pkg.homepage:
 pkg.repository: https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva
 pkg.keywords:
 
-pkg.vers: 0.8.0
 pkg.deps: libs/os
 pkg.deps.NFFS:
 - fs/nffs


incubator-mynewt-larva git commit: Some changes to make doc examples clearer.

2016-03-03 Thread ccollins
Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/develop 9ad54b8d7 -> 6660ec0ce


Some changes to make doc examples clearer.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/6660ec0c
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/6660ec0c
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/6660ec0c

Branch: refs/heads/develop
Commit: 6660ec0ce2c81f6385298f173c1d60395b2958bb
Parents: 9ad54b8
Author: Christopher Collins 
Authored: Wed Mar 2 12:13:25 2016 -0800
Committer: Christopher Collins 
Committed: Thu Mar 3 15:28:02 2016 -0800

--
 fs/fs/include/fs/fs.h   | 28 ++--
 fs/nffs/include/nffs/nffs.h |  2 --
 fs/nffs/pkg.yml |  4 ++--
 fs/nffs/src/nffs.c  | 37 -
 fs/nffs/src/nffs_block.c|  4 ++--
 fs/nffs/src/nffs_file.c |  4 ++--
 fs/nffs/src/nffs_flash.c| 10 +-
 fs/nffs/src/nffs_inode.c|  2 +-
 fs/nffs/src/nffs_misc.c | 12 
 fs/nffs/src/nffs_priv.h |  1 +
 fs/nffs/src/nffs_restore.c  |  2 +-
 project/slinky/pkg.yml  |  5 +++--
 project/slinky/src/main.c   |  9 +
 13 files changed, 64 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/fs/include/fs/fs.h
--
diff --git a/fs/fs/include/fs/fs.h b/fs/fs/include/fs/fs.h
index f304d88..e29f7f3 100644
--- a/fs/fs/include/fs/fs.h
+++ b/fs/fs/include/fs/fs.h
@@ -60,19 +60,19 @@ int fs_dirent_is_dir(const struct fs_dirent *);
 /*
  * File access return codes.
  */
-#define FS_EOK  0   /* OK */
-#define FS_ECORRUPT 1   /* Filesystem corrupt */
-#define FS_EHW  2   /* Error access storage medium */
-#define FS_ERANGE   3
-#define FS_EINVAL   4
-#define FS_ENOMEM   5   /* out of memory */
-#define FS_ENOENT   6   /* no such file */
-#define FS_EEMPTY   7
-#define FS_EFULL8
-#define FS_EUNEXP   9
-#define FS_EOS  10
-#define FS_EEXIST   11
-#define FS_EACCESS  12
-#define FS_EUNINIT  13
+#define FS_EOK  0  /* Success */
+#define FS_ECORRUPT 1  /* File system corrupt */
+#define FS_EHW  2  /* Error accessing storage medium */
+#define FS_EOFFSET  3  /* Invalid offset */
+#define FS_EINVAL   4  /* Invalid argument */
+#define FS_ENOMEM   5  /* Insufficient memory */
+#define FS_ENOENT   6  /* No such file or directory */
+#define FS_EEMPTY   7  /* Specified region is empty (internal only) */
+#define FS_EFULL8  /* Disk full */
+#define FS_EUNEXP   9  /* Disk contains unexpected metadata */
+#define FS_EOS  10  /* OS error */
+#define FS_EEXIST   11  /* File or directory already exists */
+#define FS_EACCESS  12  /* Operation prohibited by file open mode */
+#define FS_EUNINIT  13  /* File system not initialized */
 
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/nffs/include/nffs/nffs.h
--
diff --git a/fs/nffs/include/nffs/nffs.h b/fs/nffs/include/nffs/nffs.h
index 41519bd..73a0ec1 100644
--- a/fs/nffs/include/nffs/nffs.h
+++ b/fs/nffs/include/nffs/nffs.h
@@ -57,7 +57,5 @@ struct nffs_area_desc {
 int nffs_init(void);
 int nffs_detect(const struct nffs_area_desc *area_descs);
 int nffs_format(const struct nffs_area_desc *area_descs);
-int nffs_ready(void);
-
 
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/nffs/pkg.yml
--
diff --git a/fs/nffs/pkg.yml b/fs/nffs/pkg.yml
index 3866598..d1878ac 100644
--- a/fs/nffs/pkg.yml
+++ b/fs/nffs/pkg.yml
@@ -30,8 +30,8 @@ pkg.keywords:
 
 pkg.identities: NFFS
 pkg.deps:
-- sys/log
 - fs/fs
+- hw/hal
 - libs/os
 - libs/testutil
-- hw/hal
+- sys/log

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6660ec0c/fs/nffs/src/nffs.c
--
diff --git a/fs/nffs/src/nffs.c b/fs/nffs/src/nffs.c
index ede074b..c90c4ef 100644
--- a/fs/nffs/src/nffs.c
+++ b/fs/nffs/src/nffs.c
@@ -146,7 +146,7 @@ nffs_open(const char *path, uint8_t access_flags, struct 
fs_file **out_fs_file)
 
 nffs_lock();
 
-if (!nffs_ready()) {
+if (!nffs_misc_ready()) {
 rc = FS_EUNINIT;
 goto done;
 }
@@ -257,8 +257,7 @@ 

incubator-mynewt-newt git commit: Trim spaces from elements during target import.

2016-03-03 Thread ccollins
Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 4e0c7dc4d -> 487dce611


Trim spaces from elements during target import.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/487dce61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/487dce61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/487dce61

Branch: refs/heads/develop
Commit: 487dce61108ee50b1ce7e87eac2df92712292c3c
Parents: 4e0c7dc
Author: Christopher Collins 
Authored: Thu Mar 3 15:24:58 2016 -0800
Committer: Christopher Collins 
Committed: Thu Mar 3 15:25:12 2016 -0800

--
 newt/cli/target.go | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/487dce61/newt/cli/target.go
--
diff --git a/newt/cli/target.go b/newt/cli/target.go
index d5f006b..05fa74e 100644
--- a/newt/cli/target.go
+++ b/newt/cli/target.go
@@ -218,6 +218,8 @@ func ImportTargets(repo *Repo, name string, importAll bool, 
fp *os.File) error {
break
} else {
elements := strings.SplitN(line, "=", 2)
+   elements[0] = strings.TrimSpace(elements[0])
+   elements[1] = strings.TrimSpace(elements[1])
// name is elements[0], and value is elements[1]
 
if importAll || elements[1] == name {



incubator-mynewt-larva git commit: This closes #8. I also committed a very minor change with this as something went wrong when I tried to amend the commit. All I did was remove the initialization of t

2016-03-03 Thread wes3
Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/develop f4c430c48 -> 9ad54b8d7


This closes #8. I also committed a very minor change with this as something 
went wrong when I tried to amend the commit. All I did was remove the 
initialization of the global variable os_time to 0


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/9ad54b8d
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/9ad54b8d
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/9ad54b8d

Branch: refs/heads/develop
Commit: 9ad54b8d7f6fef1cff43760fc89a8a33ef73af89
Parents: f4c430c
Author: wes3 
Authored: Thu Mar 3 15:11:55 2016 -0800
Committer: wes3 
Committed: Thu Mar 3 15:11:55 2016 -0800

--
 libs/os/src/os_time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/9ad54b8d/libs/os/src/os_time.c
--
diff --git a/libs/os/src/os_time.c b/libs/os/src/os_time.c
index 28aaced..1b703e0 100644
--- a/libs/os/src/os_time.c
+++ b/libs/os/src/os_time.c
@@ -22,7 +22,7 @@
 
 #define OS_USEC_PER_TICK(100 / OS_TICKS_PER_SEC)
 
-os_time_t g_os_time = 0;
+os_time_t g_os_time;
 
 /*
  * Time-of-day collateral.



[GitHub] incubator-mynewt-site pull request: File system documentation.

2016-03-03 Thread ccollins476ad
GitHub user ccollins476ad opened a pull request:

https://github.com/apache/incubator-mynewt-site/pull/27

File system documentation.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ccollins476ad/incubator-mynewt-site master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-mynewt-site/pull/27.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #27


commit ea47c5b69bb5d160fe3d1ae012b6b43d3b2b4dc2
Author: Christopher Collins 
Date:   2016-03-03T01:01:54Z

File system documentation.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[2/2] incubator-mynewt-larva git commit: MYNEWT-4: Need the concept of wallclock time

2016-03-03 Thread wes3
MYNEWT-4: Need the concept of wallclock time

Add shell command "date" to set and get wallclock time.

The wallclock time is specified as per RFC 3339. For example:

date 2016-03-02T22:44:00# set time to Mar 2 2016 10:44 PM UTC
date 2016-03-02T22:44:00Z   # with explicit Zulu time zone (UTC + 0)
date 2016-03-02T22:44:00z   # with explicit Zulu time zone (UTC + 0)
date 2016-03-02T22:44:00-08:00  # pacific standard time (UTC - 0800)
date 2016-03-02T22:44:00+05:30  # indian standard time (UTC + 0530)
date 2016-03-02T22:44:00.31 # time is 22:44:00 + 31 usec
date 2016-03-02T22:44:00.1  # time is 22:44:00 + 100 msec
date 2016-03-02T22:44:00.013# time is 22:44:00 + 13 msec

'os_settimeofday()' and 'os_gettimeofday()' can be used to set and get
the time of day.

'parse_datetime()' and 'format_datetime()' are available to parse and
format the RFC 3339 compliant datetime strings.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/70511652
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/70511652
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/70511652

Branch: refs/heads/develop
Commit: 7051165241fd498e6024f800344de1b420330a7f
Parents: 4e2c53c
Author: neel 
Authored: Wed Mar 2 23:01:16 2016 -0800
Committer: wes3 
Committed: Thu Mar 3 14:48:59 2016 -0800

--
 LICENSE   |   5 +
 libs/os/include/os/os_time.h  |  65 +
 libs/os/src/os_time.c |  80 +++
 libs/shell/src/shell.c|   9 +
 libs/shell/src/shell_os.c |  35 +++
 libs/shell/src/shell_priv.h   |   1 +
 libs/util/include/util/datetime.h |  50 
 libs/util/src/datetime.c  | 420 +
 8 files changed, 665 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/70511652/LICENSE
--
diff --git a/LICENSE b/LICENSE
index 8f71f43..0c99734 100644
--- a/LICENSE
+++ b/LICENSE
@@ -200,3 +200,8 @@
See the License for the specific language governing permissions and
limitations under the License.
 
+
+This product partly derives from FreeBSD, which is available under the
+"3-clause BSD" license.  For details, see:
+* libs/os/include/os/os_time.h
+* libs/util/src/datetime.c

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/70511652/libs/os/include/os/os_time.h
--
diff --git a/libs/os/include/os/os_time.h b/libs/os/include/os/os_time.h
index b3c95b3..d3cb028 100644
--- a/libs/os/include/os/os_time.h
+++ b/libs/os/include/os/os_time.h
@@ -17,6 +17,38 @@
  * under the License.
  */
 
+/*-
+ * Copyright (c) 1982, 1986, 1993
+ *  The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *  @(#)time.h  8.5 (Berkeley) 5/4/95
+ * $FreeBSD$
+ */
+
 #ifndef _OS_TIME_H
 #define _OS_TIME_H
 
@@ -39,4 +71,37 @@ void os_time_delay(int32_t osticks);
 #define OS_TIME_TICK_GT(__t1, __t2) ((int32_t) ((__t1) - (__t2)) > 0)
 #define OS_TIME_TICK_GEQ(__t1, __t2) ((int32_t) ((__t1) - (__t2)) >= 0)
 
+struct os_timeval {
+

[GitHub] incubator-mynewt-site pull request: Mynewt 178

2016-03-03 Thread paulfdietrich
GitHub user paulfdietrich opened a pull request:

https://github.com/apache/incubator-mynewt-site/pull/26

Mynewt 178

Documentation for porting to a new BSP, CPU and MCU.  When doing this it 
highlight the difficulties one might find.  I filed a few tickets to try to 
resolve this soon.  

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/paulfdietrich/incubator-mynewt-site MYNEWT-178

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-mynewt-site/pull/26.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #26


commit 652a89dc3f7ce06ac62d1d3a50938c38dc75b006
Author: Paul Dietrich 
Date:   2016-03-01T21:54:05Z

basic changes to support structure for porting sections

commit 8b5b99dfdf36f8bcdf367969f59c25dfdaa178ef
Author: Paul Dietrich 
Date:   2016-03-01T21:58:19Z

fixed a type in the file which caused mkdocs build error

commit 5f20995b8dc1cb7c7ee3facf132e870690b5bad8
Author: Paul Dietrich 
Date:   2016-03-03T20:29:19Z

documents for porting to new platform

commit ef1a1a0340576b3aca9a4f4e88da77654e6e0368
Author: Paul Dietrich 
Date:   2016-03-03T20:30:25Z

fix a few typos

commit 6c3d803966b05d234b9e3cba080cd7ceab67d934
Author: Paul Dietrich 
Date:   2016-03-03T20:44:31Z

fix broken link to HAL section since it moved




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-mynewt-site git commit: removed legacy terms from console overview. Also closed pull request #23.

2016-03-03 Thread aditi
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/asf-site 5491806fd -> a993b8370


removed legacy terms from console overview. Also closed pull request #23.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/a993b837
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/a993b837
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/a993b837

Branch: refs/heads/asf-site
Commit: a993b837089dc2c0010d6f547438f32615997097
Parents: 5491806
Author: aditihilbert 
Authored: Thu Mar 3 12:28:50 2016 -0800
Committer: aditihilbert 
Committed: Thu Mar 3 12:28:50 2016 -0800

--
 mkdocs/search_index.json  |  4 ++--
 os/modules/console/console/index.html | 22 +++---
 sitemap.xml   | 16 
 3 files changed, 21 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/a993b837/mkdocs/search_index.json
--
diff --git a/mkdocs/search_index.json b/mkdocs/search_index.json
index 632825b..f09e531 100644
--- a/mkdocs/search_index.json
+++ b/mkdocs/search_index.json
@@ -2827,7 +2827,7 @@
 }, 
 {
 "location": "/os/modules/console/console/", 
-"text": "Console\n\n\nThe console is an operating system window 
where users interact with system programs of the operating system or a console 
application by entering text input (typically from a keyboard) and reading text 
output (typically on the computer terminal or monitor). The text written on the 
console brings some information and is a sequence of characters sent by the OS 
or programs running on the OS. \n\n\nSupport is currently available for console 
access via the serial port on the hardware board.\n\n\nDescription\n\n\nIn the 
Mynewt OS, the console library comes in two versions:\n\n\n\n\nfull - 
containing the full implementation\n\n\nstub - containing stubs for the 
API\n\n\n\n\nBoth of these have \negg.yml\n file which states that they provide 
the \nconsole\n API. If an egg uses this API, it should list \nconsole\n as a 
requirement.\nFor example, the shell egg is defined by the following egg.yml 
file:\n\n\negg.name: libs/shell \negg.vers: 0.1\negg.de
 ps:\n- libs/os\n- libs/util\negg.reqs:\n- 
console\negg.identities:\n- SHELL \n\n\n\n\nThe project .yml file 
decides which version of the console egg should be included. \nIf project 
requires the full console capability it lists dependency \nlibs/console/full\n 
in its egg.yml file. On the other hand, a project may not have a physical 
console (e.g. a UART port to connect a terminal to) but may have a dependency 
on an egg that has console capability. In that case you would use a console 
stub. \n\n\nAnother example would be the bootloader project where we want to 
keep the size of the image small. It includes the \nlibs/os\n egg that can 
print out messages on a console (e.g. if there is a hard fault) and the 
\nlibs/util\n egg that uses full console (but only if SHELL is present to 
provide a CLI). However, we do not want to use any console I/O capability in 
this particular bootloader project to keep the size small. We simply use the 
console stub ins
 tead, and the egg.yml file for the project boot egg looks like the 
following:\n\n\nproject.name: boot\nproject.identities: bootloader\n
project.eggs:\n- libs/os\n- libs/bootutil\n- 
libs/nffs\n- libs/console/stub\n- libs/util \n\n\n\n\nConsole 
has 2 modes for transmit; \nblocking mode\n and \nnon-blocking mode\n. Usually 
the \nnon-blocking mode\n is the active one; the output buffer is drained by 
getting TX completion interrupts from hardware, and more data is added based on 
these interrupts.\n\nBlocking mode\n is used when we don't want TX completion 
interrupts. It is used when system crashes, and we still want to output info 
related to that crash.\n\n\nConsole, by default, echoes everything it receives 
back. Terminal programs expect this, and is a way for the user to know that the 
console is connected and responsive. Whether echoing happens or not can be 
controlled programmatically.\n\n\nData structures\n\n\nN/A\n\n\nList of Functi
 ons\n\n\nThe functions available in console 
are:\n\n\n\n\nconsole_blocking_mode\n\n\nconsole_echo\n\n\nconsole_init\n\n\nconsole_is_init\n\n\nconsole_printf\n\n\nconsole_read\n\n\nconsole_write",
 
+"text": "Console\n\n\nThe console is an operating system window 
where users interact with system programs of the operating system or a console 
application by entering text input 

[GitHub] incubator-mynewt-site pull request: Changes to Vocabulary.md

2016-03-03 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-mynewt-site/pull/23


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


incubator-mynewt-site git commit: cleaned up console.md. This closes #23.

2016-03-03 Thread aditi
Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/master 9b209aebf -> a0cbe909e


cleaned up console.md. This closes #23.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/a0cbe909
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/a0cbe909
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/a0cbe909

Branch: refs/heads/master
Commit: a0cbe909edc2f06f012f76dcadc211e19e31e32e
Parents: 9b209ae
Author: aditihilbert 
Authored: Thu Mar 3 12:24:32 2016 -0800
Committer: aditihilbert 
Committed: Thu Mar 3 12:24:32 2016 -0800

--
 docs/os/modules/console/console.md | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/a0cbe909/docs/os/modules/console/console.md
--
diff --git a/docs/os/modules/console/console.md 
b/docs/os/modules/console/console.md
index 79dac04..a38afb3 100644
--- a/docs/os/modules/console/console.md
+++ b/docs/os/modules/console/console.md
@@ -13,28 +13,28 @@ In the Mynewt OS, the console library comes in two versions:
 * full - containing the full implementation
 * stub - containing stubs for the API
 
-Both of these have `egg.yml` file which states that they provide the `console` 
API. If an egg uses this API, it should list `console` as a requirement.
-For example, the shell egg is defined by the following egg.yml file:
+Both of these have `pkg.yml` file which states that they provide the `console` 
API. If a pkg uses this API, it should list `console` as a requirement.
+For example, the shell pkg is defined by the following pkg.yml file:
 ```no-highlight
-egg.name: libs/shell 
-egg.vers: 0.1
-egg.deps:
+pkg.name: libs/shell 
+pkg.vers: 0.1
+pkg.deps:
 - libs/os
 - libs/util
-egg.reqs:
+pkg.reqs:
 - console
-egg.identities:
+pkg.identities:
 - SHELL 
 ```
-The project .yml file decides which version of the console egg should be 
included. 
-If project requires the full console capability it lists dependency 
`libs/console/full` in its egg.yml file. On the other hand, a project may not 
have a physical console (e.g. a UART port to connect a terminal to) but may 
have a dependency on an egg that has console capability. In that case you would 
use a console stub. 
+The project .yml file decides which version of the console pkg should be 
included. 
+If project requires the full console capability it lists dependency 
`libs/console/full` in its pkg.yml file. On the other hand, a project may not 
have a physical console (e.g. a UART port to connect a terminal to) but may 
have a dependency on a pkg that has console capability. In that case you would 
use a console stub. 
 
 
-Another example would be the bootloader project where we want to keep the size 
of the image small. It includes the `libs/os` egg that can print out messages 
on a console (e.g. if there is a hard fault) and the `libs/util` egg that uses 
full console (but only if SHELL is present to provide a CLI). However, we do 
not want to use any console I/O capability in this particular bootloader 
project to keep the size small. We simply use the console stub instead, and the 
egg.yml file for the project boot egg looks like the following:
+Another example would be the bootloader project where we want to keep the size 
of the image small. It includes the `libs/os` pkg that can print out messages 
on a console (e.g. if there is a hard fault) and the `libs/util` pkg that uses 
full console (but only if SHELL is present to provide a CLI). However, we do 
not want to use any console I/O capability in this particular bootloader 
project to keep the size small. We simply use the console stub instead, and the 
pkg.yml file for the project boot pkg looks like the following:
 ```no-highlight
 project.name: boot
 project.identities: bootloader
-project.eggs:
+project.pkgs:
 - libs/os
 - libs/bootutil
 - libs/nffs



incubator-mynewt-larva git commit: Update pkg-list with the latest.

2016-03-03 Thread marko
Repository: incubator-mynewt-larva
Updated Branches:
  refs/heads/develop 4934f2e60 -> 4e2c53c53


Update pkg-list with the latest.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/4e2c53c5
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/4e2c53c5
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/4e2c53c5

Branch: refs/heads/develop
Commit: 4e2c53c538c1483b4fa42307e90e6f00e3bc245c
Parents: 4934f2e
Author: Marko Kiiskila 
Authored: Thu Mar 3 11:42:45 2016 -0800
Committer: Marko Kiiskila 
Committed: Thu Mar 3 11:42:45 2016 -0800

--
 pkg-list.yml | 442 --
 1 file changed, 263 insertions(+), 179 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/4e2c53c5/pkg-list.yml
--
diff --git a/pkg-list.yml b/pkg-list.yml
index aa81016..3edb569 100644
--- a/pkg-list.yml
+++ b/pkg-list.yml
@@ -20,281 +20,365 @@
 name: larva
 url: https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva
 pkgs:
-sys/config:
-vers: 0.1.0
-hash: 8a2318901967e44df05e68d6f03eba91d8491e8a
+bletest:
+vers: 0.8.0
+hash: 325d6ff98eb71341c4f3e47bce3c37a74ea819b4
 deps:
+- net/nimble/controller@none#stable
+- net/nimble/host@none#stable
 - libs/os@none#stable
 - libs/console/full@none#stable
+- libs/baselibc@none#stable
 - libs/shell@none#stable
-- libs/newtmgr@none#stable
 - libs/imgmgr@none#stable
+- libs/newtmgr@none#stable
 - sys/config@none#stable
 - sys/log@none#stable
 - sys/stats@none#stable
-sys/log:
-vers: 0.1.0
-hash: 2b358d4461786c92bf492807743ceee463d34fef
+libs/console/stub:
+vers: 0.8.0
+hash: d41aedc5941495ca9320cc013f68ee73d4e349ab
+caps:
+- console@none#stable
+libs/os:
+vers: 0.8.0
+hash: 999a3419d9959d3c39b11dcc67d79c7888b4b765
 deps:
-- libs/os@none#stable
-- libs/util@none#stable
 - libs/testutil@none#stable
-project/bin2img:
-vers: 0.1.0
-hash: 25a2173d8a47cf031933e19e54bb165b5de3a04c
-deps:
-- libs/bootutil@none#stable
-- libs/console/stub@none#stable
-libs/imgmgr:
-vers: 0.1.0
-hash: 529d9416d46d4c907a6a7e0e4fde61754aff275e
+req_caps:
+- console@none#stable
+project/blinky:
+vers: 0.8.0
+hash: 8be3527ec83fad088e4d9bf87eb0ecaf35842900
 deps:
+- libs/console/full@none#stable
 - libs/newtmgr@none#stable
-- libs/bootutil@none#stable
-net/nimble/drivers/nrf51:
-vers: 0.1.0
-hash: 3f1b843ccf32a16519cf22b04c67fd38ffef86bc
-deps:
-- net/nimble@none#stable
-- net/nimble/controller@none#stable
-caps:
-- ble_driver@none#stable
-hw/mcu/stm/stm32f4xx:
-vers: 0.0.0
-hash: 3198e51a11fb5dce063d4f2edb07960a2f3e4080
+- libs/os@none#stable
+- libs/shell@none#stable
+- sys/config@none#stable
+- sys/log@none#stable
+- sys/stats@none#stable
+project/boot:
+vers: 0.8.0
+hash: 3a38b2fcb865c466060cd3354b1b8b10b68b24c2
 deps:
-- hw/hal@none#stable
-- libs/cmsis-core@none#stable
-- compiler/arm-none-eabi-m4@none#stable
+- fs/nffs@none#stable
+- libs/baselibc@none#stable
+- libs/bootutil@none#stable
+- libs/console/stub@none#stable
+- libs/mbedtls@none#stable
+- libs/os@none#stable
+- libs/util@none#stable
 net/nimble/drivers/native:
-vers: 0.1.0
-hash: 6fca9ed4ea5ddb41058ab84885534b0ad784ad6f
+vers: 0.8.0
+hash: 513cc71e129320e3e2d80a9cdfc748db6c83fbb4
 deps:
 - net/nimble/controller@none#stable
 caps:
 - ble_driver@none#stable
-hw/mcu/nordic/nrf52xxx:
-vers: 0.0.0
-hash: 9c4508f4a14f03ca0103f53693e63956aa527b68
-deps:
-- hw/hal@none#stable
-- libs/cmsis-core@none#stable
-- compiler/arm-none-eabi-m4@none#stable
-net/nimble:
-vers: 0.1.0
-hash: 8977b8da604d9779d51baf4aacabef5af2771bf7
-deps:
-- libs/os@none#stable
-hw/bsp/olimex_stm32-e407_devboard:
-vers: 0.0.0
-hash: c0b075092ddd4a817825ff54d3b75452e83c1ac1
-