rt-thread-official/bsp/ls1cdev/libraries/ls1c_pin.h

44 lines
872 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 引脚功能(普通gpiopwm复用等)相关接口
#ifndef __OPENLOONGSON_PIN_H
#define __OPENLOONGSON_PIN_H
// 引脚用途
typedef enum
{
PIN_PURPOSE_GPIO = 0, // 引脚用作普通gpio
PIN_PURPOSE_OTHER, // 引脚用作其它功能(非gpio)
}pin_purpose_t;
// 引脚复用
typedef enum
{
PIN_REMAP_FIRST = 0, // 第一复用
PIN_REMAP_SECOND, // 第二复用
PIN_REMAP_THIRD, // 第三复用
PIN_REMAP_FOURTH, // 第四复用
PIN_REMAP_FIFTH, // 第五复用
}pin_remap_t;
/*
* 把指定pin设置为指定用途(普通gpio非gpio)
* @gpio gpio引脚编号
* @purpose 用途
*/
void pin_set_purpose(unsigned int gpio, pin_purpose_t purpose);
/*
* 设置指定pin为第n复用
* @gpio gpio编号
* @remap 第n复用
*/
void pin_set_remap(unsigned int gpio, pin_remap_t remap);
#endif