Thi s library works either for lpc1768 or lpc4088 QSB
Fork of I2SSlave by
Revision 6:ed59a9124517, committed 2016-07-23
- Comitter:
- Grag38
- Date:
- Sat Jul 23 21:07:00 2016 +0000
- Parent:
- 5:9dfdde33be7e
- Commit message:
- I2SSlave Library for LPC4088 and LPC1768 Mbed
Changed in this revision
I2SSlave.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 9dfdde33be7e -r ed59a9124517 I2SSlave.cpp --- a/I2SSlave.cpp Wed Jan 08 05:20:45 2014 +0000 +++ b/I2SSlave.cpp Sat Jul 23 21:07:00 2016 +0000 @@ -307,6 +307,11 @@ ******************************************************/ void I2SSlave::setPins_(PinName tx_sda, PinName tx_ws, PinName clk, PinName rx_sda, PinName rx_ws){ #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) + + + printf(" *** TAGET LPC1768 || LPC2368 ***"); + + if(rx_ws == p29){ LPC_PINCON->PINSEL0 |= (1 << 10); //set p29 as receive word select line } else { @@ -322,8 +327,11 @@ LPC_PINCON->PINSEL0 |= (1 << 18); //set p5 as transmit serial data line (only one of these) LPC_PINCON->PINSEL0 |= (0 << 8); //clear rx_clk #elif defined(TARGET_LPC4088) + + printf(" *** TAGET LPC4088 ***"); + if(rx_ws == p33){ - LPC_IOCON->P0_5 = (LPC_IOCON->P0_5 & ~7) | 1; //set p29 as receive word select line + LPC_IOCON->P0_5 = (LPC_IOCON->P0_5 & ~7) | 1; //set p33 as receive word select line } else { LPC_IOCON->P0_24 = (LPC_IOCON->P0_24 & ~7) | 2; //set p16 as receive word select line } @@ -333,10 +341,10 @@ LPC_IOCON->P0_25 = (LPC_IOCON->P0_25 & ~7) | 2; //set p17 as receive serial data line } LPC_IOCON->P0_7 = (LPC_IOCON->P0_7 & ~7) | 1; //set p13 as transmit clock line (only one of these) - LPC_IOCON->P0_8 = (LPC_IOCON->P0_8 & ~7) | 1; //set p6 as word select line (only one of these) - LPC_IOCON->P0_9 = (LPC_IOCON->P0_9 & ~7) | 1; //set p5 as transmit serial data line (only one of these) - LPC_IOCON->P0_23 = (LPC_IOCON->P0_4 & ~7); //clear rx_clk - LPC_IOCON->P0_23 = (LPC_IOCON->P0_23 & ~7); //clear rx_clk + LPC_IOCON->P0_8 = (LPC_IOCON->P0_8 & ~7) | 1; //set p12 as word select line (only one of these) + LPC_IOCON->P0_9 = (LPC_IOCON->P0_9 & ~7) | 1; //set p11 as transmit serial data line (only one of these) + LPC_IOCON->P0_23 = (LPC_IOCON->P0_4 & ~7); // p15 clear rx_clk + LPC_IOCON->P0_23 = (LPC_IOCON->P0_23 & ~7); // p15clear rx_clk #endif } /******************************************************