Changed to use stdint types.
This commit is contained in:
@@ -48,13 +48,13 @@ struct _usbd_device {
|
||||
const char **strings;
|
||||
int num_strings;
|
||||
|
||||
u8 *ctrl_buf; /**< Internal buffer used for control transfers */
|
||||
u16 ctrl_buf_len;
|
||||
uint8_t *ctrl_buf; /**< Internal buffer used for control transfers */
|
||||
uint16_t ctrl_buf_len;
|
||||
|
||||
u8 current_address;
|
||||
u8 current_config;
|
||||
uint8_t current_address;
|
||||
uint8_t current_config;
|
||||
|
||||
u16 pm_top; /**< Top of allocated endpoint buffer memory */
|
||||
uint16_t pm_top; /**< Top of allocated endpoint buffer memory */
|
||||
|
||||
/* User callback functions for various USB events */
|
||||
void (*user_callback_reset)(void);
|
||||
@@ -69,22 +69,22 @@ struct _usbd_device {
|
||||
DATA_OUT, LAST_DATA_OUT, STATUS_OUT,
|
||||
} state;
|
||||
struct usb_setup_data req __aligned(4);
|
||||
u8 *ctrl_buf;
|
||||
u16 ctrl_len;
|
||||
uint8_t *ctrl_buf;
|
||||
uint16_t ctrl_len;
|
||||
void (*complete)(usbd_device *usbd_dev,
|
||||
struct usb_setup_data *req);
|
||||
} control_state;
|
||||
|
||||
struct user_control_callback {
|
||||
usbd_control_callback cb;
|
||||
u8 type;
|
||||
u8 type_mask;
|
||||
uint8_t type;
|
||||
uint8_t type_mask;
|
||||
} user_control_callback[MAX_USER_CONTROL_CALLBACK];
|
||||
|
||||
void (*user_callback_ctr[8][3])(usbd_device *usbd_dev, u8 ea);
|
||||
void (*user_callback_ctr[8][3])(usbd_device *usbd_dev, uint8_t ea);
|
||||
|
||||
/* User callback function for some standard USB function hooks */
|
||||
void (*user_callback_set_config)(usbd_device *usbd_dev, u16 wValue);
|
||||
void (*user_callback_set_config)(usbd_device *usbd_dev, uint16_t wValue);
|
||||
|
||||
const struct _usbd_driver *driver;
|
||||
|
||||
@@ -92,12 +92,12 @@ struct _usbd_device {
|
||||
|
||||
uint16_t fifo_mem_top;
|
||||
uint16_t fifo_mem_top_ep0;
|
||||
u8 force_nak[4];
|
||||
uint8_t force_nak[4];
|
||||
/*
|
||||
* We keep a backup copy of the out endpoint size registers to restore
|
||||
* them after a transaction.
|
||||
*/
|
||||
u32 doeptsiz[4];
|
||||
uint32_t doeptsiz[4];
|
||||
/*
|
||||
* Received packet size for each endpoint. This is assigned in
|
||||
* stm32f107_poll() which reads the packet status push register GRXSTSP
|
||||
@@ -115,43 +115,43 @@ enum _usbd_transaction {
|
||||
/* Do not appear to belong to the API, so are omitted from docs */
|
||||
/**@}*/
|
||||
|
||||
void _usbd_control_in(usbd_device *usbd_dev, u8 ea);
|
||||
void _usbd_control_out(usbd_device *usbd_dev, u8 ea);
|
||||
void _usbd_control_setup(usbd_device *usbd_dev, u8 ea);
|
||||
void _usbd_control_in(usbd_device *usbd_dev, uint8_t ea);
|
||||
void _usbd_control_out(usbd_device *usbd_dev, uint8_t ea);
|
||||
void _usbd_control_setup(usbd_device *usbd_dev, uint8_t ea);
|
||||
|
||||
int _usbd_standard_request_device(usbd_device *usbd_dev,
|
||||
struct usb_setup_data *req, u8 **buf,
|
||||
u16 *len);
|
||||
struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len);
|
||||
int _usbd_standard_request_interface(usbd_device *usbd_dev,
|
||||
struct usb_setup_data *req, u8 **buf,
|
||||
u16 *len);
|
||||
struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len);
|
||||
int _usbd_standard_request_endpoint(usbd_device *usbd_dev,
|
||||
struct usb_setup_data *req, u8 **buf,
|
||||
u16 *len);
|
||||
struct usb_setup_data *req, uint8_t **buf,
|
||||
uint16_t *len);
|
||||
int _usbd_standard_request(usbd_device *usbd_dev, struct usb_setup_data *req,
|
||||
u8 **buf, u16 *len);
|
||||
uint8_t **buf, uint16_t *len);
|
||||
|
||||
void _usbd_reset(usbd_device *usbd_dev);
|
||||
|
||||
/* Functions provided by the hardware abstraction. */
|
||||
struct _usbd_driver {
|
||||
usbd_device *(*init)(void);
|
||||
void (*set_address)(usbd_device *usbd_dev, u8 addr);
|
||||
void (*ep_setup)(usbd_device *usbd_dev, u8 addr, u8 type, u16 max_size,
|
||||
void (*cb)(usbd_device *usbd_dev, u8 ep));
|
||||
void (*set_address)(usbd_device *usbd_dev, uint8_t addr);
|
||||
void (*ep_setup)(usbd_device *usbd_dev, uint8_t addr, uint8_t type, uint16_t max_size,
|
||||
void (*cb)(usbd_device *usbd_dev, uint8_t ep));
|
||||
void (*ep_reset)(usbd_device *usbd_dev);
|
||||
void (*ep_stall_set)(usbd_device *usbd_dev, u8 addr, u8 stall);
|
||||
void (*ep_nak_set)(usbd_device *usbd_dev, u8 addr, u8 nak);
|
||||
u8 (*ep_stall_get)(usbd_device *usbd_dev, u8 addr);
|
||||
u16 (*ep_write_packet)(usbd_device *usbd_dev, u8 addr, const void *buf,
|
||||
u16 len);
|
||||
u16 (*ep_read_packet)(usbd_device *usbd_dev, u8 addr, void *buf,
|
||||
u16 len);
|
||||
void (*ep_stall_set)(usbd_device *usbd_dev, uint8_t addr, uint8_t stall);
|
||||
void (*ep_nak_set)(usbd_device *usbd_dev, uint8_t addr, uint8_t nak);
|
||||
uint8_t (*ep_stall_get)(usbd_device *usbd_dev, uint8_t addr);
|
||||
uint16_t (*ep_write_packet)(usbd_device *usbd_dev, uint8_t addr, const void *buf,
|
||||
uint16_t len);
|
||||
uint16_t (*ep_read_packet)(usbd_device *usbd_dev, uint8_t addr, void *buf,
|
||||
uint16_t len);
|
||||
void (*poll)(usbd_device *usbd_dev);
|
||||
void (*disconnect)(usbd_device *usbd_dev, bool disconnected);
|
||||
u32 base_address;
|
||||
uint32_t base_address;
|
||||
bool set_address_before_status;
|
||||
u16 rx_fifo_size;
|
||||
uint16_t rx_fifo_size;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user