18#ifndef CY_H4TRANSPORT_DRIVER_H_
19#define CY_H4TRANSPORT_DRIVER_H_
21#if (DEVICE_SERIAL && DEVICE_SERIAL_FC) || defined(DOXYGEN_ONLY)
24#include "ble/driver/CordioHCITransportDriver.h"
25#include "drivers/DigitalInOut.h"
26#include "drivers/InterruptIn.h"
28#if defined(CYW43XXX_UNBUFFERED_UART)
29#include "drivers/UnbufferedSerial.h"
31#include "cyhal_uart.h"
36namespace cypress_ble {
38using namespace ble::vendor;
49 CyH4TransportDriver(PinName tx, PinName rx, PinName cts, PinName rts, PinName bt_power_name,
int baud, PinName bt_host_wake_name, PinName bt_device_wake_name,
50 uint8_t host_wake_irq = 0, uint8_t dev_wake_irq = 0);
51 CyH4TransportDriver(PinName tx, PinName rx, PinName cts, PinName rts, PinName bt_power_name,
int baud);
71 virtual uint16_t
write(uint8_t type, uint16_t len, uint8_t *pData);
73 void bt_host_wake_rise_irq_handler();
74 void bt_host_wake_fall_irq_handler();
76#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
77 void on_host_stack_inactivity();
80 void update_uart_baud_rate(
int baud);
82 bool get_enabled_powersave();
83 uint8_t get_host_wake_irq_event();
84 uint8_t get_dev_wake_irq_event();
87 void assert_bt_dev_wake();
88 void deassert_bt_dev_wake();
90#if defined(CYW43XXX_UNBUFFERED_UART)
91 void on_controller_irq();
101#if defined(CYW43XXX_UNBUFFERED_UART)
110 PinName bt_host_wake_name;
111 PinName bt_device_wake_name;
117 bool bt_host_wake_active;
119#if (defined(MBED_TICKLESS) && DEVICE_SLEEP && DEVICE_LPTICKER)
123 bool enabled_powersave;
124 uint8_t host_wake_irq_event;
125 uint8_t dev_wake_irq_event;
132#define DEF_BT_BAUD_RATE (115200)
133#define DEF_BT_3M_BAUD_RATE (3000000)
135#define WAKE_EVENT_ACTIVE_HIGH ( 1 )
136#define WAKE_EVENT_ACTIVE_LOW ( 0 )
Base class of the HCI transport driver.
Implementation of the H4 driver over Cypress based chips.
virtual uint16_t write(uint8_t type, uint16_t len, uint8_t *pData)
virtual void initialize()
CyH4TransportDriver(PinName tx, PinName rx, PinName cts, PinName rts, PinName bt_power_name, int baud, PinName bt_host_wake_name, PinName bt_device_wake_name, uint8_t host_wake_irq=0, uint8_t dev_wake_irq=0)
Initialize the transport driver.
virtual ~CyH4TransportDriver()
Destructor.
A digital input/output, used for setting or reading a bi-directional pin.
A digital interrupt input, used to call a function on a rising or falling edge.
Class implementation for unbuffered I/O for an interrupt driven application or one that needs to have...
Entry namespace for all BLE API definitions.