lpcware

LPC11xx ADCInit confusion

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by corwinb on Tue Feb 12 10:01:01 MST 2013
The below code snippet is from the ADCInit function in the adc example.  Don't understand why the first two instructions (&=, |=) exist.  Why not just do the =?  Is this just a copy and paste issue?

  LPC_IOCON->R_PIO0_11 &= ~0x8F; /*  ADC I/O config */
  LPC_IOCON->R_PIO0_11 |= 0x02;  /* ADC IN0 */
  ...
  ...
  ...
  LPC_IOCON->R_PIO0_11   = 0x02;// Select AD0 pin function

Outcomes