mikroSDK Reference Manual
ci_fs_type.h
1/*
2 * The MIT License (MIT)
3 *
4 * Copyright (c) 2023 Ha Thach (tinyusb.org)
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 *
24 * This file is part of the TinyUSB stack.
25 */
26
27#ifndef _CI_FS_TYPE_H
28#define _CI_FS_TYPE_H
29
30#include <stdint.h>
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36//--------------------------------------------------------------------+
37//
38//--------------------------------------------------------------------+
39
40
41//--------------------------------------------------------------------+
42//
43//--------------------------------------------------------------------+
44
45// Note: some MCUs can only access these registers in 8-bit mode
46// align 4 is used to get rid of reserved fields
47#define _va32 volatile TU_ATTR_ALIGNED(4)
48
49typedef struct {
50 _va32 uint8_t PER_ID; // [00] Peripheral ID register
51 _va32 uint8_t ID_COMP; // [04] Peripheral ID complement register
52 _va32 uint8_t REV; // [08] Peripheral revision register
53 _va32 uint8_t ADD_INFO; // [0C] Peripheral additional info register
54 _va32 uint8_t OTG_ISTAT; // [10] OTG Interrupt Status Register
55 _va32 uint8_t OTG_ICTRL; // [14] OTG Interrupt Control Register
56 _va32 uint8_t OTG_STAT; // [18] OTG Status Register
57 _va32 uint8_t OTG_CTRL; // [1C] OTG Control register
58 uint32_t reserved_20[24]; // [20]
59 _va32 uint8_t INT_STAT; // [80] Interrupt status register
60 _va32 uint8_t INT_EN; // [84] Interrupt enable register
61 _va32 uint8_t ERR_STAT; // [88] Error interrupt status register
62 _va32 uint8_t ERR_ENB; // [8C] Error interrupt enable register
63 _va32 uint8_t STAT; // [90] Status register
64 _va32 uint8_t CTL; // [94] Control register
65 _va32 uint8_t ADDR; // [98] Address register
66 _va32 uint8_t BDT_PAGE1; // [9C] BDT page register 1
67 _va32 uint8_t FRM_NUML; // [A0] Frame number register
68 _va32 uint8_t FRM_NUMH; // [A4] Frame number register
69 _va32 uint8_t TOKEN; // [A8] Token register
70 _va32 uint8_t SOF_THLD; // [AC] SOF threshold register
71 _va32 uint8_t BDT_PAGE2; // [B0] BDT page register 2
72 _va32 uint8_t BDT_PAGE3; // [B4] BDT page register 3
73
74 uint32_t reserved_b8; // [B8]
75 uint32_t reserved_bc; // [BC]
76
77 struct {
78 _va32 uint8_t CTL;
79 }EP[16]; // [C0] Endpoint control register
80
81 //----- Following is only found available in NXP Kinetis
82 _va32 uint8_t USBCTRL; // [100] USB Control register,
83 _va32 uint8_t OBSERVE; // [104] USB OTG Observe register,
84 _va32 uint8_t CONTROL; // [108] USB OTG Control register,
85 _va32 uint8_t USBTRC0; // [10C] USB Transceiver Control Register 0,
86 uint32_t reserved_110; // [110]
87 _va32 uint8_t USBFRMADJUST; // [114] Frame Adjust Register,
88
89 //----- Following is only found available in NXP MCX
90 uint32_t reserved_118[3]; // [118]
91 _va32 uint8_t KEEP_ALIVE_CTRL; // [124] Keep Alive Mode Control,
92 _va32 uint8_t KEEP_ALIVE_WKCTRL; // [128] Keep Alive Mode Wakeup Control,
93 _va32 uint8_t MISCCTRL; // [12C] Miscellaneous Control,
94 _va32 uint8_t STALL_IL_DIS; // [130] Peripheral Mode Stall Disable for Endpoints[ 7..0] IN
95 _va32 uint8_t STALL_IH_DIS; // [134] Peripheral Mode Stall Disable for Endpoints[15..8] IN
96 _va32 uint8_t STALL_OL_DIS; // [138] Peripheral Mode Stall Disable for Endpoints[ 7..0] OUT
97 _va32 uint8_t STALL_OH_DIS; // [13C] Peripheral Mode Stall Disable for Endpoints[15..8] OUT
98 _va32 uint8_t CLK_RECOVER_CTRL; // [140] USB Clock Recovery Control,
99 _va32 uint8_t CLK_RECOVER_IRC_EN; // [144] FIRC Oscillator Enable,
100 uint32_t reserved_148[3]; // [148]
101 _va32 uint8_t CLK_RECOVER_INT_EN; // [154] Clock Recovery Combined Interrupt Enable,
102 uint32_t reserved_158; // [158]
103 _va32 uint8_t CLK_RECOVER_INT_STATUS; // [15C] Clock Recovery Separated Interrupt Status,
105
106TU_VERIFY_STATIC(sizeof(ci_fs_regs_t) == 0x160, "Size is not correct");
107
108typedef struct
109{
110 uint32_t reg_base;
111 uint32_t irqnum;
113
114#ifdef __cplusplus
115 }
116#endif
117
118#endif
Definition ci_fs_type.h:109
Definition ci_fs_type.h:49