I've looked at the range extender 2 driver code, which uses the SKY6111 as an external PA and wish to do the following:
- Output the extrc_txen BLE diagnostic signal to P1_0.
- Output the extrc_rxen BLE diagnostic signal to P1_1.
The reason why the range extender code is not satisfactory to me is because it is hardcoded to use P0_1 and P0_2 and in order to implement the extrc_rxen signal, it inverts the extrc_txen signal. This is the code I'm running in periph_init() (runs everytime the radio wakes up).
Please verify that what I'm doing is indeed extracting the extrc_rxen signal. Furthermore is there any documentation on how to configure the BLE_DIAGCNTL_REG register and how it is routed to the ports. So far I've had my theories, which I think are correct, but it would be really helpful if there was a document.
/* Select diag signals */
SetBits32(BLE_DIAGCNTL_REG, DIAG0, 0x28); // extrc_txen
SetBits32(BLE_DIAGCNTL_REG, DIAG1, 0x28); // rxen=extrc_txen_inv
/* Map to diag port bits */
SetBits32(BLE_DIAGCNTL3_REG, DIAG0_BIT, 3); // extrc_txen
SetBits32(BLE_DIAGCNTL3_REG, DIAG1_BIT, 2); // << GUESSED THIS VALUE
/* Enable diag ports */
SetBits32(BLE_DIAGCNTL_REG, DIAG0_EN, 1);
SetBits32(BLE_DIAGCNTL_REG, DIAG1_EN, 1);
/* Output diag signals to P0 GPIOs */
SetBits16(P10_MODE_REG, PID , 18);
SetBits16(P10_MODE_REG, PUPD, 3);
SetBits16(P11_MODE_REG, PID , 18);
SetBits16(P11_MODE_REG, PUPD, 3);