Mbed OS Reference
Loading...
Searching...
No Matches
hci_drv_apollo3.h
Go to the documentation of this file.
1//*****************************************************************************
2//
3//! @file hci_drv_apollo3.h
4//!
5//! @brief Support functions for the Nationz BTLE radio in Apollo3.
6//
7//*****************************************************************************
8
9//*****************************************************************************
10//
11// Copyright (c) 2019, Ambiq Micro
12// All rights reserved.
13//
14// Redistribution and use in source and binary forms, with or without
15// modification, are permitted provided that the following conditions are met:
16//
17// 1. Redistributions of source code must retain the above copyright notice,
18// this list of conditions and the following disclaimer.
19//
20// 2. Redistributions in binary form must reproduce the above copyright
21// notice, this list of conditions and the following disclaimer in the
22// documentation and/or other materials provided with the distribution.
23//
24// 3. Neither the name of the copyright holder nor the names of its
25// contributors may be used to endorse or promote products derived from this
26// software without specific prior written permission.
27//
28// Third party software included in this distribution is subject to the
29// additional license terms as defined in the /docs/licenses directory.
30//
31// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
35// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41// POSSIBILITY OF SUCH DAMAGE.
42//
43// This is part of revision 2.3.2 of the AmbiqSuite Development Package.
44//
45//*****************************************************************************
46// SPDX-License-Identifier: BSD-3-Clause
47#ifndef HCI_DRV_APOLLO3_H
48#define HCI_DRV_APOLLO3_H
49#include "wsf_os.h"
50#ifdef __cplusplus
51extern "C"
52{
53#endif
54 //*****************************************************************************
55 //
56 // NATIONZ vendor specific events
57 //
58 //*****************************************************************************
59
60 // Tx power level in dBm.
61 typedef enum
62 {
63 TX_POWER_LEVEL_MINUS_10P0_dBm = 0x3,
64 TX_POWER_LEVEL_0P0_dBm = 0x8,
65 TX_POWER_LEVEL_PLUS_3P0_dBm = 0xF,
66 TX_POWER_LEVEL_INVALID = 0x10,
67 } txPowerLevel_t;
68
69#define HCI_DRV_SPECIFIC_ERROR_START 0x09000000
70 typedef enum
71 {
72 HCI_DRV_TRANSMIT_QUEUE_FULL = HCI_DRV_SPECIFIC_ERROR_START,
73 HCI_DRV_TX_PACKET_TOO_LARGE,
74 HCI_DRV_RX_PACKET_TOO_LARGE,
75 HCI_DRV_BLE_STACK_UNABLE_TO_ACCEPT_PACKET,
76 HCI_DRV_PACKET_TRANSMIT_FAILED,
77 HCI_DRV_IRQ_STUCK_HIGH,
78 HCI_DRV_TOO_MANY_PACKETS,
79 } hci_drv_error_t;
80
81 typedef void (*hci_drv_error_handler_t)(uint32_t ui32Error);
82
83 bool_t HciVsA3_SetRfPowerLevelEx(txPowerLevel_t txPowerlevel);
84 void HciVsA3_ConstantTransmission(uint8_t txchannel);
85 void HciVsA3_CarrierWaveMode(uint8_t txchannel);
86
87 //*****************************************************************************
88 //
89 // Hci driver functions unique to Apollo3
90 //
91 //*****************************************************************************
92 extern void HciDrvHandler(wsfEventMask_t event, wsfMsgHdr_t *pMsg);
93 extern void HciDrvHandlerInit(wsfHandlerId_t handlerId);
94 extern void HciDrvIntService(void);
95
96 uint16_t ap3_hciDrvWrite(uint8_t type, uint16_t len, uint8_t *pData);
97
98 extern void HciDrvRadioBoot(bool bColdBoot);
99 extern void HciDrvRadioShutdown(void);
100
101#ifdef __cplusplus
102};
103#endif
104
105#endif // HCI_DRV_APOLLO3_H