|
1 | 1 | /** |
2 | 2 | ************************************************** |
3 | | - * @file Esp.cpp |
4 | | - * @brief File for ESP, currently empty |
| 3 | + * @file UtilI2S.cpp |
| 4 | + * @brief File for utilizing the I2S peripheral to send data to the panel. |
5 | 5 | * |
6 | 6 | * https://github.com/e-radionicacom/Inkplate-Arduino-library |
7 | 7 | * For support, please reach over forums: forum.e-radionica.com/en |
|
16 | 16 | * @authors Soldered |
17 | 17 | ***************************************************/ |
18 | 18 |
|
19 | | -#include "Esp.h" |
| 19 | +#include "UtilI2S.h" |
20 | 20 | #include "../../boardSelect.h" |
21 | 21 | #ifdef USES_I2S |
22 | 22 | /** |
|
25 | 25 | * @param i2s_dev_t *_i2sDev |
26 | 26 | * Pointer of the selected I2S driver |
27 | 27 | * |
28 | | - * @note Function must be declared static to fit into Instruction RAM of the ESP32. |
| 28 | + * @note Function must be declared IRAM_ATTR to fit into Instruction RAM of the ESP32. |
29 | 29 | */ |
30 | | -void IRAM_ATTR I2SInit(i2s_dev_t *_i2sDev, uint8_t _clockDivider) |
| 30 | +void IRAM_ATTR UtilI2S::I2SInit(i2s_dev_t *_i2sDev, uint8_t _clockDivider) |
31 | 31 | { |
32 | 32 | // Enable I2S peripheral and reset it. |
33 | 33 | periph_module_enable(PERIPH_I2S1_MODULE); |
@@ -104,10 +104,10 @@ void IRAM_ATTR I2SInit(i2s_dev_t *_i2sDev, uint8_t _clockDivider) |
104 | 104 | * lldesc_s *_dmaDecs |
105 | 105 | * Pointer to the DMA descriptor. |
106 | 106 | * |
107 | | - * @note Function must be declared static to fit into Instruction RAM of the ESP32. Also, DMA descriptor must be |
| 107 | + * @note Function must be declared IRAM_ATTR to fit into Instruction RAM of the ESP32. Also, DMA descriptor must be |
108 | 108 | * already configured! |
109 | 109 | */ |
110 | | -void IRAM_ATTR sendDataI2S(i2s_dev_t *_i2sDev, volatile lldesc_s *_dmaDecs) |
| 110 | +void IRAM_ATTR UtilI2S::sendDataI2S(i2s_dev_t *_i2sDev, volatile lldesc_s *_dmaDecs) |
111 | 111 | { |
112 | 112 | // Stop any on-going transmission (just in case). |
113 | 113 | _i2sDev->out_link.stop = 1; |
@@ -153,7 +153,7 @@ void IRAM_ATTR sendDataI2S(i2s_dev_t *_i2sDev, volatile lldesc_s *_dmaDecs) |
153 | 153 | _i2sDev->out_link.start = 0; |
154 | 154 | } |
155 | 155 |
|
156 | | -void IRAM_ATTR setI2S1pin(uint32_t _pin, uint32_t _function, uint32_t _inv) |
| 156 | +void IRAM_ATTR UtilI2S::setI2S1pin(uint32_t _pin, uint32_t _function, uint32_t _inv) |
157 | 157 | { |
158 | 158 | // Check if valid pin is selected |
159 | 159 | if (_pin > 39) |
|
0 commit comments