This is an I2S library to allow people to take advantage of the I2S peripheral on the LPC1768. Ideally it will be included in future releases of the mbed.h file.
I2S Class Reference
An I2S class It uses the I2S peripheral of the LPC1768. More...
#include <I2S.h>
Public Member Functions | |
I2S (PinName, PinName, PinName, PinName, PinName, PinName) | |
Creates an I2S object to control the I2S peripheral. | |
~I2S () | |
Destructs the I2S object and turns off the I2S peripheral. | |
void | setClocks (uint8_t x, uint8_t y, uint8_t divider) |
Sets up the clocks for the I2S peripheral. | |
void | setTx (uint16_t resolution, uint16_t rate, bool stereo) |
Sets the bit clock and word clocks for the channels. | |
void | muteTx (void) |
Mutes or unmutes the transmit I2S channel. | |
void | muteRx (void) |
Mutes or unmutes the receive I2S channel. | |
void | resetTx (void) |
Resets the transmit I2S channel. | |
void | resetRx (void) |
Resets the receive I2S channel. | |
void | setTxMode (uint8_t mode) |
Sets the I2S mode of the transmit channel. | |
void | setRxMode (uint8_t mode) |
Sets the I2S mode of the receive channel. | |
void | setIRQ (bool rxInterrupt, bool txInterrupt, uint8_t rxDepth, uint8_t txDepth) |
Sets up the Interrupt Requests. | |
void | setDMA1 (bool rxDMA, bool txDMA, uint8_t rxDepth, uint8_t txDepth) |
Sets up the DMA requests. |
Detailed Description
An I2S class It uses the I2S peripheral of the LPC1768.
An example:
#include "I2S.h" #include "mbed.h" I2S audioInterface (p7, p6, p5, p30, p29, p8); void main() { audioInterface.setClocks(,,,); audioInterface.setTx(32,9600000,true); audioInterface.setRx(32,9600000,true); // now print out registers out to prove it's set up correctly }
Definition at line 37 of file I2S.h.
Constructor & Destructor Documentation
I2S | ( | PinName | bitTx = p7 , |
PinName | wdTx = p6 , |
||
PinName | daTx = p5 , |
||
PinName | bitRx = p30 , |
||
PinName | wdRx = p29 , |
||
PinName | daRx = p8 |
||
) |
~I2S | ( | ) |
Member Function Documentation
void muteRx | ( | void | ) |
void muteTx | ( | void | ) |
void setClocks | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | divider | ||
) |
Sets up the clocks for the I2S peripheral.
Currents sets up both recieve and transmit channels identically.
void setDMA1 | ( | bool | rxDMA, |
bool | txDMA, | ||
uint8_t | rxDepth, | ||
uint8_t | txDepth | ||
) |
Sets up the DMA requests.
- Parameters:
-
rxDMA txDMA rxDepth txDepth
void setIRQ | ( | bool | rxInterrupt, |
bool | txInterrupt, | ||
uint8_t | rxDepth, | ||
uint8_t | txDepth | ||
) |
Sets up the Interrupt Requests.
- Parameters:
-
rxInterrupt txInterrupt rxDepth txDepth
void setRxMode | ( | uint8_t | mode ) |
Sets the I2S mode of the receive channel.
- Parameters:
-
mode Sets the typical mode.
void setTx | ( | uint16_t | resolution, |
uint16_t | rate, | ||
bool | stereo | ||
) |
void setTxMode | ( | uint8_t | mode ) |
Sets the I2S mode of the transmit channel.
- Parameters:
-
mode Sets the typical mode.
Generated on Tue Jul 26 2022 16:19:15 by 1.7.2