ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_agt_regs.h
Go to the documentation of this file.
1
21
22#pragma once
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#include <stdint.h>
29
30#include "ra8_attributes.h"
31
32typedef enum : uintptr_t {
33 k_ra8_agt0_base_addr = 0x40221000UL,
35
36typedef enum : uint16_t {
40
54
68
84
93
100typedef enum : uint16_t {
103
117
128
140typedef struct {
141 volatile uint16_t AGT;
142 volatile uint16_t AGTCMA;
143 volatile uint16_t AGTCMB;
144 volatile uint16_t _r0;
145 volatile uint8_t AGTCR;
146 volatile uint8_t AGTMR1;
147 volatile uint8_t AGTMR2;
148 volatile uint8_t AGTIOSEL_ALT;
149 volatile uint8_t AGTIOC;
150 volatile uint8_t AGTISR;
151 volatile uint8_t AGTCMSR;
152 volatile uint8_t AGTIOSEL;
154
157static inline volatile r_agt_regs_t* ra8_agt(uint8_t channel)
158{
159 if ((uint16_t)channel >= k_ra8_agt_channel_count) {
160 return nullptr;
161 }
162 return (volatile r_agt_regs_t*)(k_ra8_agt0_base_addr +
163 ((uintptr_t)channel * (uintptr_t)k_ra8_agt_channel_stride));
164}
165
166#ifdef __cplusplus
167}
168#endif
static volatile r_agt_regs_t * ra8_agt(uint8_t channel)
Get pointer to AGT channel N.
ra8_agt_cascade_channels_t
Cascade-mode channel indices.
@ k_ra8_agt_cascade_lo_channel
Low 16 bits live in AGT0.
@ k_ra8_agt_cascade_hi_channel
High 16 bits live in AGT1.
ra8_agt_agtcr_bits_t
AGTCR (AGT Control Register) bit positions.
@ k_ra8_agt_agtcr_tcstf_pos
Count status flag (RO).
@ k_ra8_agt_agtcr_tstart_pos
Start request (RW).
@ k_ra8_agt_agtcr_tundf_pos
Underflow flag (RW1C).
@ k_ra8_agt_agtcr_tcmaf_pos
Compare-match A (RW1C).
@ k_ra8_agt_agtcr_tstop_pos
Forced stop (W).
@ k_ra8_agt_agtcr_tcmbf_pos
Compare-match B (RW1C).
@ k_ra8_agt_agtcr_tedgf_pos
Active edge flag (RW1C).
ra8_agt_agtmr1_fields_t
AGTMR1 (AGT Mode Register 1) field encodings.
@ k_ra8_agt_agtmr1_tmod_timer
TMOD = 000b.
@ k_ra8_agt_agtmr1_tmod_pulse_output
TMOD = 001b.
@ k_ra8_agt_agtmr1_tck_pclkb
TCK = 000b @ bit 4.
@ k_ra8_agt_agtmr1_tmod_mask
TMOD[2:0] field mask.
@ k_ra8_agt_agtmr1_tck_pclkb_div2
TCK = 011b @ bit 4.
@ k_ra8_agt_agtmr1_tck_pclkb_div8
TCK = 001b @ bit 4.
@ k_ra8_agt_agtmr1_tck_mask
TCK[2:0] field mask.
@ k_ra8_agt_agtmr1_tmod_event_count
TMOD = 010b.
@ k_ra8_agt_agtmr1_tck_agt0_underflow
TCK = 101b (AGT1 only).
ra8_agt_limits_t
@ k_ra8_agt_channel_count
RA8 AGT channel count.
@ k_ra8_agt_channel_stride
RA8 AGT channel stride.
ra8_agt_agtcr_masks_t
AGTCR bit masks.
@ k_ra8_agt_agtcr_tstart_msk
RA8 AGT agtcr tstart msk.
@ k_ra8_agt_agtcr_status_msk
TEDGF|TUNDF|TCMAF|TCMBF.
@ k_ra8_agt_agtcr_tcmaf_msk
Compare-match A flag.
@ k_ra8_agt_agtcr_tundf_msk
Underflow flag.
@ k_ra8_agt_agtcr_tcstf_msk
RA8 AGT agtcr tcstf msk.
@ k_ra8_agt_agtcr_tcmbf_msk
Compare-match B flag.
@ k_ra8_agt_agtcr_tstop_msk
RA8 AGT agtcr tstop msk.
ra8_agt_compare_sentinel_t
Compare-match register "parked" sentinel.
@ k_ra8_agt_compare_parked_value
RA8 AGT compare parked value.
ra8_agt_agtioc_masks_t
AGTIOC (AGT I/O Control Register) bit masks.
@ k_ra8_agt_agtioc_tedgsel_msk
Output polarity bit 0.
@ k_ra8_agt_agtioc_toe_msk
AGTOn pin output enable.
ra8_agt_addr_t
@ k_ra8_agt0_base_addr
RA8 agt0 base address.
ra8_agt_agtcmsr_masks_t
AGTCMSR (AGT Compare Match Function Select) bit masks.
@ k_ra8_agt_agtcmsr_tcmea_msk
Compare match A enable.
@ k_ra8_agt_agtcmsr_topolb_msk
AGTOBn output polarity.
@ k_ra8_agt_agtcmsr_toeb_msk
AGTOBn output enable.
@ k_ra8_agt_agtcmsr_tcmeb_msk
Compare match B enable.
@ k_ra8_agt_agtcmsr_topola_msk
AGTOAn output polarity.
@ k_ra8_agt_agtcmsr_toea_msk
AGTOAn output enable.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_HW_REGISTER_ACCESS
Mark an MMIO accessor function (returns volatile register pointer).
AGT (16-bit view) register layout, one per channel.
volatile uint8_t AGTMR2
+0x0A Mode 2.
volatile uint8_t AGTCR
+0x08 Control.
volatile uint16_t AGTCMA
+0x02 Compare Match A.
volatile uint8_t AGTIOC
+0x0C I/O Control.
volatile uint16_t AGT
+0x00 16-bit counter.
volatile uint8_t AGTISR
+0x0D Event Pin Select.
volatile uint16_t _r0
+0x06 reserved.
volatile uint8_t AGTCMSR
+0x0E Compare Match Function.
volatile uint8_t AGTIOSEL
+0x0F Pin Select.
volatile uint8_t AGTMR1
+0x09 Mode 1.
volatile uint8_t AGTIOSEL_ALT
+0x0B Pin Select (alt alias).
volatile uint16_t AGTCMB
+0x04 Compare Match B.