spinel-protocol: Section reorganization, added GPIO cmds (#1015)

Also added `CAP_WRITABLE_RAW_STREAM`, to indicate that the
raw stream is writable.
This commit is contained in:
Robert Quattlebaum
2016-11-28 18:07:03 -08:00
committed by Jonathan Hui
parent 76201e7610
commit bd531379a7
6 changed files with 2162 additions and 1877 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -312,8 +312,26 @@ is meaningless.
{{spinel-status-codes.md}}
{{spinel-tech-thread.md}}
{{spinel-feature-network-save.md}}
{{spinel-feature-host-buffer-offload.md}}
{{spinel-feature-jam-detect.md}}
{{spinel-feature-gpio.md}}
{{spinel-security-considerations.md}}
{backmatter}
{{spinel-framing.md}}
{{spinel-test-vectors.md}}
{{spinel-example-sessions.md}}
# Acknowledgments #
Special thanks to Abtin Keshavarzian, Martin Turon, Arjuna Sivasithambaresan
@@ -328,22 +346,6 @@ to this document.
This document was prepared using [mmark](https://github.com/miekg/mmark)
by (Miek Gieben) and [xml2rfc (version 2)](http://xml2rfc.ietf.org/).
{backmatter}
{{spinel-framing.md}}
{{spinel-feature-network-save.md}}
{{spinel-feature-host-buffer-offload.md}}
{{spinel-feature-jam-detect.md}}
{{spinel-tech-thread.md}}
{{spinel-test-vectors.md}}
{{spinel-example-sessions.md}}
# Glossary #
<!-- RQ -- Alphabetize before finalization. -->
@@ -0,0 +1,47 @@
# Feature: Basic GPIO Access
The length of the data associated with these properties depends on the
number of GPIOs. If you have 10 GPIOs, you'd have two bytes. You determine
the number of GPIOs available by examining PROP_GPIO_AVAILABLE, described
below. This API isn't intended to support every possible GPIO state, it is
intended for basic reading and writing.
## Properties
### PROP 4096: PROP_GPIO_AVAILABLE
* Type: Read-only
Contains a bit field identifying which GPIOs are supported. Cleared bits
are not supported. Set bits are supported.
### PROP 4097: PROP_GPIO_DIRECTION
* Type: Read-only (Optionally read/write)
Contains a bit field identifying which GPIOs are configured as outputs.
Cleared bits are inputs. Set bits are outputs.
### PROP 4098: PROP_GPIO_STATE
* Type: Read-Write
Contains a bit field identifying the state of the GPIOs. For GPIOs
configured as inputs, this is the read logic level. For GPIOs configured
as outputs, this is the logic level of the output.
### PROP 4099: PROP_GPIO_STATE_SET
* Type: Write-only
Allows for the state of various output GPIOs to be set without affecting
other GPIO states. Contains a bit field identifying the output GPIOs that
should have their state set to 1.
### PROP 4100: PROP_GPIO_STATE_CLEAR
* Type: Write-only
Allows for the state of various output GPIOs to be cleared without affecting
other GPIO states. Contains a bit field identifying the output GPIOs that
should have their state cleared to 0.
+8 -2
View File
@@ -130,6 +130,7 @@ Currently defined values are:
* 5: `CAP_COUNTERS`
* 6: `CAP_JAM_DETECT`: Jamming detection. See (#feature-jam-detect)
* 7: `CAP_PEEK_POKE`: PEEK/POKE debugging commands.
* 8: `CAP_WRITABLE_RAW_STREAM`: `PROP_STREAM_RAW` is writable.
* 16: `CAP_802_15_4_2003`
* 17: `CAP_802_15_4_2006`
* 18: `CAP_802_15_4_2011`
@@ -273,8 +274,13 @@ fetch the value of this property. To receive traffic, you wait for
`CMD_PROP_VALUE_IS` commands with this property id from the NCP.
Implementations may OPTIONALLY support the ability to transmit arbitrary
raw packets. If this capability is supported, you may call `CMD_PROP_VALUE_SET`
on this property with the value of the raw packet.
raw packets. Support for this feature is indicated by the presence of the
`CAP_WRITABLE_RAW_STREAM` capability.
If the capability `CAP_WRITABLE_RAW_STREAM` is set, then packets written
to this stream with `CMD_PROP_VALUE_SET` will be sent out over the radio.
This allows the caller to use the radio directly, with the stack being
implemented on the host instead of the NCP.
#### Frame Metadata Format {#frame-metadata-format}
+54
View File
@@ -291,6 +291,8 @@ enum
SPINEL_CAP_PEEK_POKE = 7,
SPINEL_CAP_WRITABLE_RAW_STREAM = 8,
SPINEL_CAP_802_15_4__BEGIN = 16,
SPINEL_CAP_802_15_4_2003 = (SPINEL_CAP_802_15_4__BEGIN + 0),
SPINEL_CAP_802_15_4_2006 = (SPINEL_CAP_802_15_4__BEGIN + 1),
@@ -346,6 +348,58 @@ typedef enum
SPINEL_PROP_HBO_MEM_MAX = 10, ///< Max offload mem [S]
SPINEL_PROP_HBO_BLOCK_MAX = 11, ///< Max offload block [S]
SPINEL_PROP_BASE_EXT__BEGIN = 0x1000,
/// Available GPIO Bitmask
/** Format: `D`
* Type: Read-Only
*
* Contains a bit field identifying which GPIOs are supported. Cleared bits
* are not supported. Set bits are supported.
*/
SPINEL_PROP_GPIO_AVAILABLE = SPINEL_PROP_BASE_EXT__BEGIN + 0,
/// GPIO Direction Bitmask
/** Format: `D`
* Type: Read-only (Optionally read/write)
*
* Contains a bit field identifying which GPIOs are configured as outputs.
* Cleared bits are inputs. Set bits are outputs.
*/
SPINEL_PROP_GPIO_DIRECTION = SPINEL_PROP_BASE_EXT__BEGIN + 1,
/// GPIO State Bitmask
/** Format: `D`
* Type: Read-Write
*
* Contains a bit field identifying the state of the GPIOs. For GPIOs
* configured as inputs, this is the read logic level. For GPIOs configured
* as outputs, this is the logic level of the output.
*/
SPINEL_PROP_GPIO_STATE = SPINEL_PROP_BASE_EXT__BEGIN + 2,
/// GPIO State Set-Only Bitmask
/** Format: `D`
* Type: Write-Only
*
* Allows for the state of various output GPIOs to be set without affecting
* other GPIO states. Contains a bit field identifying the output GPIOs that
* should have their state set to 1.
*/
SPINEL_PROP_GPIO_STATE_SET = SPINEL_PROP_BASE_EXT__BEGIN + 3,
/// GPIO State Clear-Only Bitmask
/** Format: `D`
* Type: Write-Only
*
* Allows for the state of various output GPIOs to be cleared without affecting
* other GPIO states. Contains a bit field identifying the output GPIOs that
* should have their state cleared to 0.
*/
SPINEL_PROP_GPIO_STATE_CLEAR = SPINEL_PROP_BASE_EXT__BEGIN + 4,
SPINEL_PROP_BASE_EXT__END = 0x1100,
SPINEL_PROP_PHY__BEGIN = 0x20,
SPINEL_PROP_PHY_ENABLED = SPINEL_PROP_PHY__BEGIN + 0, ///< [b]
SPINEL_PROP_PHY_CHAN = SPINEL_PROP_PHY__BEGIN + 1, ///< [C]