I'm testing various hardware functions of the BCM2073x devices, and am currently on the IR_TX output.
This post has really helped me:
#define BUFFER_SIZE 16
#define HIGH(value) (value | HW_MIA_IR_CMD_IR_RAW_BIT_MASK)
#define LOW(value) (value & ~(HW_MIA_IR_CMD_IR_RAW_BIT_MASK)
// 1<<15==0x8000 == HW_MIA_IR_CMD_IR_RAW_BIT_MASK when this bit is set, it should be 1, if not, zero (unless control inverts it.)
// max value: 0x7FFF=32768 microseconds, or 32 milliseconds
/// IR TX initialization routine.
//(1) Configure the IrTx Port and Pin to be used
ble_trace1("P4: %x", gpio_getPinConfig(GPIO_PIN_P4/16, GPIO_PIN_P4%16)); //=> 0x0010 == GPIO_KS_OUTPUT_ENABLE
irtxClockSet.invertOutput=1; //Invert HIGH and LOW if true
irtxClockSet.modulateFreq=38000; //Modulation frequency 38KHz
irtxClockSet.clockSrcFreq=ACLK_FREQ_24_MHZ; //I assume it works as ACLK, so use defines from aclk.h
//Prepare an array to send
send_buffer=HIGH(208); //Stay high for 208us
send_buffer=LOW(834); //Stay low for 834us
send_buffer=HIGH(417); //Stay high for 417us
irtx_sendData(send_buffer, 16, irtxClockSet);
//while (! irtx_isAvailable()); //Hardware IR Bloc is turned off during deep sleep
//We must wait until the transmission is done before going to sleep
This seems to work very well (I call myirtx_init at the end of the app_create() funciton, and myirtx_tx_something in the button interrupt routine)
I'm also able to invert the output by setting irtxClockSet.invertOutput=1; or 0 respectively. However, the inversion only inverts the transmission, but not the idle state, so it's not very helpful at all. Idle seems to be low at all times.
I've tried a few things, such as adding a GPIO_PULL_UP, but this has no effect.
I've also tried manually using gpio_configure to output high, right after irtx_setIrTxPortPin, and only changing that just before irtx_sendData. This might work in a pinch, but does not pull up the line after transmission is done, and because the tx_done interrupt does not seem to be available to us, I can't manually use gpioconfigure or setoutput to pull it up again immediately after transmission.
Could someone from Broadcom tell us if this is expected behaviour (that the idle state is unaffected by "invertOutput")? If not, could you give us a solution to fix this?
I could imagine the only real purpose for the invertOutput would be to connect the TX IR diode differently, ie between VDD and IR_TX_PIN rather than between IR_TX_PIN and GND... but then the idle state would need to be inverted too, right?
I'm also very interested in IR_RX functionality, any more info on this would be great!