VSF Documented
__common.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_M480_COMMON_H__
19#define __HAL_DRIVER_NUVOTON_M480_COMMON_H__
20
21/* \note __common.h should only be included by device.h */
22
23/*============================ INCLUDES ======================================*/
24
25#include "hal/vsf_hal_cfg.h"
26#include "./vendor/Include/M480.h"
27#include "hal/arch/vsf_arch.h"
28
29// CMSIS headers which will not be included in core_xxx.h
30// and arm_math.h CAN ONLY be included after core_xxx.h
31#include "arm_math.h"
32
33/*============================ MACROS ========================================*/
34/*============================ MACROFIED FUNCTIONS ===========================*/
35/*============================ TYPES =========================================*/
36
37//typedef void vsf_swi_handler_t(void *p);
38
42};
44
49};
51
52/*============================ GLOBAL VARIABLES ==============================*/
53/*============================ LOCAL VARIABLES ===============================*/
54/*============================ INCLUDES ======================================*/
55/*============================ PROTOTYPES ====================================*/
56
57extern bool m480_reg_unlock(void);
58extern void m480_reg_lock(bool islocked);
59
64
66extern void m480_disable_usbphy(m480_usbphy_t phy);
67
68/* todo: should remove this but keep it for a while
69extern vsf_err_t vsf_drv_swi_init(uint_fast8_t idx, vsf_arch_prio_t priority,
70 vsf_swi_handler_t *handler, void *pparam);
71extern void vsf_drv_swi_trigger(uint_fast8_t idx);
72*/
73#endif
74/* EOF */
m480_usbphy_role_t
Definition __common.h:45
@ M480_USBPHY_HOST
Definition __common.h:47
@ M480_USBPHY_DEV
Definition __common.h:46
@ M480_USBPHY_OTG
Definition __common.h:48
m480_usbphy_t
Definition __common.h:39
@ M480_USBPHY_FS
Definition __common.h:40
@ M480_USBPHY_HS
Definition __common.h:41
uint_fast32_t m480_bit_field_get(uint_fast16_t bf, uint32_t *ptr)
Definition __common.c:53
void m480_bit_field_set_wprotect(uint_fast16_t bf, uint32_t *ptr, uint_fast32_t value)
Definition __common.c:76
void m480_bit_field_set_atom(uint_fast16_t bf, uint32_t *ptr, uint_fast32_t value)
Definition __common.c:63
void m480_bit_field_set(uint_fast16_t bf, uint32_t *ptr, uint_fast32_t value)
Definition __common.c:83
void m480_enable_usbphy(m480_usbphy_t phy, m480_usbphy_role_t role)
Definition __common.c:95
bool m480_reg_unlock(void)
Definition __common.c:35
void m480_disable_usbphy(m480_usbphy_t phy)
Definition __common.c:109
void m480_reg_lock(bool islocked)
Definition __common.c:46
unsigned uint32_t
Definition stdint.h:9
unsigned int uint_fast32_t
Definition stdint.h:27
unsigned short uint_fast16_t
Definition stdint.h:25
vk_av_control_value_t value
Definition vsf_audio.h:171