86 lines
2.6 KiB
C
Executable File
86 lines
2.6 KiB
C
Executable File
/****************************************************************************
|
|
|
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of Aerospace C.Power. This Information or any portion
|
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
liability for its use in any way and conveys no license or title under
|
|
any patent or copyright and makes no representation or warranty that this
|
|
Information is free from patent or copyright infringement.
|
|
|
|
****************************************************************************/
|
|
#ifndef _GPIO_MTX_H
|
|
#define _GPIO_MTX_H
|
|
|
|
#include "gpio_mtx_sig.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define DEV_PIN_MAX 8
|
|
#define GPIO_MTX_SIG_INVALID 0xff
|
|
|
|
typedef enum {
|
|
IO_TYPE_NONE = 0,
|
|
IO_TYPE_IN = 1,
|
|
IO_TYPE_OUT = 2,
|
|
IO_TYPE_IO = 3
|
|
} pin_type_t;
|
|
|
|
typedef enum {
|
|
GPIO_MTX_MODE_CORE = 0,
|
|
GPIO_MTX_MODE_MATRIX = 1,
|
|
GPIO_MTX_MODE_MAX =1,
|
|
} gpio_mtx_mode_t;
|
|
|
|
typedef struct {
|
|
uint8_t type;
|
|
uint8_t func;
|
|
uint8_t gpio;
|
|
uint8_t inid;
|
|
uint8_t outid;
|
|
} gpio_sig_t;
|
|
|
|
typedef struct {
|
|
uint8_t sig_type;
|
|
gpio_sig_t CFG[DEV_PIN_MAX];
|
|
} gpio_sig_info_t;
|
|
|
|
void gpio_pin_iinv(uint32_t pin, uint32_t val);
|
|
void gpio_pin_oinv(uint32_t pin, uint32_t val);
|
|
void gpio_pin_wpu(uint32_t pin, uint32_t val);
|
|
void gpio_pin_wpd(uint32_t pin, uint32_t val);
|
|
void gpio_pin_select(uint32_t pin, uint32_t func);
|
|
uint8_t gpio_pin_func_get(uint32_t gpio);
|
|
uint8_t gpio_pin_get_select(uint32_t pin);
|
|
|
|
|
|
void gpio_mtx_sig_in_set_core(uint32_t offset, uint32_t val);
|
|
void gpio_mtx_sig_in_set_def(uint32_t offset, uint32_t val);
|
|
void gpio_mtx_sig_in_set_gpio(uint32_t offset, uint32_t val);
|
|
uint8_t gpio_mtx_sig_in_get_gpio(uint8_t sig_id);
|
|
uint8_t gpio_mtx_gpio_get_sig_out(uint8_t gpio);
|
|
|
|
void gpio_mtx_sig_out_set_sel(uint32_t offset, uint32_t val);
|
|
void gpio_mtx_sig_out_set_sel(uint32_t offset, uint32_t val);
|
|
|
|
void gpio_mtx_sig_in(uint8_t id, uint8_t gpio, uint32_t mode);
|
|
void gpio_mtx_sig_in_default(uint8_t id);
|
|
void gpio_mtx_sig_out(uint8_t id, uint8_t gpio);
|
|
void gpio_mtx_sig_out_default(uint8_t id, uint8_t gpio);
|
|
void gpio_mtx_enable();
|
|
|
|
void gpio_module_pin_select(gpio_sig_info_t *info);
|
|
void gpio_module_sig_select(gpio_sig_info_t *info, uint32_t mode);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif //_GPIO_MTX_H
|