ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_nsc_cgc.c
Go to the documentation of this file.
1
19
20#include "ra8_nsc_cgc.h"
21
22#include <stdint.h>
23
24#include "ra8_cgc.h"
25#include "ra8_check.h"
26#include "ra8_err.h"
27#include "ra8_nsc_veneer.h"
28
35static const char* s_tag = "NSCCGC";
36
64 uint8_t mul_quarters,
65 ra8_plodiv_t p_div_code)
66{
67 return ra8_cgc_pll2_enable(mul_int, mul_quarters, p_div_code);
68}
69
94
122{
123 RA8_CHECK_NULL_PTR(hz_out, s_tag, "cgc_get_clock_hz: hz_out");
124 RA8_NSC_CHECK_NS_RANGE_RW(hz_out, sizeof(*hz_out));
125 return ra8_cgc_get_clock_hz(id, hz_out);
126}
static const char * s_tag
Logging / check tag.
Definition ra8_app.c:17
#define RA8_NSC_VENEER
Mark a TrustZone Secure-to-Non-Secure entry-point veneer.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
Definition ra8_cgc.c:132
ra8_err_t ra8_cgc_pll2_enable(uint8_t mul_int, uint8_t mul_quarters, ra8_plodiv_t p_div_code)
Bring up PLL2 with caller-supplied multiplier and P divider.
ra8_clock_id_t
Identifiers for the clock-tree frequencies queryable at runtime.
Definition ra8_cgc.h:69
ra8_err_t ra8_cgc_usbfs_clock_enable(void)
Bring up the USB-FS module clock (USBCKCR / USBCKDIVCR).
ra8_plodiv_t
PLL output divider codes for PLODIVP/Q/R fields in PLLCCR2.
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
Definition ra8_check.h:243
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
ra8_err_t ra8_nsc_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *hz_out)
NSC veneer: query a clock-tree frequency.
ra8_err_t ra8_nsc_cgc_pll2_enable(uint8_t mul_int, uint8_t mul_quarters, ra8_plodiv_t p_div_code)
NSC veneer: bring up PLL2 with the given multiplier and divider.
Definition ra8_nsc_cgc.c:63
ra8_err_t ra8_nsc_cgc_usbfs_clock_enable(void)
NSC veneer: bring up the USB-FS module clock.
Definition ra8_nsc_cgc.c:90
NSC veneers for the Clock Generation Circuit (CGC) driver.
Macros for declaring Non-Secure Callable veneer functions.
#define RA8_NSC_CHECK_NS_RANGE_RW(ptr, len)
RA8 NSC CHECK NS RANGE RW.