From aca8b4b31ef457dc212e026fb216298ad91b86de Mon Sep 17 00:00:00 2001
From: EricB-ADI <122300463+EricB-ADI@users.noreply.github.com>
Date: Mon, 27 Nov 2023 10:59:40 -0600
Subject: [PATCH 01/18] basic addition of commands
---
.../controller/sources/ble/lhci/lhci_int.h | 8 +-
Libraries/Cordio/docs/HCI_INTERFACE.md | 376 ++++++++++++++++++
2 files changed, 380 insertions(+), 4 deletions(-)
create mode 100644 Libraries/Cordio/docs/HCI_INTERFACE.md
diff --git a/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h b/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h
index bd903c4da52..ce140b42e2f 100644
--- a/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h
+++ b/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h
@@ -293,6 +293,8 @@ extern "C" {
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F2) /*!< Set Local Feature opcode. */
#define LHCI_OPCODE_VS_SET_OP_FLAGS \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F3) /*!< Set Operational Flags opcode. */
+#define LHCI_OPCODE_VS_GET_PDU_FILT_STATS \
+ HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F4) /*!< Get PDU Filter Statistics opcode. */
#define LHCI_OPCODE_VS_SET_ADV_TX_PWR \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F5) /*!< Set Advertising Tx Power opcode. */
#define LHCI_OPCODE_VS_SET_CONN_TX_PWR \
@@ -307,8 +309,6 @@ extern "C" {
#define LHCI_OPCODE_VS_SET_SNIFFER_ENABLE \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3CD) /*!< Enable sniffer packet forwarding. */
-#define LHCI_OPCODE_VS_GET_PDU_FILT_STATS \
- HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3F4) /*!< Get PDU Filter Statistics opcode. */
#define LHCI_OPCODE_VS_GET_SYS_STATS \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3FA) /*!< Get Memory Statistics opcode. */
#define LHCI_OPCODE_VS_GET_ADV_STATS \
@@ -354,8 +354,8 @@ extern "C" {
#define LHCI_OPCODE_VS_SET_CONN_PHY_TX_PWR \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x3DD) /*!< Set Connection Phy Tx Power opcode. */
-#define LHCI_OPCODE_VS_REG_WRITE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x300) /*!< Write register. */
-#define LHCI_OPCODE_VS_REG_READ HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x301) /*!< Read register. */
+#define LHCI_OPCODE_VS_REG_WRITE HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x300) /*!< Write data to MCU register or memory space. */
+#define LHCI_OPCODE_VS_REG_READ HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x301) /*!< Read data from MCU register or memory space. */
#define LHCI_OPCODE_VS_RESET_CONN_STATS \
HCI_OPCODE(HCI_OGF_VENDOR_SPEC, 0x302) /*!< Reset connection stats. */
#define LHCI_OPCODE_VS_TX_TEST \
diff --git a/Libraries/Cordio/docs/HCI_INTERFACE.md b/Libraries/Cordio/docs/HCI_INTERFACE.md
new file mode 100644
index 00000000000..6dea1f056c7
--- /dev/null
+++ b/Libraries/Cordio/docs/HCI_INTERFACE.md
@@ -0,0 +1,376 @@
+# Host Controller Interface (HCI)
+
+
+
+## Vendor Specific Commands
+OGF = 0x3F
+
+OPCODE = (OGF << 10) | OCF
+
+
+### Write Memory
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF: 0x300
+- Length: 5 + N
+
+Parameters
+
+
+### Read Memory
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF: 0x301
+- Length: 5
+- Parameters:
+ - Length : 1 Bytes
+ - Adresss: 4 Bytes
+
+### Reset Connection Stats
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF
+- Length:
+- Parameters:
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+
+
+|Reset connection stats|Clear all current connection stats|0x302|0|N/A|z|
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Vendor specific TX test | Normal TX test, but can specify the number of packets to transmit|0x303|6| |x|
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Vendor specific End Test|0|0x304|None||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Enable sniffer packet forwarding| |0x3CD|||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set Additional AuxPtr| |0x3D0||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Set extended advertising data fragmentation length | |0x3D1||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set extended advertising PHY options | |0x3D2||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set extended advertising default PHY options | |0x3D3||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Set extended scanning default PHY options| |0x3D4||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Generate ISO Packets opcode| |0x3D5||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Get ISO Test Report opcode| |0x3D6||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Enable ISO Packet Sink opcode| |0x3D7||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Enable Auto Generate ISO Packets | |0x3D8||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Get ISO Connection Statistics opcode| |0x3D9||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Get Auxiliary Advertising Statistics opcode| |0x3DA||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Get Auxiliary Scanning Statistics| |0x3DB||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Get Periodic Scanning Statistics | |0x3DC||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+| Set Connection Phy Tx Power | |0x3DD||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Get channel map of periodic scan/adv| |0x3DE|||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set Scan Channel Map| xc|0x3E0|xx|xx|
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set Event Mask| xc|0x3E2|xx|xx|
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Enable ACL Packet Sink| xc|0x3E3|xx|xx|
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Generate ACL Packets | xc|0x3E4|xx|xx|
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Enable Auto Generate ACL Packets | xc|0x3E5||xx|
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set Tx Test Error Pattern| |0x3E6|||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set Connection Operational Flags| |0x3E0|||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+- Parameters:
+
+|Set P-256 Private Key ||0x3E8|||
+### VS End Test
+- Desciription: Write data to MCU register or memory space at sepcified addresss
+- OCF:
+- Length:
+-