ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_usb_host.h
Go to the documentation of this file.
1
21
22#pragma once
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#include <stdint.h>
29
30#include "ra8_err.h"
31#include "ra8_usb_device.h"
32
33/* =============================================================================
34 * Host-mode bring-up (peer of the device-mode lifecycle above)
35 * =============================================================================
36 */
37
78
96
123[[nodiscard]] ra8_err_t ra8_usb_host_bus_reset(ra8_usb_speed_t speed, bool assert_reset);
124
147[[nodiscard]] ra8_err_t ra8_usb_host_set_uact(ra8_usb_speed_t speed, bool enable);
148
181 const ra8_usb_setup_t* setup);
182
220 const ra8_usb_setup_t* setup,
221 uint8_t* data,
222 uint16_t data_len,
223 uint16_t* out_received);
224
242uint8_t ra8_usb_host_ctrl_stage(void);
243
264
291[[nodiscard]] ra8_err_t ra8_usb_host_set_target(ra8_usb_speed_t speed, uint8_t dev_addr);
292
326 uint8_t pipe_num,
327 uint8_t dev_addr,
328 uint8_t ep_num,
329 bool device_to_host,
330 uint16_t max_packet);
331
364[[nodiscard]] ra8_err_t
365ra8_usb_host_bulk_out(ra8_usb_speed_t speed, uint8_t pipe_num, const uint8_t* data, uint16_t len);
366
400 uint8_t pipe_num,
401 uint8_t* buf,
402 uint16_t max_len,
403 uint16_t* out_received);
404
405#ifdef __cplusplus
406}
407#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Native USB controller driver public API – shared types + device mode.
ra8_usb_speed_t
Selects which controller instance the call targets.
ra8_err_t ra8_usb_host_bulk_out(ra8_usb_speed_t speed, uint8_t pipe_num, const uint8_t *data, uint16_t len)
Transmit one bulk packet to the device and wait for the ACK.
ra8_err_t ra8_usb_host_bus_reset(ra8_usb_speed_t speed, bool assert_reset)
Drive (or release) the bus reset line.
uint16_t ra8_usb_host_line_state(ra8_usb_speed_t speed)
Read the host port's D+/D- line state (SYSSTS0.LNST).
ra8_err_t ra8_usb_host_pipe_setup(ra8_usb_speed_t speed, uint8_t pipe_num, uint8_t dev_addr, uint8_t ep_num, bool device_to_host, uint16_t max_packet)
Configure a controller pipe against an attached device's bulk endpoint.
ra8_err_t ra8_usb_host_bulk_in(ra8_usb_speed_t speed, uint8_t pipe_num, uint8_t *buf, uint16_t max_len, uint16_t *out_received)
Receive a bulk transfer from the device into buf.
ra8_err_t ra8_usb_host_init(ra8_usb_speed_t speed)
Bring up a USB controller in HOST mode.
ra8_err_t ra8_usb_host_deinit(ra8_usb_speed_t speed)
Tear down a host-mode controller and drop its MSTP reference.
uint8_t ra8_usb_host_ctrl_stage(void)
Last stage reached by ra8_usb_host_control_xfer (bring-up diag).
ra8_err_t ra8_usb_host_setup_request(ra8_usb_speed_t speed, const ra8_usb_setup_t *setup)
Issue a SETUP packet through the DCP (host -> peripheral).
ra8_err_t ra8_usb_host_control_xfer(ra8_usb_speed_t speed, const ra8_usb_setup_t *setup, uint8_t *data, uint16_t data_len, uint16_t *out_received)
Run a complete host control transfer (SETUP, optional DATA, STATUS).
ra8_err_t ra8_usb_host_set_uact(ra8_usb_speed_t speed, bool enable)
Enable / disable SOF (Start-of-Frame) generation on the bus.
ra8_err_t ra8_usb_host_set_target(ra8_usb_speed_t speed, uint8_t dev_addr)
Retarget the host's default control pipe at a device address.
Decoded 8-byte USB SETUP packet.