i.MX6ULL EVK - Toggle BT_nPWD (BT_PWD_L)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

i.MX6ULL EVK - Toggle BT_nPWD (BT_PWD_L)

跳至解决方案
1,288 次查看
daweichen
Contributor III

Hi NXP,

Per the i.MX6ULL EVK schematic, BT_nPWD is routed to a serial-in-and-parallel-out register.

I am using the default imx6ull-14x14-evk.dts for NXP's i.MX6ULL EVK board.

Is there a way for me to toggle the state of this signal (BT_nPwD) via a Linux's user-space command during run-time?

I guess the alternative is to re-purpose (rewire) the BT_DISABLE, which I don't need for my Bluetooth module.

Thanks!

Dawei

标签 (2)
0 项奖励
1 解答
1,164 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

in general it is possible as for example below

SPI Example: olinuxino GPIO expander 

Best regards
igor

在原帖中查看解决方案

7 回复数
1,164 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

BT_nPwD is controlled by 74LV595PW  U2101  serial-out shift register

and I am afraid it not can be used directly through linux user-space commands.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
1,164 次查看
daweichen
Contributor III

Hi Igor,

Thank you for the clarification. 

Is there a way to toggle the state of the signal?  (understand it can't be changed via a user-space command.)

dawei

0 项奖励
1,164 次查看
daweichen
Contributor III

It looks like it can be changed through the DTS file.

                gpio_spi: gpio_spi@0 {
                        compatible = "fairchild,74hc595";
                        gpio-controller;
                        #gpio-cells = <2>;
                        reg = <0>;
                        registers-number = <1>;
                        registers-default = /bits/ 8 <0x57>;
                        spi-max-frequency = <100000>;

0 项奖励
1,164 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

it is necessary to send to 74LV595 data sequence

for changing that signal. One can look at 74LV595 datasheet

for more details. One can find on web helpful tutorials for gpio expanders, like:

Interfacing an I2C GPIO expander (MCP23017) to the Raspberry Pi using C++ (i2cdev) · Hertaville.com 

Best regards
igor

0 项奖励
1,164 次查看
daweichen
Contributor III

Hi Igor,

I would like to do something quick. 

Would I be able to export BT_DISABLE (SNVS_TAMPER1) to sysfs and toggle the state by using the echo command?

If so, would you be able to tell my the correspond GPIO number?

Example: 

echo 106 > /sys/class/gpio/export

echo out > /sys/class/gpio/gpio106/direction
echo 0 > /sys/class/gpio/gpio106/value

Thanks,

dawei

0 项奖励
1,165 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Dawei

in general it is possible as for example below

SPI Example: olinuxino GPIO expander 

Best regards
igor

1,164 次查看
daweichen
Contributor III

Thank you very much, Igor.

I was able to export the gpio508 to sysfs and toggle the discrete output (BT_nPWD) state. 

By doing an "ls -la" command in the /sys/class/gpio directory command, I was able to see the spi-gpio expander starts with gpio number 504.

0 项奖励