|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Shared contracts for ESP32-C6 browser camera servers. More...
Go to the source code of this file.
Data Structures | |
| struct | c6_cam_lease_t |
| DHCP lease returned by the raw, bench-validated C6/NetX path. More... | |
| struct | c6_cam_frame_timing_t |
| Per-frame pipeline latency exposed in HTTP Server-Timing headers. More... | |
Enumerations | |
| enum | c6_cam_cfg_t : uint32_t { k_c6_cam_uart_baud = 115200U , k_c6_cam_sck_hz = 10000000U , k_c6_cam_edge_poll_ms = 2U , k_c6_cam_boot_wait_ms = 200U , k_c6_cam_assoc_polls = 200U , k_c6_cam_assoc_gap_ms = 50U , k_c6_cam_dhcp_wait_ms = 25000U , k_c6_cam_worker_stack = 12288U , k_c6_cam_worker_prio = 8U , k_c6_cam_arena_bytes = 4096U , k_c6_cam_http_port = 80U , k_c6_cam_http_chunk = 1400U , k_c6_cam_request_max = 512U , k_c6_cam_tcp_window = 4096U , k_c6_cam_listen_backlog = 1U , k_c6_cam_stream_frames = 1024U , k_c6_cam_net_pkt_payload = 1568U , k_c6_cam_net_pool_bytes = 49152U , k_c6_cam_net_ip_stack = 2048U , k_c6_cam_net_arp_bytes = 1040U , k_c6_cam_net_ip_prio = 3U } |
| Application sizing, pacing and fixed network values. More... | |
Functions | |
| int32_t | c6_cam_app_run (void) |
| Run the shared runtime-provisioned C6, DHCP, and HTTP application flow. | |
| ra8_err_t | c6_cam_camera_init (void) |
| Camera image and board-switch initialization, then one CEU capture. | |
| ra8_err_t | c6_cam_camera_capture_jpeg (const uint8_t **out_jpeg, uint32_t *out_bytes, c6_cam_frame_timing_t *out_timing) |
| const char * | c6_cam_camera_description (void) |
| Human-readable description of the selected camera backend. | |
| void | c6_cam_camera_report_last_error (void) |
| Emit backend-specific diagnostics for the last capture failure. | |
| ra8_err_t | c6_cam_audio_start (void) |
| Start continuous MIC1 capture into the SDRAM audio ring. | |
| ra8_err_t | c6_cam_audio_snapshot_wav (const uint8_t **out_wav, uint32_t *out_bytes, uint32_t *out_timestamp_ms) |
| Snapshot the rolling microphone ring as mono PCM-S16LE WAV. | |
| ra8_err_t | c6_cam_net_up (ra8_c6link_t *link, const ra8_c6link_mac_t *mac, c6_cam_lease_t *out) |
| Bind NetX to an associated raw C6 link and obtain a DHCP lease. | |
| void | c6_cam_http_serve (void) |
| Serve the browser UI and fresh JPEG frames forever. | |
| void | c6_cam_puts (const char *text) |
| Write a bounded NUL-terminated string to SCI8. | |
| void | c6_cam_put_u32 (uint32_t value) |
| Write one unsigned decimal value to SCI8. | |
| void | c6_cam_put_ip (uint32_t ip) |
| Write one IPv4 address to SCI8. | |
Shared contracts for ESP32-C6 browser camera servers.
Defines the heap-free camera, audio, console, and HTTP seams shared by the validated livestream and hardware-JPEG applications.
Definition in file c6_camera_server.h.
| enum c6_cam_cfg_t : uint32_t |
Application sizing, pacing and fixed network values.
Definition at line 23 of file c6_camera_server.h.
|
nodiscard |
Run the shared runtime-provisioned C6, DHCP, and HTTP application flow.
Definition at line 498 of file c6_cam_app.c.
References c6_cam_puts(), internal_c6_cam_halt(), internal_c6_cam_setup_or_halt(), and ra8_isr_globals_enable().
Referenced by main().
|
nodiscard |
Snapshot the rolling microphone ring as mono PCM-S16LE WAV.
Definition at line 273 of file c6_cam_audio.c.
References internal_c6_cam_audio_put_u16(), internal_c6_cam_audio_s16(), internal_c6_cam_audio_write_header(), k_c6_cam_audio_ring_samples, k_c6_cam_wav_header_bytes, k_c6_cam_wav_sample_bytes, k_ra8_err_no_data, k_ra8_err_null_ptr, k_ra8_ok, ra8_register_guard_enter(), ra8_register_guard_exit(), s_audio_active_bank, s_audio_banks, s_audio_ring, and s_audio_wav.
Referenced by internal_c6_cam_http_audio().
|
nodiscard |
Start continuous MIC1 capture into the SDRAM audio ring.
Definition at line 229 of file c6_cam_audio.c.
References ra8_board_pdm_mic_config_t::channel, internal_c6_cam_audio_on_frame(), k_c6_cam_audio_discard, k_c6_cam_audio_frame_samples, k_c6_cam_audio_irq_priority, k_c6_cam_audio_poll_attempts, k_c6_cam_audio_rate_hz, k_c6_cam_audio_settle_ms, k_ra8_board_pdm_mic1, k_ra8_err_invalid_state, k_ra8_ok, ra8_board_pdm_mic_config_t::pdm, ra8_audio_source_pdm_init(), ra8_audio_source_stop(), ra8_audio_source_stream_start(), ra8_board_pdm_mic_get_config(), ra8_board_pdm_mic_route(), s_audio_frame, s_audio_source, s_audio_state, ra8_board_pdm_mic_config_t::sample_rate_hz, and ra8_board_pdm_mic_config_t::valid_bits.
Referenced by internal_c6_cam_prepare_media().
|
nodiscard |
Definition at line 196 of file c6_cam_camera.c.
References ra8_camera_frame_t::bytes, c6_cam_frame_timing_t::capture_ms, ra8_camera_frame_t::data, c6_cam_frame_timing_t::encode_ms, jpeg_trim_to_eoi(), k_ra8_err_invalid_size, k_ra8_err_null_ptr, k_ra8_ok, ra8_camera_codec_encode(), ra8_camera_source_capture(), ra8_ov5640_jpeg_status_get(), ra8_ov5640_stream_set(), ra8_time_ms(), s_capture, s_codec, s_jpeg, s_last_jpeg_status, s_last_jpeg_status_err, s_sensor, s_sensor_streaming, s_source, and c6_cam_frame_timing_t::timestamp_ms.
Referenced by internal_c6_cam_http_frame(), internal_c6_cam_http_stream(), and internal_c6_cam_prepare_camera().
|
nodiscard |
Human-readable description of the selected camera backend.
Definition at line 234 of file c6_cam_camera.c.
Referenced by internal_c6_cam_prepare_camera().
|
nodiscard |
Camera image and board-switch initialization, then one CEU capture.
Definition at line 149 of file c6_cam_camera.c.
References internal_bring_up_capture_pipeline(), internal_bring_up_sensor(), internal_c6_cam_sensor_bind(), internal_c6_cam_source_config(), internal_reset_camera_diagnostics(), k_ra8_err_hw_init_failed, k_ra8_ok, k_ra8_ov5640_chip_id, k_ra8_ov5640_mode_vga_uyvy, k_sw_cam_jpeg_quality, k_sw_cam_mode_settle_ms, k_sw_cam_stream_height, k_sw_cam_stream_width, k_sw_cam_xclk_hz, ra8_board_camera_reset(), ra8_board_camera_route_parallel_pins(), ra8_board_camera_select_parallel(), ra8_board_camera_xclk_start(), ra8_camera_codec_jpeg_sw_init(), ra8_camera_source_ceu_init(), ra8_delay_ms(), ra8_ov5640_configure(), ra8_ov5640_probe(), s_camera_initialized, s_camera_sensor, s_codec, s_codec_state, s_rgb, s_source, and s_source_state.
Referenced by internal_c6_cam_prepare_camera().
| void c6_cam_camera_report_last_error | ( | void | ) |
Emit backend-specific diagnostics for the last capture failure.
Writes retained sensor or CEU status through the shared bounded console helpers.
Definition at line 239 of file c6_cam_camera.c.
References c6_cam_put_u32(), c6_cam_puts(), internal_report_capture_events(), internal_report_jpeg_status_detail(), internal_report_sccb_state(), internal_report_sensor_registers(), k_ra8_ok, ra8_camera_source_ceu_get_last_events(), ra8_err_to_str(), s_camera_initialized, s_last_jpeg_status_err, and s_source_state.
Referenced by internal_c6_cam_http_frame(), internal_c6_cam_http_stream(), and internal_c6_cam_prepare_camera().
| void c6_cam_http_serve | ( | void | ) |
Serve the browser UI and fresh JPEG frames forever.
Definition at line 550 of file c6_cam_net.c.
References c6_cam_puts(), internal_c6_cam_http_handle(), k_c6_cam_http_port, k_c6_cam_listen_backlog, k_c6_cam_tcp_window, s_http_socket, s_ip, s_socket_name, and tx_thread_sleep.
Referenced by internal_c6_cam_worker_entry().
|
nodiscard |
Bind NetX to an associated raw C6 link and obtain a DHCP lease.
Definition at line 107 of file c6_cam_net.c.
References c6_cam_lease_t::bound, c6_cam_lease_t::dhcp_server, c6_cam_lease_t::gateway, internal_c6_cam_net_create(), c6_cam_lease_t::ip, k_c6_cam_dhcp_wait_ms, k_ra8_err_not_initialized, k_ra8_err_null_ptr, k_ra8_err_timeout, k_ra8_ok, c6_cam_lease_t::mask, nx_ether_driver_c6_bind(), nx_ether_driver_c6_set_mac(), ra8_c6link_mac::octet, s_dhcp, s_dhcp_name, and s_ip.
Referenced by internal_c6_cam_join().
| void c6_cam_put_ip | ( | uint32_t | ip | ) |
Write one IPv4 address to SCI8.
Formats the network-order address as four dotted decimal octets.
| [in] | ip | IPv4 address in the representation used by the C6/NetX path. |
Definition at line 60 of file c6_cam_console.c.
References c6_cam_put_u32(), c6_cam_puts(), k_c6_cam_ipv4_high_shift, and k_c6_cam_ipv4_octet_mask.
Referenced by internal_c6_cam_worker_entry().
| void c6_cam_put_u32 | ( | uint32_t | value | ) |
Write one unsigned decimal value to SCI8.
Formats the value into fixed stack storage without libc allocation.
| [in] | value | Value to emit. |
Definition at line 44 of file c6_cam_console.c.
References k_c6_cam_decimal_digits, and ra8_board_uart_console_write().
Referenced by c6_cam_camera_report_last_error(), c6_cam_put_ip(), internal_c6_cam_associate(), internal_c6_cam_http_audio(), internal_c6_cam_http_frame(), internal_c6_cam_http_stream(), internal_c6_cam_prepare_camera(), internal_c6_cam_prepare_link(), internal_report_capture_events(), internal_report_jpeg_status_detail(), internal_report_sccb_state(), and sensor_report_register().
| void c6_cam_puts | ( | const char * | text | ) |
Write a bounded NUL-terminated string to SCI8.
Measures at most the helper's fixed string bound before one board-console write.
| [in] | text | NUL-terminated text to emit. |
Definition at line 32 of file c6_cam_console.c.
References k_c6_cam_console_text_max, and ra8_board_uart_console_write().
Referenced by c6_cam_app_run(), c6_cam_camera_report_last_error(), c6_cam_http_serve(), c6_cam_put_ip(), internal_c6_cam_associate(), internal_c6_cam_http_audio(), internal_c6_cam_http_frame(), internal_c6_cam_http_stream(), internal_c6_cam_join(), internal_c6_cam_prepare_camera(), internal_c6_cam_prepare_link(), internal_c6_cam_prepare_media(), internal_c6_cam_report_fault(), internal_c6_cam_setup_or_halt(), internal_c6_cam_worker_entry(), internal_report_capture_events(), internal_report_jpeg_status_detail(), internal_report_sccb_state(), sensor_report_register(), and tx_application_define().