P1SEL
配置P1_0和P1_1为外设IO。
举一反三
- 下面哪种代码执行后是与其他结果不一样的? A: module mux2_1(a,b,sel,out); input a,b,sel; output out; assign out=(sel==1)?a:b; endmodule B: module mux2_1(a,b,sel,out); input a,b,sel; output out; reg out; always@(a or b or sel) begin case(sel) 0: out=a; 1: out=b; endcase end endmodule C: module mux2_1(a,b,sel,out); input a,b,sel; output out; reg out; always@(*) if(sel==0) out=a; else out=b; endmodule
- 要求设置P1SEL的第0位为0,使用的代码是:( )。 A: P1SEL &= 0x01; B: P1SEL &= ~0x00; C: P1SEL &= ~0x01; D: P1SEL |= 0x00;
- 在语句assign Y = sel ? 0 : 1;中,当sel=0时,Y的值为( )? z|x|0|1
- 中国大学MOOC: 在语句assign Y = sel ? 0 : 1;中,当sel=0时,Y的值为( )
- 要设置CC2530的引脚P1_0为普通输入输出口,正确的代码是( )。 A: P1SEL &= ~0x10; B: P1SEL &= 0x01; C: P1SEL &= 0x10; D: P1SEL &= ~0x01;
内容
- 0
P1SEL
- 1
P1SEL的作用
- 2
指出下面信号的最高位和最低位。reg [1:0] SEL
- 3
语句P1SEL |= 0x03的作用是()。
- 4
要把CC2530芯片的P1_0、P1_1、P1_7设置为GPIO端口,把P1口的其他引脚设置为外设端口,正确的操作是() A: P1SEL=0xF0 B: P1SEL=0x81 C: P1SEL=0x83 D: P1DIR=0x83