Skip to content

Commit 5dd0369

Browse files
committed
fixup: Cs43l22
1 parent 458d4ea commit 5dd0369

File tree

3 files changed

+30
-29
lines changed

3 files changed

+30
-29
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -621,78 +621,79 @@ you specific needs.
621621
<td align="center"><a href="https://modm.io/reference/module/modm-driver-bmp085">BMP085</a></td>
622622
<td align="center"><a href="https://modm.io/reference/module/modm-driver-bno055">BNO055</a></td>
623623
<td align="center"><a href="https://modm.io/reference/module/modm-driver-cat24aa">CAT24AA</a></td>
624-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-drv832x_spi">DRV832X</a></td>
624+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-cs43l22">CS43L22</a></td>
625625
</tr><tr>
626+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-drv832x_spi">DRV832X</a></td>
626627
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ds1302">DS1302</a></td>
627628
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ds1631">DS1631</a></td>
628629
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ds18b20">DS18B20</a></td>
629630
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ea_dog">EA-DOG</a></td>
630631
<td align="center"><a href="https://modm.io/reference/module/modm-driver-encoder_input-bitbang">ENCODER-INPUT-BITBANG</a></td>
631-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-encoder_output-bitbang">ENCODER-OUTPUT-BITBANG</a></td>
632632
</tr><tr>
633+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-encoder_output-bitbang">ENCODER-OUTPUT-BITBANG</a></td>
633634
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ft245">FT245</a></td>
634635
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ft6x06">FT6X06</a></td>
635636
<td align="center"><a href="https://modm.io/reference/module/modm-driver-gpio_sampler">GPIO-SAMPLER</a></td>
636637
<td align="center"><a href="https://modm.io/reference/module/modm-driver-hclax">HCLAx</a></td>
637638
<td align="center"><a href="https://modm.io/reference/module/modm-driver-hd44780">HD44780</a></td>
638-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-hmc58x">HMC58x</a></td>
639639
</tr><tr>
640+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-hmc58x">HMC58x</a></td>
640641
<td align="center"><a href="https://modm.io/reference/module/modm-driver-hmc6343">HMC6343</a></td>
641642
<td align="center"><a href="https://modm.io/reference/module/modm-driver-hx711">HX711</a></td>
642643
<td align="center"><a href="https://modm.io/reference/module/modm-driver-i2c-eeprom">I2C-EEPROM</a></td>
643644
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ili9341">ILI9341</a></td>
644645
<td align="center"><a href="https://modm.io/reference/module/modm-driver-is31fl3733">IS31FL3733</a></td>
645-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-itg3200">ITG3200</a></td>
646646
</tr><tr>
647+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-itg3200">ITG3200</a></td>
647648
<td align="center"><a href="https://modm.io/reference/module/modm-driver-l3gd20">L3GD20</a></td>
648649
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lan8720a">LAN8720A</a></td>
649650
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lawicel">LAWICEL</a></td>
650651
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lis302dl">LIS302DL</a></td>
651652
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lis3dsh">LIS3DSH</a></td>
652-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lis3mdl">LIS3MDL</a></td>
653653
</tr><tr>
654+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lis3mdl">LIS3MDL</a></td>
654655
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lm75">LM75</a></td>
655656
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lp503x">LP503X</a></td>
656657
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lsm303a">LSM303A</a></td>
657658
<td align="center"><a href="https://modm.io/reference/module/modm-driver-lsm6ds33">LSM6DS33</a></td>
658659
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ltc2984">LTC2984</a></td>
659-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-max6966">MAX6966</a></td>
660660
</tr><tr>
661+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-max6966">MAX6966</a></td>
661662
<td align="center"><a href="https://modm.io/reference/module/modm-driver-max7219">MAX7219</a></td>
662663
<td align="center"><a href="https://modm.io/reference/module/modm-driver-mcp23x17">MCP23X17</a></td>
663664
<td align="center"><a href="https://modm.io/reference/module/modm-driver-mcp2515">MCP2515</a></td>
664665
<td align="center"><a href="https://modm.io/reference/module/modm-driver-mmc5603">MMC5603</a></td>
665666
<td align="center"><a href="https://modm.io/reference/module/modm-driver-nokia5110">NOKIA5110</a></td>
666-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-nrf24">NRF24</a></td>
667667
</tr><tr>
668+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-nrf24">NRF24</a></td>
668669
<td align="center"><a href="https://modm.io/reference/module/modm-driver-parallel_tft_display">TFT-DISPLAY</a></td>
669670
<td align="center"><a href="https://modm.io/reference/module/modm-driver-pat9125el">PAT9125EL</a></td>
670671
<td align="center"><a href="https://modm.io/reference/module/modm-driver-pca8574">PCA8574</a></td>
671672
<td align="center"><a href="https://modm.io/reference/module/modm-driver-pca9535">PCA9535</a></td>
672673
<td align="center"><a href="https://modm.io/reference/module/modm-driver-pca9548a">PCA9548A</a></td>
673-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-pca9685">PCA9685</a></td>
674674
</tr><tr>
675+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-pca9685">PCA9685</a></td>
675676
<td align="center"><a href="https://modm.io/reference/module/modm-driver-sh1106">SH1106</a></td>
676677
<td align="center"><a href="https://modm.io/reference/module/modm-driver-siemens_s65">SIEMENS-S65</a></td>
677678
<td align="center"><a href="https://modm.io/reference/module/modm-driver-siemens_s75">SIEMENS-S75</a></td>
678679
<td align="center"><a href="https://modm.io/reference/module/modm-driver-sk6812">SK6812</a></td>
679680
<td align="center"><a href="https://modm.io/reference/module/modm-driver-sk9822">SK9822</a></td>
680-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ssd1306">SSD1306</a></td>
681681
</tr><tr>
682+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ssd1306">SSD1306</a></td>
682683
<td align="center"><a href="https://modm.io/reference/module/modm-driver-st7586s">ST7586S</a></td>
683684
<td align="center"><a href="https://modm.io/reference/module/modm-driver-stts22h">STTS22H</a></td>
684685
<td align="center"><a href="https://modm.io/reference/module/modm-driver-stusb4500">STUSB4500</a></td>
685686
<td align="center"><a href="https://modm.io/reference/module/modm-driver-sx1276">SX1276</a></td>
686687
<td align="center"><a href="https://modm.io/reference/module/modm-driver-tcs3414">TCS3414</a></td>
687-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-tcs3472">TCS3472</a></td>
688688
</tr><tr>
689+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-tcs3472">TCS3472</a></td>
689690
<td align="center"><a href="https://modm.io/reference/module/modm-driver-tlc594x">TLC594X</a></td>
690691
<td align="center"><a href="https://modm.io/reference/module/modm-driver-tmp102">TMP102</a></td>
691692
<td align="center"><a href="https://modm.io/reference/module/modm-driver-tmp12x">TMP12X</a></td>
692693
<td align="center"><a href="https://modm.io/reference/module/modm-driver-tmp175">TMP175</a></td>
693694
<td align="center"><a href="https://modm.io/reference/module/modm-driver-touch2046">TOUCH2046</a></td>
694-
<td align="center"><a href="https://modm.io/reference/module/modm-driver-vl53l0">VL53L0</a></td>
695695
</tr><tr>
696+
<td align="center"><a href="https://modm.io/reference/module/modm-driver-vl53l0">VL53L0</a></td>
696697
<td align="center"><a href="https://modm.io/reference/module/modm-driver-vl6180">VL6180</a></td>
697698
<td align="center"><a href="https://modm.io/reference/module/modm-driver-ws2812">WS2812</a></td>
698699
</tr>

