Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

hal/nrf24lu1p/hal_usb.h File Reference

Interface for the USB device controller. More...

#include <stdint.h>
#include <stdbool.h>
#include "hal_usb_desc.h"
#include "config.h"

Go to the source code of this file.

Data Structures

struct  hal_usb_device_req
struct  hal_usb_t

Defines

#define USB_BM_STATE_CONFIGURED   0x01
#define USB_BM_STATE_ALLOW_REMOTE_WAKEUP   0x02
#define USB_BM_STATE_HOST_WU   0x04

Typedefs

typedef hal_usb_dev_req_resp_t(* hal_usb_cb_device_req_t )(hal_usb_device_req *device_req, uint8_t **data_ptr, uint8_t *size) large reentrant
typedef uint8_t(* hal_usb_cb_endpoint_t )(uint8_t *adr_ptr, uint8_t *size) large reentrant
typedef void(* hal_usb_cb_resume_t )() large reentrant
typedef void(* hal_usb_cb_suspend_t )(uint8_t allow_remote_wu) large reentrant
typedef void(* hal_usb_cb_reset_t )() large reentrant

Enumerations

enum  hal_usb_state_t {
  ATTACHED, POWERED, DEFAULT, ADDRESSED,
  CONFIGURED, SUSPENDED
}
enum  hal_usb_dev_req_resp_t {
  STALL, NAK, ACK, NO_RESPONSE,
  DATA, EMPTY_RESPONSE
}

Functions

void hal_usb_init (_Bool usb_disconnect, hal_usb_cb_device_req_t device_req, hal_usb_cb_reset_t reset, hal_usb_cb_resume_t resume, hal_usb_cb_suspend_t suspend)
void hal_usb_send_data (uint8_t ep_in_num, uint8_t *buffer, uint8_t bytes_to_send)
void hal_usb_endpoint_config (uint8_t ep_num, uint8_t ep_size, hal_usb_cb_endpoint_t endpoint_isr)
void hal_usb_endpoint_stall (uint8_t ep_num, _Bool stall)
hal_usb_state_t hal_usb_get_state ()
uint8_t hal_usb_get_address ()
void hal_usb_wakeup ()
void hal_usb_reset ()
void hal_usb_bus_disconnect ()
void hal_usb_bus_connect ()
void hal_usb_sleep ()

Variables

hal_usb_t volatile g_hal_usb

Detailed Description

Interface for the USB device controller.

The header file must define the following type-defined structs:

And the following global variables:

Definition in file hal_usb.h.