Files
luban-lite/bsp/common/include/aic_utils.h

59 lines
1.5 KiB
C
Raw Normal View History

2023-08-30 16:21:18 +08:00
/*
2025-04-23 17:54:31 +08:00
* Copyright (c) 2023-2025, ArtInChip Technology Co., Ltd
2023-08-30 16:21:18 +08:00
*
* SPDX-License-Identifier: Apache-2.0
*/
2024-04-03 16:40:57 +08:00
#ifndef __AIC_UTILS_H_
#define __AIC_UTILS_H_
2023-08-30 16:21:18 +08:00
#ifdef __cplusplus
extern "C" {
#endif
2024-09-30 17:06:01 +08:00
#define FLAG_WAKEUP_SOURCE (1)
#define FLAG_POWER_PIN (2)
struct aic_pinmux
{
unsigned char func;
unsigned char bias;
unsigned char drive;
char * name;
/* This flag indicates whether the pin is the wakeup source.
*
* For example:
* 1.The I2C0 is the wakeup source, then you need to set the flag
* of I2C0 pinmux to 1.
* {4, PIN_PULL_DIS, 3, "PD.6", FLAG_WAKEUP_SOURCE}, // SCK
* {4, PIN_PULL_DIS, 3, "PD.7", FLAG_WAKEUP_SOURCE}, // SDA
*
* 2.The GPIO PD6 is the wakeup source, then you need to set the flag
* of PD6 pinmux to 1.
* {1, PIN_PULL_DIS, 3, "PD.6", FLAG_WAKEUP_SOURCE},
*/
unsigned char flag;
};
extern struct aic_pinmux aic_pinmux_config[];
extern uint32_t aic_pinmux_config_size;
2023-08-30 16:21:18 +08:00
void hexdump(unsigned char *buf, unsigned long len, int groupsize);
2024-09-03 11:16:08 +08:00
void hexdump_msg(char *msg, unsigned char *buf, unsigned long len, int groupsize);
2024-04-03 16:40:57 +08:00
void show_speed(char *msg, unsigned long len, unsigned long us);
2024-09-03 11:16:08 +08:00
#ifdef LPKG_USING_FDTLIB
int pinmux_fdt_parse(void);
#endif
2023-08-30 16:21:18 +08:00
2024-09-30 17:06:01 +08:00
void aic_board_pinmux_init(void);
void aic_board_pinmux_deinit(void);
2025-04-23 17:54:31 +08:00
long long int str2int(char *str);
2023-08-30 16:21:18 +08:00
#ifdef __cplusplus
}
#endif
2024-04-03 16:40:57 +08:00
#endif /* __AIC_UTILS_H_ */