Lora-net/sx1302_hal

How to control GPIO8 and GPIO9 of SX1302 as outputs?

Closed this issue · 0 comments

I want to use SX1302 to operate LNA, I don't know how to do it? Only see the use of GPIO6.
I did this without success:
init
/* Select GPIO_8 to be controlled by HOST /
lgw_reg_w(SX1302_REG_GPIO_GPIO_SEL_8_11_GPIO_8_SEL, 0);
/
Configure it as an OUTPUT */
lgw_reg_w(SX1302_REG_GPIO_GPIO_DIR_L_DIRECTION, 0xFF);

/* Select GPIO_9 to be controlled by HOST */

lgw_reg_w(SX1302_REG_GPIO_GPIO_SEL_8_11_GPIO_11_9_SEL, 0);
/* Configure it as an OUTPUT */
lgw_reg_w(SX1302_REG_GPIO_GPIO_DIR_L_DIRECTION, 0xFF);

out:
//GPIO8 High
lgw_reg_w(SX1302_REG_GPIO_GPIO_OUT_L_OUT_VALUE, 256);
wait_ms(100);
// GPIO8 low
lgw_reg_w(SX1302_REG_GPIO_GPIO_OUT_L_OUT_VALUE, 0);
//GPIO9 High
lgw_reg_w(SX1302_REG_GPIO_GPIO_OUT_L_OUT_VALUE, 512);
wait_ms(100);
// GPIO9 low
lgw_reg_w(SX1302_REG_GPIO_GPIO_OUT_L_OUT_VALUE, 0);