Skip to content

Commit fcdd1a5

Browse files
committed
Misc tidy up and new board
1 parent dd5a9b0 commit fcdd1a5

File tree

5 files changed

+37
-3
lines changed

5 files changed

+37
-3
lines changed

src/PHPi/Board/V3/BPlus.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/**
4+
* @package calcinai/phpi
5+
* @author Michael Calcinai <[email protected]>
6+
*/
7+
8+
namespace Calcinai\PHPi\Board\V3;
9+
10+
use Calcinai\PHPi\Board;
11+
use Calcinai\PHPi\Board\Feature;
12+
13+
class BPlus extends Board
14+
{
15+
16+
use Feature\SoC\BCM2837;
17+
use Feature\HDMI;
18+
use Feature\Ethernet;
19+
use Feature\Header\J8;
20+
21+
public static function getBoardName()
22+
{
23+
return '3 Model B+';
24+
}
25+
}

src/PHPi/Factory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public static function create(LoopInterface $loop = null)
8080
case 'a22082':
8181
case 'a32082':
8282
return new Board\V3\B($loop);
83+
case 'a020d3':
84+
return new Board\V3\BPlus($loop);
8385
}
8486

8587
throw new UnsupportedBoardException(sprintf('Board revision [%s/%s] is not (yet) supported.', $revision, $soc));

src/PHPi/Peripheral/Register/AbstractRegister.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ abstract class AbstractRegister implements RegisterInterface, \ArrayAccess
2727
* AbstractRegister constructor.
2828
* @param BoardInterface $board
2929
* @throws InternalFailureException
30+
* @throws \ReflectionException
3031
*/
3132
public function __construct(BoardInterface $board)
3233
{

src/PHPi/Pin.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,21 @@ class Pin
6161

6262
/**
6363
* Internal level cache - this will only be the last known level, not actually updated until it changes.
64+
* One of self::LEVEL_LOW|self::LEVEL_HIGH
6465
*
65-
* @var null|self::LEVEL_LOW|self::LEVEL_HIGH
66+
* @var null|int
6667
*/
6768
private $internal_level;
6869

6970

7071
private $mask_cache = [];
7172

73+
/**
74+
* Pin constructor.
75+
* @param Board $board
76+
* @param $pin_number
77+
* @throws InvalidPinFunctionException
78+
*/
7279
public function __construct(Board $board, $pin_number)
7380
{
7481
$this->board = $board;

src/PHPi/Pin/EdgeDetector/StatusPoll.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private function updateDetectRegisters()
120120
/**
121121
* needs to be public so can be called from timer context
122122
*
123-
* @return bool
123+
* @throws \Calcinai\PHPi\Exception\InvalidPinFunctionException
124124
*/
125125
public function checkStatusRegisters()
126126
{
@@ -155,7 +155,6 @@ public function checkStatusRegisters()
155155
//Set the clear bit for any that we will have dealt with
156156
$this->gpio_register[$address] = $bank_event_bits;
157157
}
158-
159158
}
160159

161160

0 commit comments

Comments
 (0)