@@ -17,15 +17,15 @@ namespace modm
17
17
{
18
18
19
19
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)
22
22
{
23
23
volume = -300 ;
24
24
}
25
25
26
26
template <typename I2cMaster, typename I2sMaster>
27
27
ResumableResult<bool >
28
- CS43L22 <I2cMaster, I2sMaster>::initialize()
28
+ Cs43l22 <I2cMaster, I2sMaster>::initialize()
29
29
{
30
30
RF_BEGIN ();
31
31
// Verify the chip ID
@@ -35,8 +35,8 @@ CS43L22<I2cMaster, I2sMaster>::initialize()
35
35
RF_RETURN (false );
36
36
}
37
37
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) |
40
40
ChannelPowerSpeakerA_t (ChannelPower::OffAlways) |
41
41
ChannelPowerSpeakerB_t (ChannelPower::OffAlways)));
42
42
RF_CALL (writeRegister (Register::ClockingControl, ClockingControl::AUTO_DETECT));
@@ -45,8 +45,8 @@ CS43L22<I2cMaster, I2sMaster>::initialize()
45
45
RF_CALL (setMasterVolume (volume));
46
46
RF_CALL (writeRegister (Register::PowerControl1, Power_t (Power::Up)));
47
47
/* 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
50
50
off the I2S peripheral MCLK clock (which is the operating clock for Codec).
51
51
If this delay is not inserted, then the codec will not shut down properly and
52
52
it results in high noise after shut down. */
@@ -63,7 +63,7 @@ CS43L22<I2cMaster, I2sMaster>::initialize()
63
63
64
64
template <typename I2cMaster, typename I2sMaster>
65
65
ResumableResult<bool >
66
- CS43L22 <I2cMaster, I2sMaster>::writeRegister(Register reg, RegisterValue_t value)
66
+ Cs43l22 <I2cMaster, I2sMaster>::writeRegister(Register reg, RegisterValue_t value)
67
67
{
68
68
RF_BEGIN ();
69
69
tx_buffer[0 ] = static_cast <uint8_t >(reg);
@@ -74,7 +74,7 @@ CS43L22<I2cMaster, I2sMaster>::writeRegister(Register reg, RegisterValue_t value
74
74
75
75
template <typename I2cMaster, typename I2sMaster>
76
76
ResumableResult<bool >
77
- CS43L22 <I2cMaster, I2sMaster>::readRegister(Register reg)
77
+ Cs43l22 <I2cMaster, I2sMaster>::readRegister(Register reg)
78
78
{
79
79
RF_BEGIN ();
80
80
rx_buffer = static_cast <uint8_t >(reg);
@@ -88,7 +88,7 @@ CS43L22<I2cMaster, I2sMaster>::readRegister(Register reg)
88
88
89
89
template <typename I2cMaster, typename I2sMaster>
90
90
ResumableResult<bool >
91
- CS43L22 <I2cMaster, I2sMaster>::setMasterVolume(centiBel_t vol)
91
+ Cs43l22 <I2cMaster, I2sMaster>::setMasterVolume(centiBel_t vol)
92
92
{
93
93
RF_BEGIN ();
94
94
{
@@ -108,7 +108,7 @@ CS43L22<I2cMaster, I2sMaster>::setMasterVolume(centiBel_t vol)
108
108
109
109
template <typename I2cMaster, typename I2sMaster>
110
110
void
111
- CS43L22 <I2cMaster, I2sMaster>::regToCentibel(uint8_t reg)
111
+ Cs43l22 <I2cMaster, I2sMaster>::regToCentibel(uint8_t reg)
112
112
{
113
113
volume = reg;
114
114
if (volume <= 24 and volume >= 0 )
@@ -126,7 +126,7 @@ CS43L22<I2cMaster, I2sMaster>::regToCentibel(uint8_t reg)
126
126
127
127
template <typename I2cMaster, typename I2sMaster>
128
128
ResumableResult<bool >
129
- CS43L22 <I2cMaster, I2sMaster>::setMasterVolumeRelative(centiBel_t rel_vol)
129
+ Cs43l22 <I2cMaster, I2sMaster>::setMasterVolumeRelative(centiBel_t rel_vol)
130
130
{
131
131
RF_BEGIN ();
132
132
if (RF_CALL (getMasterVolume ()))
@@ -140,7 +140,7 @@ CS43L22<I2cMaster, I2sMaster>::setMasterVolumeRelative(centiBel_t rel_vol)
140
140
141
141
template <typename I2cMaster, typename I2sMaster>
142
142
ResumableResult<bool >
143
- CS43L22 <I2cMaster, I2sMaster>::getMasterVolume()
143
+ Cs43l22 <I2cMaster, I2sMaster>::getMasterVolume()
144
144
{
145
145
return readRegister (Register::MasterVolumeControlA);
146
146
}
0 commit comments