cc26xx_cc13xx_rfc.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Locha Inc
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef CC26XX_CC13XX_RFC_H
20 #define CC26XX_CC13XX_RFC_H
21 
22 #include "cc26xx_cc13xx.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 typedef struct {
32  reg32_t CMDR;
33  reg32_t CMDSTA;
34  reg32_t RFHWIFG;
35  reg32_t RFHWIEN;
36  reg32_t RFCPEIFG;
38  reg32_t RFCPEIEN;
40  reg32_t RFCPEISL;
42  reg32_t RFACKIFG;
43  reg32_t SYSGPOCTL;
45 
54 typedef enum {
55  HW_IRQ_FSCA = (1 << 1),
56  HW_IRQ_MDMDONE = (1 << 2),
57  HW_IRQ_MDMIN = (1 << 3),
58  HW_IRQ_MDMOUT = (1 << 4),
59  HW_IRQ_MDMSOFT = (1 << 5),
60  HW_IRQ_TRCTK = (1 << 6),
61  HW_IRQ_RFEDONE = (1 << 8),
62  HW_IRQ_RFESOFT0 = (1 << 9),
63  HW_IRQ_RFESOFT1 = (1 << 10),
64  HW_IRQ_RFESOFT2 = (1 << 11),
65  HW_IRQ_RATCH0 = (1 << 12),
66  HW_IRQ_RATCH1 = (1 << 13),
67  HW_IRQ_RATCH2 = (1 << 14),
68  HW_IRQ_RATCH3 = (1 << 15),
69  HW_IRQ_RATCH4 = (1 << 16),
70  HW_IRQ_RATCH5 = (1 << 17),
71  HW_IRQ_RATCH6 = (1 << 18),
72  HW_IRQ_RATCH7 = (1 << 19)
73 } rf_hw_irq_t;
74 
78 typedef enum {
79  CPE_IRQ_COMMAND_DONE = (1 << 0),
80  CPE_IRQ_LAST_COMMAND_DONE = (1 << 1),
81  CPE_IRQ_FG_COMMAND_DONE = (1 << 2),
82  CPE_IRQ_LAST_FG_COMMAND_DONE = (1 << 3),
83  CPE_IRQ_TX_DONE = (1 << 4),
84  CPE_IRQ_TX_ACK = (1 << 5),
85  CPE_IRQ_TX_CTRL = (1 << 6),
86  CPE_IRQ_TX_CTRL_ACK = (1 << 7),
87  CPE_IRQ_TX_CTRL_ACK_ACK = (1 << 8),
88  CPE_IRQ_TX_RETRANS = (1 << 9),
89  CPE_IRQ_TX_ENTRY_DONE = (1 << 10),
90  CPE_IRQ_TX_BUFFER_CHANGED = (1 << 11),
91 #ifdef CPU_VARIANT_X2
92  CPE_IRQ_COMMAND_STARTED = (1 << 12),
93  CPE_IRQ_FG_COMMAND_STARTED = (1 << 13),
94 #else
95  CPE_IRQ_IRQ12 = (1 << 12),
96  CPE_IRQ_IRQ13 = (1 << 13),
97 #endif
98  CPE_IRQ_IRQ14 = (1 << 14),
99  CPE_IRQ_IRQ15 = (1 << 15),
100  CPE_IRQ_RX_OK = (1 << 16),
101  CPE_IRQ_RX_NOK = (1 << 17),
102  CPE_IRQ_RX_IGNORED = (1 << 18),
103  CPE_IRQ_RX_EMPTY = (1 << 19),
104  CPE_IRQ_RX_CTRL = (1 << 20),
105  CPE_IRQ_RX_CTRL_ACK = (1 << 21),
106  CPE_IRQ_RX_BUF_FULL = (1 << 22),
107  CPE_IRQ_RX_ENTRY_DONE = (1 << 23),
108  CPE_IRQ_RX_DATA_WRITTEN = (1 << 24),
109  CPE_IRQ_RX_N_DATA_WRITTEN = (1 << 25),
110  CPE_IRQ_RX_ABORTED = (1 << 26),
111  CPE_IRQ_IRQ27 = (1 << 27),
112  CPE_IRQ_SYNTH_NO_LOCK = (1 << 28),
113  CPE_IRQ_MODULES_UNLOCKED = (1 << 29),
114  CPE_IRQ_BOOT_DONE = (1 << 30),
115  CPE_IRQ_INTERNAL_ERROR = (1 << 31),
116 } rf_cpe_irq_t;
117 
118 #define RFACKIFG_ACKFLAG 0x1
119 
125 #define RFC_DBELL_BASE (PERIPH_BASE + 0x41000)
126 #define RFC_DBELL_BASE_NONBUF (PERIPH_BASE_NONBUF + 0x41000)
129 #define RFC_DBELL ((rfc_dbell_regs_t *) (RFC_DBELL_BASE))
130 #define RFC_DBELL_NONBUF ((rfc_dbell_regs_t *) (RFC_DBELL_BASE_NONBUF))
135 typedef struct {
136  reg32_t PWMCLKEN;
138 
143 #define PWMCLKEN_RFCTRC 0x400
144 #define PWMCLKEN_FSCA 0x200
145 #define PWMCLKEN_PHA 0x100
146 #define PWMCLKEN_RAT 0x80
147 #define PWMCLKEN_RFERAM 0x40
148 #define PWMCLKEN_MDMRAM 0x10
149 #define PWMCLKEN_MDM 0x8
150 #define PWMCLKEN_CPERAM 0x4
151 #define PWMCLKEN_CPE 0x2
152 #define PWMCLKEN_RFC 0x1
153 
159 #define RFC_PWR_BASE (PERIPH_BASE + 0x40000)
160 #define RFC_PWR_BASE_NONBUF (PERIPH_BASE_NONBUF + 0x40000)
163 #define RFC_PWR ((rfc_pwr_regs_t *) (RFC_PWR_BASE))
164 #define RFC_PWR_NONBUF ((rfc_pwr_regs_t *) (RFC_PWR_BASE_NONBUF))
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* CC26XX_CC13XX_RFC_H */
171 
rfc_pwr_regs_t::PWMCLKEN
reg32_t PWMCLKEN
RF Core Power Management and Clock Enable.
Definition: cc26xx_cc13xx_rfc.h:136
rfc_pwr_regs_t
RFC_PWR registers.
Definition: cc26xx_cc13xx_rfc.h:135
rfc_dbell_regs_t
RFC_DBELL registers.
Definition: cc26xx_cc13xx_rfc.h:31
rfc_dbell_regs_t::RFHWIFG
reg32_t RFHWIFG
Interrupt Flags From RF Hardware Modules.
Definition: cc26xx_cc13xx_rfc.h:34
cc26xx_cc13xx.h
CC26xx, CC13xx definitions.
rf_hw_irq_t
rf_hw_irq_t
RFC_DBELL definitions.
Definition: cc26xx_cc13xx_rfc.h:54
rf_cpe_irq_t
rf_cpe_irq_t
RFCPEIEN/RFCPEIFG/RFCPEISL interrupt flags.
Definition: cc26xx_cc13xx_rfc.h:78
rfc_dbell_regs_t::RFACKIFG
reg32_t RFACKIFG
Doorbell Command Acknowledgement Interrupt Flag.
Definition: cc26xx_cc13xx_rfc.h:42
rfc_dbell_regs_t::RFHWIEN
reg32_t RFHWIEN
Interrupt Enable For RF Hardware Modules.
Definition: cc26xx_cc13xx_rfc.h:35
rfc_dbell_regs_t::SYSGPOCTL
reg32_t SYSGPOCTL
RF Core General Purpose Output Control.
Definition: cc26xx_cc13xx_rfc.h:43
rfc_dbell_regs_t::RFCPEISL
reg32_t RFCPEISL
Interrupt Vector Selection For Command and Packet Engine Generated Interrupts.
Definition: cc26xx_cc13xx_rfc.h:40
rfc_dbell_regs_t::RFCPEIFG
reg32_t RFCPEIFG
Interrupt Flags For Command and Packet Engine Generated Interrupts.
Definition: cc26xx_cc13xx_rfc.h:36
rfc_dbell_regs_t::RFCPEIEN
reg32_t RFCPEIEN
Interrupt Enable For Command and Packet Engine Generated Interrupts.
Definition: cc26xx_cc13xx_rfc.h:38
rfc_dbell_regs_t::CMDSTA
reg32_t CMDSTA
Doorbell Command Status Register.
Definition: cc26xx_cc13xx_rfc.h:33
rfc_dbell_regs_t::CMDR
reg32_t CMDR
Doorbell Command Register.
Definition: cc26xx_cc13xx_rfc.h:32