|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
NSC veneers for the I/O drivers. More...
#include <stdint.h>#include "ra8_acmphs.h"#include "ra8_adc.h"#include "ra8_crc.h"#include "ra8_dac_b.h"#include "ra8_err.h"#include "ra8_eth.h"#include "ra8_glcdc.h"#include "ra8_gpt.h"#include "ra8_nsc_veneer.h"#include "ra8_pdm.h"Go to the source code of this file.
Functions | |
| ra8_err_t | ra8_nsc_gpt_init (uint8_t channel, const ra8_gpt_cfg_t *cfg) |
| NSC veneer: bring up a GPT channel. | |
| ra8_err_t | ra8_nsc_gpt_read (uint8_t channel, uint32_t *out) |
| NSC veneer: read the current GPT counter value. | |
| ra8_err_t | ra8_nsc_adc_init (void) |
| NSC veneer: bring up the ADC. | |
| ra8_err_t | ra8_nsc_adc_read_channel (uint8_t channel, uint16_t *out_raw) |
| NSC veneer: read one ADC channel sample. | |
| ra8_err_t | ra8_nsc_dac_b_init (void) |
| NSC veneer: bring up the DAC. | |
| ra8_err_t | ra8_nsc_dac_b_write (uint8_t channel, uint16_t value) |
| NSC veneer: write a 12-bit value to a DAC channel. | |
| ra8_err_t | ra8_nsc_acmphs_init (void) |
| NSC veneer: bring up the high-speed analog comparator block. | |
| ra8_err_t | ra8_nsc_acmphs_read_output (uint8_t channel, ra8_level_t *out) |
| NSC veneer: read a comparator output level. | |
| ra8_err_t | ra8_nsc_crc_init (ra8_crc_poly_t poly) |
| NSC veneer: bring up the CRC unit with a polynomial. | |
| ra8_err_t | ra8_nsc_crc_compute (const uint8_t *data, uint32_t len, uint32_t *out_crc) |
| NSC veneer: compute CRC over a buffer. | |
| ra8_err_t | ra8_nsc_glcdc_init (const ra8_glcdc_config_t *cfg) |
| NSC veneer: bring up the graphics LCD controller. | |
| ra8_err_t | ra8_nsc_pdm_init (void) |
| NSC veneer: bring up the PDM microphone interface. | |
| ra8_err_t | ra8_nsc_eth_init (void) |
| NSC veneer: bring up the ethernet switch module. | |
NSC veneers for the I/O drivers.
Retrofit veneers for the analog / safety / display / audio / ethernet drivers (ra8_gpt, ra8_adc, ra8_dac_b, ra8_acmphs, ra8_crc, ra8_glcdc, ra8_pdm, ra8_eth). Each veneer is a Non-Secure Callable entry point that validates pointer arguments and forwards to the secure-side Ring-3 driver.
MTU/TPU listed in the original plan are not present on the RA8D2 (see the scope-correction note in the roadmap) so they have no veneers here.
This layer ships init + the most-used primitive per driver. The remaining surface is straightforward to add by following the same pattern; deferred to land alongside the first NS consumer.
Definition in file ra8_nsc_io.h.
|
nodiscard |
NSC veneer: bring up the high-speed analog comparator block.
Forwards to ra8_acmphs_init.
| k_ra8_ok | Comparators ready. |
| k_ra8_err_hw_init_failed | Hardware refused init. |
Definition at line 230 of file ra8_nsc_io.c.
References ra8_acmphs_init(), and RA8_NSC_VENEER.
|
nodiscard |
NSC veneer: read a comparator output level.
Range-checks out in NS memory and forwards to ra8_acmphs_read_output.
| [in] | channel | Comparator channel index. |
| [out] | out | NS destination for the level enum. |
| k_ra8_ok | Level stored at *out. |
| k_ra8_err_null_ptr | out was NULL. |
| k_ra8_err_invalid_arg | Range outside NS region. |
Definition at line 260 of file ra8_nsc_io.c.
References ra8_acmphs_read_output(), RA8_CHECK_NULL_PTR, RA8_NSC_CHECK_NS_RANGE_RW, RA8_NSC_VENEER, and s_tag.
|
nodiscard |
NSC veneer: bring up the ADC.
Forwards to ra8_adc_init. No arguments and no pointers cross the boundary.
| k_ra8_ok | ADC ready. |
| k_ra8_err_hw_init_failed | Hardware refused init. |
Definition at line 119 of file ra8_nsc_io.c.
References ra8_adc_init(), and RA8_NSC_VENEER.
|
nodiscard |
NSC veneer: read one ADC channel sample.
Range-checks out_raw in NS memory and forwards to ra8_adc_read_channel.
| [in] | channel | ADC channel index. |
| [out] | out_raw | NS destination for the 16-bit raw sample. |
| k_ra8_ok | Sample stored at *out_raw. |
| k_ra8_err_null_ptr | out_raw was NULL. |
| k_ra8_err_invalid_arg | Range outside NS region. |
Definition at line 150 of file ra8_nsc_io.c.
References ra8_adc_read_channel(), RA8_CHECK_NULL_PTR, RA8_NSC_CHECK_NS_RANGE_RW, RA8_NSC_VENEER, and s_tag.
|
nodiscard |
NSC veneer: compute CRC over a buffer.
Range-checks data (read) and out_crc (write) in NS memory then forwards to ra8_crc_compute.
| [in] | data | NS source buffer. |
| [in] | len | Byte count. |
| [out] | out_crc | NS destination for the 32-bit CRC value. |
| k_ra8_ok | CRC stored at *out_crc. |
| k_ra8_err_null_ptr | A pointer argument was NULL. |
| k_ra8_err_invalid_arg | Range outside NS region. |
Definition at line 322 of file ra8_nsc_io.c.
References RA8_CHECK_NULL_PTR, ra8_crc_compute(), RA8_NSC_CHECK_NS_RANGE_R, RA8_NSC_CHECK_NS_RANGE_RW, RA8_NSC_VENEER, and s_tag.
|
nodiscard |
NSC veneer: bring up the CRC unit with a polynomial.
Forwards to ra8_crc_init. No pointer arguments.
| [in] | poly | Polynomial enum (CRC-8/16/32 selection). |
| k_ra8_ok | CRC engine programmed. |
| k_ra8_err_invalid_arg | Unknown polynomial enum. |
Definition at line 289 of file ra8_nsc_io.c.
References ra8_crc_init(), and RA8_NSC_VENEER.
|
nodiscard |
NSC veneer: bring up the DAC.
NSC veneer: bring up the DAC.
Forwards to ra8_dac_b_init.
| k_ra8_ok | DAC ready. |
| k_ra8_err_hw_init_failed | Hardware refused init. |
Definition at line 177 of file ra8_nsc_io.c.
References ra8_dac_b_init(), and RA8_NSC_VENEER.
|
nodiscard |
NSC veneer: write a 12-bit value to a DAC channel.
NSC veneer: write a 12-bit value to a DAC channel.
Forwards to ra8_dac_b_write. No pointer arguments.
| [in] | channel | DAC channel index. |
| [in] | value | 12-bit value (top 4 bits ignored). |
| k_ra8_ok | Value latched. |
| k_ra8_err_invalid_arg | Bad channel index. |
Definition at line 205 of file ra8_nsc_io.c.
References ra8_dac_b_write(), and RA8_NSC_VENEER.
|
nodiscard |
NSC veneer: bring up the ethernet switch module.
Forwards to ra8_eth_init.
| k_ra8_ok | ESWM up. |
| k_ra8_err_hw_init_failed | Hardware refused init. |
Definition at line 407 of file ra8_nsc_io.c.
References ra8_eth_init(), and RA8_NSC_VENEER.
|
nodiscard |
NSC veneer: bring up the graphics LCD controller.
Range-checks cfg in NS memory and forwards to ra8_glcdc_init.
| [in] | cfg | Caller configuration in NS memory. |
| k_ra8_ok | GLCDC programmed. |
| k_ra8_err_null_ptr | cfg was NULL. |
| k_ra8_err_invalid_arg | Range outside NS region or invalid config. |
Definition at line 355 of file ra8_nsc_io.c.
References RA8_CHECK_NULL_PTR, ra8_glcdc_init(), RA8_NSC_CHECK_NS_RANGE_R, RA8_NSC_VENEER, and s_tag.
|
nodiscard |
NSC veneer: bring up a GPT channel.
Range-checks cfg in NS memory and forwards to ra8_gpt_init.
| [in] | channel | GPT channel index. |
| [in] | cfg | Caller configuration in NS memory. |
| k_ra8_ok | Channel programmed. |
| k_ra8_err_null_ptr | cfg was NULL. |
| k_ra8_err_invalid_arg | cfg outside NS region or channel bad. |
Definition at line 58 of file ra8_nsc_io.c.
References RA8_CHECK_NULL_PTR, ra8_gpt_init(), RA8_NSC_CHECK_NS_RANGE_R, RA8_NSC_VENEER, and s_tag.
|
nodiscard |
NSC veneer: read the current GPT counter value.
Range-checks out in NS writable memory and forwards to ra8_gpt_read.
| [in] | channel | GPT channel index. |
| [out] | out | NS destination for the counter value. |
| k_ra8_ok | Counter read into *out. |
| k_ra8_err_null_ptr | out was NULL. |
| k_ra8_err_invalid_arg | out outside NS region. |
Definition at line 90 of file ra8_nsc_io.c.
References RA8_CHECK_NULL_PTR, ra8_gpt_read(), RA8_NSC_CHECK_NS_RANGE_RW, RA8_NSC_VENEER, and s_tag.
|
nodiscard |
NSC veneer: bring up the PDM microphone interface.
Forwards to ra8_pdm_init.
| k_ra8_ok | PDM ready. |
| k_ra8_err_hw_init_failed | Hardware refused init. |
Definition at line 382 of file ra8_nsc_io.c.
References RA8_NSC_VENEER, and ra8_pdm_init().