|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
USB-CDC byte-stream sink – bulk-IN writes through ra8_usb_pal. More...
#include "ra8_io_stream_usbcdc.h"#include <stdint.h>#include "ra8_attributes.h"#include "ra8_check.h"#include "ra8_err.h"#include "ra8_io_stream_backend.h"#include "ra8_usb_pal.h"Go to the source code of this file.
Enumerations | |
| enum | ra8_io_usbcdc_const_t : uint32_t { k_usbcdc_max_chunk = 65535 } |
| USB-CDC sink constants. More... | |
Functions | |
| static ra8_err_t | internal_usbcdc_write (void *ctx, const uint8_t *buf, uint32_t len, uint32_t *out_written) |
| USB-CDC sink: send all bytes through the bulk-IN endpoint. | |
| ra8_err_t | ra8_io_stream_usbcdc_init (ra8_io_stream_t *s, ra8_io_stream_usbcdc_state_t *state, uint8_t ep_addr) |
| Bind a USB-CDC stream sink into a caller-owned stream handle. | |
Variables | |
| static const char *const | s_tag = "ra8_io_stream_usbcdc" |
| Module log tag. | |
| static const ra8_io_stream_iface_t | s_usbcdc_iface |
| USB-CDC stream sink vtable. | |
USB-CDC byte-stream sink – bulk-IN writes through ra8_usb_pal.
Binds ra8_io_stream_iface to ra8_usb_pal_ep_send. The PAL takes a 16-bit length, so a larger write is split into 65535-byte chunks. Touches no raw MMIO – the PAL owns the USB controller access.
Definition in file ra8_io_stream_usbcdc.c.
| enum ra8_io_usbcdc_const_t : uint32_t |
USB-CDC sink constants.
| Enumerator | |
|---|---|
| k_usbcdc_max_chunk | Largest single ra8_usb_pal_ep_send length. |
Definition at line 36 of file ra8_io_stream_usbcdc.c.
|
static |
USB-CDC sink: send all bytes through the bulk-IN endpoint.
Splits the request into at most 65535-byte PAL transfers and stops at the first non-ok status, reporting how many bytes were sent.
| [in] | ctx | USB-CDC sink state (as a void cookie). |
| [in] | buf | Source bytes. |
| [in] | len | Number of bytes to send. |
| [out] | out_written | Sent byte count, or NULL. |
| k_ra8_ok | All bytes sent. |
| k_ra8_err_null_ptr | ctx or buf was NULL. |
| k_ra8_err_* | Propagated from ra8_usb_pal_ep_send. |
Definition at line 67 of file ra8_io_stream_usbcdc.c.
References ra8_io_stream_usbcdc_state_t::ep_addr, k_ra8_ok, k_usbcdc_max_chunk, RA8_CHECK_NULL_PTR, ra8_usb_pal_ep_send(), and s_tag.
|
nodiscard |
Bind a USB-CDC stream sink into a caller-owned stream handle.
| [out] | s | Stream handle to bind (zero-initialised by the caller). |
| [out] | state | Caller-owned sink state to populate. |
| [in] | ep_addr | USB bulk-IN endpoint address to write to. |
| k_ra8_ok | Sink bound; s is usable. |
| k_ra8_err_null_ptr | s or state was NULL. |
Definition at line 100 of file ra8_io_stream_usbcdc.c.
References ra8_io_stream_usbcdc_state_t::ep_addr, RA8_CHECK_NULL_PTR, ra8_io_stream_bind(), s_tag, and s_usbcdc_iface.
|
static |
Module log tag.
Definition at line 28 of file ra8_io_stream_usbcdc.c.
|
static |
USB-CDC stream sink vtable.
flush is NULL: the PAL queues directly.
Definition at line 94 of file ra8_io_stream_usbcdc.c.
Referenced by ra8_io_stream_usbcdc_init().