|
ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
|
USB CDC receive ring buffer implementation. More...
Go to the source code of this file.
Functions | |
| void | __cdc_rx_init (void) |
| void | __cdc_rx_push (const uint8_t *data, uint32_t len) |
| bool | __cdc_rx_read_byte (uint8_t *out) |
| uint32_t | __cdc_rx_available (void) |
Variables | |
| static volatile uint8_t | rx_buf [512] |
| static volatile uint32_t | rx_head |
| static volatile uint32_t | rx_tail |
USB CDC receive ring buffer implementation.
SPSC (single-producer single-consumer) ring buffer. Producer: CDC_Receive_FS callback (USB interrupt context). Consumer: any RTOS task draining bytes.
The buffer and indices live in DTCM_DATA_PRIV (privileged-only tightly-coupled memory). Public read accessors go through SVC gates (SVC_CDC_RX_READ_BYTE / SVC_CDC_RX_AVAILABLE) so unprivileged thread-mode tasks can use them once the MPU is locked. The producer call site is the USB CDC ISR, which is already in privileged handler context — it calls the __cdc_rx_push privileged variant directly to avoid issuing an SVC from a high-priority interrupt.
Definition in file cdc_rx.c.
| uint32_t __cdc_rx_available | ( | void | ) |
Definition at line 66 of file cdc_rx.c.
References CDC_RX_BUF_SIZE, rx_head, and rx_tail.
Referenced by cdc_rx_available(), and SVC_Handler_C().
| void __cdc_rx_init | ( | void | ) |
Definition at line 38 of file cdc_rx.c.
References rx_head, and rx_tail.
Referenced by cdc_rx_init(), and SVC_Handler_C().
| void __cdc_rx_push | ( | const uint8_t * | data, |
| uint32_t | len | ||
| ) |
Definition at line 43 of file cdc_rx.c.
References CDC_RX_BUF_SIZE, rx_buf, rx_head, and rx_tail.
Referenced by cdc_rx_push().
| bool __cdc_rx_read_byte | ( | uint8_t * | out | ) |
Definition at line 57 of file cdc_rx.c.
References CDC_RX_BUF_SIZE, rx_buf, rx_head, and rx_tail.
Referenced by cdc_rx_read_byte(), and SVC_Handler_C().
|
static |
Definition at line 32 of file cdc_rx.c.
Referenced by __cdc_rx_push(), and __cdc_rx_read_byte().
|
static |
Definition at line 33 of file cdc_rx.c.
Referenced by __cdc_rx_available(), __cdc_rx_init(), __cdc_rx_push(), and __cdc_rx_read_byte().
|
static |
Definition at line 34 of file cdc_rx.c.
Referenced by __cdc_rx_available(), __cdc_rx_init(), __cdc_rx_push(), and __cdc_rx_read_byte().