This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added constants for the usual GPIO pins
- Loading branch information
Eleonore Mizo
committed
Apr 27, 2023
1 parent
bf6656d
commit 129a1d8
Showing
15 changed files
with
183 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
/***************************************************************************** | ||
GpioPin.h | ||
Author: Laurent de Soras, 2023 | ||
References all the GPIO pins used in the program. | ||
--- Legal stuff --- | ||
This program is free software. It comes without any warranty, to | ||
the extent permitted by applicable law. You can redistribute it | ||
and/or modify it under the terms of the Do What The Fuck You Want | ||
To Public License, Version 2, as published by Sam Hocevar. See | ||
http://www.wtfpl.net/ for more details. | ||
*Tab=3***********************************************************************/ | ||
|
||
|
||
|
||
#pragma once | ||
#if ! defined (mfx_hw_GpioPin_HEADER_INCLUDED) | ||
#define mfx_hw_GpioPin_HEADER_INCLUDED | ||
|
||
#if defined (_MSC_VER) | ||
#pragma warning (4 : 4250) | ||
#endif | ||
|
||
|
||
|
||
/*\\\ INCLUDE FILES \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ | ||
|
||
|
||
|
||
namespace mfx | ||
{ | ||
namespace hw | ||
{ | ||
|
||
|
||
|
||
class GpioPin | ||
{ | ||
|
||
/*\\\ PUBLIC \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ | ||
|
||
public: | ||
|
||
// - - - - - - - - - - - - - - - - - - - - - - - - | ||
// Physical numbering | ||
|
||
// Shared | ||
static constexpr int _reset = 18; // GPIO 24 / phys 18 | ||
|
||
// Switches | ||
static constexpr int _nav_ok = 7; // GPIO 4 / phys 7 | ||
static constexpr int _nav_cancel = 22; // GPIO 25 / phys 22 | ||
|
||
// LEDs | ||
static constexpr int _led_0 = 11; // GPIO 17 / phys 11 | ||
static constexpr int _led_1 = 13; // GPIO 27 / phys 13 | ||
static constexpr int _led_2 = 15; // GPIO 22 / phys 15 | ||
|
||
// Small Nokia display (never acually used) | ||
static constexpr int _pcd8544_dc = 12; // GPIO 18 / phys 12 | ||
static constexpr int _pcd8544_cs = 16; // GPIO 23 / phys 16 | ||
|
||
// 128x64 display (SPI) | ||
static constexpr int _st7920_cs = 16; // GPIO 23 / phys 16 | ||
|
||
// - - - - - - - - - - - - - - - - - - - - - - - - | ||
// BCM numbering (GPIO) | ||
|
||
// Audio interface (I2S) | ||
static constexpr int _snd_reset = 5; // GPIO 5 / phys 29 | ||
static constexpr int _snd_sfreq = 6; // GPIO 6 / phys 31 | ||
static constexpr int _snd_bclk = 18; // GPIO 18 / phys 12 | ||
static constexpr int _snd_lrck = 19; // GPIO 19 / phys 35 | ||
static constexpr int _snd_din = 20; // GPIO 20 / phys 38 | ||
static constexpr int _snd_dout = 21; // GPIO 21 / phys 40 | ||
|
||
|
||
|
||
/*\\\ PROTECTED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ | ||
|
||
protected: | ||
|
||
|
||
|
||
/*\\\ PRIVATE \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ | ||
|
||
private: | ||
|
||
|
||
|
||
/*\\\ FORBIDDEN MEMBER FUNCTIONS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ | ||
|
||
private: | ||
|
||
GpioPin () = delete; | ||
~GpioPin () = delete; | ||
GpioPin (const GpioPin &other) = delete; | ||
GpioPin (GpioPin &&other) = delete; | ||
GpioPin & operator = (const GpioPin &other) = delete; | ||
GpioPin & operator = (GpioPin &&other) = delete; | ||
bool operator == (const GpioPin &other) const = delete; | ||
bool operator != (const GpioPin &other) const = delete; | ||
|
||
}; // class GpioPin | ||
|
||
|
||
|
||
} // namespace hw | ||
} // namespace mfx | ||
|
||
|
||
|
||
//#include "mfx/hw/GpioPin.hpp" | ||
|
||
|
||
|
||
#endif // mfx_hw_GpioPin_HEADER_INCLUDED | ||
|
||
|
||
|
||
/*\\\ EOF \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.