VSF Documented
io.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __HAL_DRIVER_NUVOTON_M484_IO_H__
19#define __HAL_DRIVER_NUVOTON_M484_IO_H__
20
21/*============================ INCLUDES ======================================*/
22#include "hal/vsf_hal_cfg.h"
23#include "../../device.h"
24
25/*============================ MACROS ========================================*/
26
27#define __IO_PINA_NUM(__N, __OFFSET) PA##__N = (__OFFSET) + (__N), \
28 PA##__N##_idx = (__OFFSET) + (__N),
29#define __IO_PINB_NUM(__N, __OFFSET) PB##__N = (__OFFSET) + (__N), \
30 PB##__N##_idx = (__OFFSET) + (__N),
31
32#define __IO_PINA_MSK(__N, __OFFSET) PA##__N##_msk = (1ul<<(__N)),
33#define __IO_PINB_MSK(__N, __OFFSET) PB##__N##_msk = (1ul<<(__N)),
34
35/*============================ MACROFIED FUNCTIONS ===========================*/
36/*============================ TYPES =========================================*/
37
38struct gpio_reg_t {
39 union {
40 volatile uint32_t OUT;
41 volatile uint32_t IN;
42 };
43 volatile uint32_t : 32;
44 volatile uint32_t DIR;
45 volatile uint32_t : 32;
46 volatile uint32_t : 32;
47 volatile uint32_t : 32;
48 volatile uint32_t : 32;
49 volatile uint32_t : 32;
50 volatile uint32_t : 32;
51 volatile uint32_t : 32;
52 volatile uint32_t : 32;
53 volatile uint32_t : 32;
54 volatile uint32_t : 32;
55 volatile uint32_t : 32;
56 volatile uint32_t : 32;
57};
58typedef struct gpio_reg_t gpio_reg_t;
59
60struct vsf_gpio_t {
62};
63
67#if defined(PIO_PORTA)
69#endif
70#if defined(PIO_PORTB)
72#endif
73};
75
79#if defined(PIO_PORTA)
81#endif
82#if defined(PIO_PORTB)
84#endif
85};
87
91#if defined(PIO_PORTA)
92 PORTA, PORTA_idx = PORTA,
93#endif
94#if defined(PIO_PORTB)
95 PORTB, PORTB_idx = PORTB,
96#endif
97};
99
109
114
116
117
119/*
120 VSF_IO_INVERT_INPUT = (1<<6), //!< invert the input pin level
121
122
123 VSF_IO_FILTER_BYPASS = (0<<11), //!< filter is bypassed
124 VSF_IO_FILTER_2CLK = (1<<11), //!< levels should keep 2 clks
125 VSF_IO_FILTER_4CLK = (2<<11), //!< levels should keep 4 clks
126 VSF_IO_FILTER_8CLK = (3<<11), //!< levels should keep 8 clks
127
128 VSF_IO_FILTER_CLK_SRC0 = (0<<13), //!< select clock src 0 for filter
129 VSF_IO_FILTER_CLK_SRC1 = (1<<13), //!< select clock src 1 for filter
130 VSF_IO_FILTER_CLK_SRC2 = (2<<13), //!< select clock src 2 for filter
131 VSF_IO_FILTER_CLK_SRC3 = (3<<13), //!< select clock src 3 for filter
132 VSF_IO_FILTER_CLK_SRC4 = (4<<13), //!< select clock src 4 for filter
133 VSF_IO_FILTER_CLK_SRC5 = (5<<13), //!< select clock src 5 for filter
134 VSF_IO_FILTER_CLK_SRC6 = (6<<13), //!< select clock src 6 for filter
135 VSF_IO_FILTER_CLK_SRC7 = (7<<13), //!< select clock src 7 for filter
136
137
138 VSF_IO_HIGH_DRV = (1<<9), //!< enable high drive strength
139 VSF_IO_HIGH_DRIVE = (1<<9), //!< enable high drive strength
140 VSF_IO_HIGH_DRIVE_STRENGTH = (1<<9), //!< enable high drive strength
141*/
142};
144
145/*============================ GLOBAL VARIABLES ==============================*/
146/*============================ LOCAL VARIABLES ===============================*/
147/*============================ INCLUDES ======================================*/
148
149#include "hal/driver/common/template/vsf_template_io.h"
150
151/*============================ PROTOTYPES ====================================*/
152
153#endif
154/* EOF */
@ IO_BIDIRECTION
Definition io.h:49
@ IO_INPUT_PU
Definition io.h:39
@ IO_OUTPUT_OPEN_DRAIN
Definition io.h:47
@ VSF_IO_DISABLE_INPUT
disable input
Definition io.h:52
@ IO_OUTPUT_PUSHPULL
Definition io.h:45
@ IO_INPUT_PULLUP
Definition io.h:40
@ IO_INPUT_PULLDOWN
Definition io.h:42
@ IO_ANALOG_INPUT
Definition io.h:37
@ IO_OUTPUT_PP
Definition io.h:44
@ IO_INPUT_PD
Definition io.h:41
@ IO_INPUT_FLOAT
Definition io.h:38
@ IO_OUTPUT_OD
Definition io.h:46
#define PIO_PORTB_PIN_NUM
Definition device.h:55
#define __IO_PINB_MSK(__N, __OFFSET)
Definition io.h:33
#define __IO_PINA_NUM(__N, __OFFSET)
Definition io.h:27
io_model_t
Definition io.h:102
#define __IO_PINB_NUM(__N, __OFFSET)
Definition io.h:29
vsf_io_pin_msk_t
Definition io.h:78
#define __IO_PINA_MSK(__N, __OFFSET)
Definition io.h:32
vsf_io_pin_no_t
Definition io.h:66
vsf_io_port_no_t
Definition io.h:90
#define PIO_PORTA_PIN_NUM
Definition device.h:57
unsigned uint32_t
Definition stdint.h:9
Definition io.h:38
volatile uint32_t
Definition io.h:43
volatile uint32_t DIR
Definition io.h:44
volatile uint32_t OUT
Definition io.h:40
volatile uint32_t IN
Definition io.h:41
Definition vsf_template_gpio.h:471
gpio_reg_t * reg
Definition io.h:61
#define VSF_MREPEAT(__COUNT, __MACRO, __PARAM)
Definition vsf_repeat_macro.h:51