|
你好,请问:
3 e$ ^8 A& ~9 ^2 u0 ~咨询你个问题:我是omapl138芯片,自带arm和dsp;1 A0 Y3 |0 V2 {% m. [
arm linux已经运行,dsp端操作gpio,arm端通过syslink控制dsp端gpio操作,在dsp端的gpio操作需要什么样的配置?与arm是否会冲突?是否有相关demo?/ Z* \( j& \( i S0 X; ] z
# `, a8 t% l! d9 ?' ~! b( W) J g9 Y7 q# t% s1 E4 \
我dsp端的gpio初始化:6 `, @4 H( V) F; f' q
#define PINMUX0_GPIO0_13_ENABLE (SYSCFG_PINMUX0_PINMUX0_11_8_GPIO0_13 << \
o: @, s4 O& F0 C SYSCFG_PINMUX0_PINMUX0_11_8_SHIFT)
) S6 ]/ _/ i3 z5 g/ G" H7 s; d3 s( h+ f! S+ z, D V
void GPIOBank0Pin13PinMuxSetup(void)6 Y$ v. [+ T+ n0 F6 B7 T0 t L
{8 d- X4 D. w5 K
unsigned int savePinmux = 0;
. e; I, b' d: \' P N0 ~' O; W. Z6 v! [2 l
/*
& Q9 C# \& K8 T% j! T7 F% [3 Z3 z ** Clearing the bit in context and retaining the other bit values3 }2 J: R: x4 v: S9 {4 E% t1 z
** in PINMUX0 register.+ P: f5 K8 x5 _7 |1 u# d. y% U
*/8 \# ?) s0 Z0 `1 ^
savePinmux = (HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(0)) &* Z" \; |- N5 ^: a# h. B, g! A
~(SYSCFG_PINMUX0_PINMUX0_11_8));
+ R( t) z, D) a; Q: H* U! U% ^# g
0 T" Z+ e9 t: P3 S9 ^5 G8 H( i# b /* Setting the pins corresponding to GP0[13] in PINMUX14 register.*/* R, C5 ~2 _; W# R& o7 l1 Z u
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(0)) =! s& F- z1 M2 K
(PINMUX0_GPIO0_13_ENABLE | savePinmux);( X2 Y B7 D. P3 D/ O
W, M/ d/ R% z& \
} {# D( X& l: A- f
' e. C/ v- Z8 z! J, ~2 ~- q
9 x& K% i* [# e: _$ w2 S! v, _1 tint init(){
& q% L0 z1 r* Q' W" L% DPSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON, PSC_MDCTL_NEXT_ENABLE);3 u/ n' A! k7 W! ~
$ s( W) Z( ~4 R* z* cGPIOBank0Pin13PinMuxSetup();: j& \8 I' X% b& r
# I* E& r5 [# }- `
GPIODirModeSet(SOC_GPIO_0_REGS, FPP_NSTATUS_GPIO0_13, GPIO_DIR_INPUT);
$ k3 K: l# m$ w# r
/ \: a- i: g( p, A o5 |' q, t}
, N. y- R2 _% N( i( J- p; I: P( H9 y: f
这个样初始化是否有问题?是否会跟arm端冲突?$ M4 K3 e: ^# Z: s
|
|