The L2/R2 are a bit of a mess. They use a pulsed VSS that goes into a voltage divider, and it's speed is either 100Hz or 250Hz depending if it's wireless or connected over USB. The ground half of the voltage divider is the L2/R2 button, the more it's pressed the lower the value of that Resistor. The other side of the divider is a fixed value and connected to the 3.2v supply. When L2/R2 is not pulled, and the controller is not reading them, the pulse is Hi, 3.2v, so the divider output is 3.2v. When the controller reads the L2/R2, it pulses the 2L/2R lines Lo for 120us. the pulsed VSS goes thru the Divider and if L2/R2 are not pulled, the output of the divider will measure ~1.6v, if L2/R2 are pulled all the way the divider output will be ~0.8v or so.
Schematic of how L2 works, R2 is the sameL2 and R2 on the Logic Analyzer. L2 Pressed and released, then R2 Pressed and releasedL2/R2 close up and Not PulledL2/R2 close up and R2 Pulled all the wayThe best way to go about seeing if one of them is pressed is to use 3 I/O in total on your microcontroller. Use a Digital (Input) connected to 2L (or 2R, 2L just go Lo 88ns sooner) then 2 Analog (Inputs) connected to L2 and R2.
When 2L goes Lo, wait at least 5us, then measure the voltages on L2 and R2 to tell if they are pressed or not. You need to wait a little bit so you get a good L2/R2 measurement.
If L2/R2 are not pressed, they will each measure ~1.6v
If they are pulled all the way, they will measure ~0.8v
Those voltages are approximate values, as the Resistors on the Daughter board (the Flex board) are what make up the voltage divider and their values can be a shade different from controller to controller. So doing something like over 1.5v = Not Pressed and under 1.2v = Pressed is a safe bet, unless you're wanting to know exactly how much the Trigger is being pulled, or you can code it up to calibrate the values it reads, plenty of options there.
To 'press' the L2/R2, just change your L2/R2 Analog pins to Digital (Outputs) and drive them Lo. Do not leave them as Outputs, only change them and drive them Lo when they need to be pressed, any other time they should be left floating, as Inputs or the ADC Inputs so they do not mess with how the controller normally works.