src/modm/driver/dac/cs43l22.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ struct cs43l22
132132
PDN_HPA1 = Bit5,
133133

134134
PDN_HPB0 = Bit6,
135-
PDN_HPB1 = Bit7,
135+
PDN_HPB1 = Bit7,
136136
};
137137
MODM_FLAGS8(PowerControl2);
138138

@@ -156,7 +156,7 @@ struct cs43l22
156156

157157
RATIO0 = Bit1,
158158
RATIO1 = Bit2,
159-
159+
160160
VIDEOCLK = Bit3,
161161
GROUP_32K = Bit4,
162162

@@ -276,7 +276,7 @@ struct cs43l22
276276
ClockingControl_t, InterfaceControl1_t,
277277
MasterVolumeControl_t, AnalogZcAndSrSettings_t,
278278
MiscellaneousControls_t, LimiterControl1MinMaxThresholds_t >;
279-
279+
280280
typedef int16_t centiBel_t;
281281
static constexpr centiBel_t MaxVolume = 120;
282282
static constexpr centiBel_t MinVolume = -1020;
@@ -293,10 +293,10 @@ struct cs43l22
293293
* @ingroup modm_driver_cs43l22
294294
*/
295295
template<typename I2cMaster, typename I2sMaster>
296-
class CS43L22 : public cs43l22, public modm::I2cDevice<I2cMaster, 3>
296+
class Cs43l22 : public cs43l22, public modm::I2cDevice<I2cMaster, 5>
297297
{
298298
public:
299-
CS43L22(uint8_t i2cAddress);
299+
Cs43l22(uint8_t i2cAddress);
300300

301301
/// Initialize device, call before using any other function
302302
ResumableResult<bool>

src/modm/driver/dac/cs43l22_impl.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ namespace modm
1717
{
1818

1919
template<typename I2cMaster, typename I2sMaster>
20-
CS43L22<I2cMaster, I2sMaster>::CS43L22(uint8_t i2cAddress)
21-
: I2cDevice<I2cMaster, 3>(i2cAddress)
20+
Cs43l22<I2cMaster, I2sMaster>::Cs43l22(uint8_t i2cAddress)
21+
: I2cDevice<I2cMaster, 5>(i2cAddress)
2222
{
2323
volume = -300;
2424
}
2525

2626
template<typename I2cMaster, typename I2sMaster>
2727
ResumableResult<bool>
28-
CS43L22<I2cMaster, I2sMaster>::initialize()
28+
Cs43l22<I2cMaster, I2sMaster>::initialize()
2929
{
3030
RF_BEGIN();
3131
// Verify the chip ID
@@ -35,8 +35,8 @@ CS43L22<I2cMaster, I2sMaster>::initialize()
3535
RF_RETURN(false);
3636
}
3737
RF_CALL(writeRegister(Register::PowerControl1, Power_t(Power::Down)));
38-
RF_CALL(writeRegister(Register::PowerControl2, ChannelPowerHeadphoneA_t(ChannelPower::OnAlways) |
39-
ChannelPowerHeadphoneB_t(ChannelPower::OnAlways) |
38+
RF_CALL(writeRegister(Register::PowerControl2, ChannelPowerHeadphoneA_t(ChannelPower::OnAlways) |
39+
ChannelPowerHeadphoneB_t(ChannelPower::OnAlways) |
4040
ChannelPowerSpeakerA_t(ChannelPower::OffAlways) |
4141
ChannelPowerSpeakerB_t(ChannelPower::OffAlways)));
4242
RF_CALL(writeRegister(Register::ClockingControl, ClockingControl::AUTO_DETECT));
@@ -45,8 +45,8 @@ CS43L22<I2cMaster, I2sMaster>::initialize()
4545
RF_CALL(setMasterVolume(volume));
4646
RF_CALL(writeRegister(Register::PowerControl1, Power_t(Power::Up)));
4747
/* Additional configuration for the CODEC. These configurations are done to reduce
48-
the time needed for the Codec to power off. If these configurations are removed,
49-
then a long delay should be added between powering off the Codec and switching
48+
the time needed for the Codec to power off. If these configurations are removed,
49+
then a long delay should be added between powering off the Codec and switching
5050
off the I2S peripheral MCLK clock (which is the operating clock for Codec).
5151
If this delay is not inserted, then the codec will not shut down properly and
5252
it results in high noise after shut down. */
@@ -63,7 +63,7 @@ CS43L22<I2cMaster, I2sMaster>::initialize()
6363

6464
template<typename I2cMaster, typename I2sMaster>
6565
ResumableResult<bool>
66-
CS43L22<I2cMaster, I2sMaster>::writeRegister(Register reg, RegisterValue_t value)
66+
Cs43l22<I2cMaster, I2sMaster>::writeRegister(Register reg, RegisterValue_t value)
6767
{
6868
RF_BEGIN();
6969
tx_buffer[0] = static_cast<uint8_t>(reg);
@@ -74,7 +74,7 @@ CS43L22<I2cMaster, I2sMaster>::writeRegister(Register reg, RegisterValue_t value
7474

7575
template<typename I2cMaster, typename I2sMaster>
7676
ResumableResult<bool>
77-
CS43L22<I2cMaster, I2sMaster>::readRegister(Register reg)
77+
Cs43l22<I2cMaster, I2sMaster>::readRegister(Register reg)
7878
{
7979
RF_BEGIN();
8080
rx_buffer = static_cast<uint8_t>(reg);
@@ -88,7 +88,7 @@ CS43L22<I2cMaster, I2sMaster>::readRegister(Register reg)
8888

8989
template<typename I2cMaster, typename I2sMaster>
9090
ResumableResult<bool>
91-
CS43L22<I2cMaster, I2sMaster>::setMasterVolume(centiBel_t vol)
91+
Cs43l22<I2cMaster, I2sMaster>::setMasterVolume(centiBel_t vol)
9292
{
9393
RF_BEGIN();
9494
{
@@ -108,7 +108,7 @@ CS43L22<I2cMaster, I2sMaster>::setMasterVolume(centiBel_t vol)
108108

109109
template<typename I2cMaster, typename I2sMaster>
110110
void
111-
CS43L22<I2cMaster, I2sMaster>::regToCentibel(uint8_t reg)
111+
Cs43l22<I2cMaster, I2sMaster>::regToCentibel(uint8_t reg)
112112
{
113113
volume = reg;
114114
if (volume <= 24 and volume >= 0)
@@ -126,7 +126,7 @@ CS43L22<I2cMaster, I2sMaster>::regToCentibel(uint8_t reg)
126126

127127
template<typename I2cMaster, typename I2sMaster>
128128
ResumableResult<bool>
129-
CS43L22<I2cMaster, I2sMaster>::setMasterVolumeRelative(centiBel_t rel_vol)
129+
Cs43l22<I2cMaster, I2sMaster>::setMasterVolumeRelative(centiBel_t rel_vol)
130130
{
131131
RF_BEGIN();
132132
if (RF_CALL(getMasterVolume()))
@@ -140,7 +140,7 @@ CS43L22<I2cMaster, I2sMaster>::setMasterVolumeRelative(centiBel_t rel_vol)
140140

141141
template<typename I2cMaster, typename I2sMaster>
142142
ResumableResult<bool>
143-
CS43L22<I2cMaster, I2sMaster>::getMasterVolume()
143+
Cs43l22<I2cMaster, I2sMaster>::getMasterVolume()
144144
{
145145
return readRegister(Register::MasterVolumeControlA);
146146
}

0 commit comments

Comments
 (0)