Skip to content

Commit

Permalink
Issue #16 : Change the member function name from ConfigureSRC() to Co…
Browse files Browse the repository at this point in the history
…nfigureSrc().
  • Loading branch information
suikan4github committed Oct 16, 2024
1 parent 1a3e1c9 commit ee133ae
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
History of the project development

## [Unreleased] yyyy-mm-zz
The issue #16 changes its public member function. But it is referred internally from ::rpp_driver::Adau1361 class. Not called by user program. Then, the major version number is not needed to change.

### Added
### Changed
- [Issue #10](https://github.com/suikan4github/rpp_driver/issues/10) Cover APIs of the Raspberry Pi Pico SDK.
- [Issue #16](https://github.com/suikan4github/rpp_driver/issues/16) Change the member function name from ConfigureSRC() to ConfigureSrc().
### Deprecated
### Removed
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/codec/adau1361.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void ::rpp_driver::Adau1361::Start(void) {
// Enable core to start operation.
adau1361_lower_.EnableCore();
// Set SRC for the right FS.
adau1361_lower_.ConfigureSRC(fs_);
adau1361_lower_.ConfigureSrc(fs_);
// Board independent register initialization.
adau1361_lower_.InitializeRegisters();
// Board dependent register initialization.
Expand Down
2 changes: 1 addition & 1 deletion src/codec/adau1361lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ void ::rpp_driver::Adau1361Lower::InitializeRegisters() {
}

// Set the converter clock.
void ::rpp_driver::Adau1361Lower::ConfigureSRC(unsigned int fs) {
void ::rpp_driver::Adau1361Lower::ConfigureSrc(unsigned int fs) {
assert((fs == 24000 || fs == 32000 || fs == 48000 || fs == 96000 ||
fs == 22050 || fs == 44100 || fs == 88200) &&
"Bad Fs");
Expand Down
8 changes: 4 additions & 4 deletions src/codec/adau1361lower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace rpp_driver {
* @li ConfigurePll()
* @li WaitPllLock()
* @li EnableCore()
* @li ConfigureSRC()
* @li ConfigureSrc()
* @li InitializeRegisters()
* @li ConfigureSignalPath()
*
Expand Down Expand Up @@ -136,7 +136,7 @@ class Adau1361Lower {
* @details
* Must call after EnableCore().
*/
virtual void ConfigureSRC(unsigned int fs);
virtual void ConfigureSrc(unsigned int fs);

/**
* @brief Initialize the core part of the ADAU1361A.
Expand All @@ -153,7 +153,7 @@ class Adau1361Lower {
* Clock must working well before calling this routine.
*
* This function clean-up.
* Need to call after ConfigureSRC() and before InitializeSignalPath()
* Need to call after ConfigureSrc() and before InitializeSignalPath()
*/
virtual void InitializeRegisters();

Expand Down Expand Up @@ -243,7 +243,7 @@ class MockAdau1361Lower : public Adau1361Lower {
MOCK_METHOD0(DisablePLL, void());
MOCK_METHOD0(WaitPllLock, void());
MOCK_METHOD2(ConfigurePll, void(unsigned int fs, unsigned int master_clock));
MOCK_METHOD1(ConfigureSRC, void(unsigned int fs));
MOCK_METHOD1(ConfigureSrc, void(unsigned int fs));
MOCK_METHOD0(EnableCore, void());
MOCK_METHOD0(InitializeRegisters, void());
MOCK_METHOD0(ConfigureSignalPath, void());
Expand Down
2 changes: 1 addition & 1 deletion test/test_adau1361.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ TEST_F(Adau1361Test, Start) {
EXPECT_CALL(*codec_lower_, ConfigurePll(fs_, master_clk_));
EXPECT_CALL(*codec_lower_, WaitPllLock());
EXPECT_CALL(*codec_lower_, EnableCore());
EXPECT_CALL(*codec_lower_, ConfigureSRC(fs_));
EXPECT_CALL(*codec_lower_, ConfigureSrc(fs_));
EXPECT_CALL(*codec_lower_, InitializeRegisters());
EXPECT_CALL(*codec_lower_, ConfigureSignalPath());
}
Expand Down
20 changes: 10 additions & 10 deletions test/test_adau1361lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ TEST_F(Adau1361LowerTest, SetHpOutputGain_appropriate_gain) {

// -----------------------------------------------------------------
//
// ConfigureSRC()
// ConfigureSrc()
//
// -----------------------------------------------------------------

Expand All @@ -1881,7 +1881,7 @@ TEST_F(Adau1361LowerDeathTest, ConfigureSRC_wrong_fs) {
const unsigned int fs = 192000; // not supported by ADAU1361
// check the assertion for bad mclock.
#ifndef NDEBUG
ASSERT_DEATH(codec_lower_->ConfigureSRC(fs), "Bad Fs");
ASSERT_DEATH(codec_lower_->ConfigureSrc(fs), "Bad Fs");
#endif
} // ConfigureSRC_wrong_fs

Expand All @@ -1907,7 +1907,7 @@ TEST_F(Adau1361LowerTest, ConfigureSRC_22050) {
.WillOnce(Return(sizeof(config_src)));

// right configuration of SRC.
codec_lower_->ConfigureSRC(fs);
codec_lower_->ConfigureSrc(fs);
} // ConfigureSRC_22050

// Validation test for fs 24000 Hz.
Expand All @@ -1932,7 +1932,7 @@ TEST_F(Adau1361LowerTest, ConfigureSRC_24000) {
.WillOnce(Return(sizeof(config_src)));

// right configuration of SRC.
codec_lower_->ConfigureSRC(fs);
codec_lower_->ConfigureSrc(fs);
} // ConfigureSRC_24000

// Validation test for fs 32000 Hz.
Expand All @@ -1957,7 +1957,7 @@ TEST_F(Adau1361LowerTest, ConfigureSRC_32000) {
.WillOnce(Return(sizeof(config_src)));

// right configuration of SRC.
codec_lower_->ConfigureSRC(fs);
codec_lower_->ConfigureSrc(fs);
} // ConfigureSRC_32000

// Validation test for fs 44100 Hz.
Expand All @@ -1982,7 +1982,7 @@ TEST_F(Adau1361LowerTest, ConfigureSRC_44100) {
.WillOnce(Return(sizeof(config_src)));

// right configuration of SRC.
codec_lower_->ConfigureSRC(fs);
codec_lower_->ConfigureSrc(fs);
} // ConfigureSRC_44100

// Validation test for fs 48000 Hz.
Expand All @@ -2007,7 +2007,7 @@ TEST_F(Adau1361LowerTest, ConfigureSRC_48000) {
.WillOnce(Return(sizeof(config_src)));

// right configuration of SRC.
codec_lower_->ConfigureSRC(fs);
codec_lower_->ConfigureSrc(fs);
} // ConfigureSRC_48000

// Validation test for fs 88200 Hz.
Expand All @@ -2032,7 +2032,7 @@ TEST_F(Adau1361LowerTest, ConfigureSRC_88200) {
.WillOnce(Return(sizeof(config_src)));

// right configuration of SRC.
codec_lower_->ConfigureSRC(fs);
codec_lower_->ConfigureSrc(fs);
} // ConfigureSRC_88200

// Validation test for fs 96000 Hz.
Expand All @@ -2057,12 +2057,12 @@ TEST_F(Adau1361LowerTest, ConfigureSRC_96000) {
.WillOnce(Return(sizeof(config_src)));

// right configuration of SRC.
codec_lower_->ConfigureSRC(fs);
codec_lower_->ConfigureSrc(fs);
} // ConfigureSRC_96000

// -----------------------------------------------------------------
//
// ConfigureSRC()
// ConfigureSrc()
//
// -----------------------------------------------------------------

Expand Down

0 comments on commit ee133ae

Please sign in to comment.