21 #ifndef COSA_CC3000_HCI_HH 22 #define COSA_CC3000_HCI_HH 55 virtual void on_event(uint16_t event,
void* args,
size_t len) = 0;
89 int read(uint16_t &op,
void* args, uint8_t len);
100 int write(uint8_t type, uint16_t op,
const void* args, uint8_t len)
102 return (
write(type, op, args, len,
false));
114 int write_P(uint8_t type, uint16_t op,
const void* args, uint8_t len)
116 return (
write(type, op, args, len,
true));
129 int write(uint8_t type, uint16_t op,
const void* args, uint8_t len,
140 int issue(uint16_t op,
const void* args =
NULL, uint8_t len = 0)
153 int issue_P(uint16_t op,
const void* args, uint8_t len)
168 int await(uint16_t op,
void* args =
NULL, uint8_t len = 0);
181 int write_data(uint8_t op,
const void* args, uint8_t args_len,
182 const void* data, uint16_t data_len)
184 return (
write_data(op, args, args_len, data, data_len,
false));
199 const void* data, uint16_t data_len)
201 return (
write_data(op, args, args_len, data, data_len,
true));
216 int write_data(uint8_t op,
const void* args, uint8_t args_len,
217 const void* data, uint16_t data_len,
bool progmem);
229 int read_data(uint8_t op,
void* args, uint8_t args_len,
230 void* data, uint16_t data_len);
295 m_hci->m_available =
true;
int read(uint16_t &op, void *args, uint8_t len)
IRQPin(Board::ExternalInterruptPin pin, HCI *hci)
SPI Read(0,Payload Length).
HCI Event (SPI_OP_READ only).
int await(uint16_t op, void *args=NULL, uint8_t len=0)
int write_data(uint8_t op, const void *args, uint8_t args_len, const void *data, uint16_t data_len)
int write_P(uint8_t type, uint16_t op, const void *args, uint8_t len)
HCI(Board::DigitalPin cs, Board::ExternalInterruptPin irq, SPI::Clock rate=SPI::DEFAULT_CLOCK)
virtual void on_interrupt(uint16_t arg)
static const uint16_t DEFAULT_TIMEOUT
int read_data(uint8_t op, void *args, uint8_t args_len, void *data, uint16_t data_len)
int write(uint8_t type, uint16_t op, const void *args, uint8_t len)
void event_handler(Event::Handler *handler)
HCI Command (SPI_OP_WRITE only).
int write_data_P(uint8_t op, const void *args, uint8_t args_len, const void *data, uint16_t data_len)
Event::Handler * m_event_handler
int issue(uint16_t op, const void *args=NULL, uint8_t len=0)
volatile bool m_available
SPI Write(Payload Length,0).
HCI Data (both SPI_OP_WRITE/READ).
HCI Patch (SPI_OP_WRITE only).
static const uint8_t EVNT_MAX
Driver(Board::DigitalPin cs, Pulse pulse=DEFAULT_PULSE, Clock rate=DEFAULT_CLOCK, uint8_t mode=0, Order order=MSB_ORDER, Interrupt::Handler *irq=NULL)
int issue_P(uint16_t op, const void *args, uint8_t len)
virtual void on_event(uint16_t event, void *args, size_t len)=0