PIDUINO
Loading...
Searching...
No Matches
soc.h
1/* Copyright © 2018-2025 Pascal JEAN, All rights reserved.
2 * This file is part of the Piduino Library.
3 *
4 * The Piduino Library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 3 of the License, or (at your option) any later version.
8 *
9 * The Piduino Library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with the Piduino Library; if not, see <http://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include <string>
20#include <vector>
21#include <piduino/manufacturer.h>
22#include <piduino/gpiopin.h>
23
31namespace Piduino {
32
33 class SoC {
34 public:
35
36 // -----------------------------------------------------------------------
37 //
38 // SoC::Family Class
39 //
40 // -----------------------------------------------------------------------
41 class Family {
42 public:
43
44 enum Id {
47 // Add New item here and update soc_family table in database,
48 // then add device driver source in src/arch !
49
50 //---
51 Unknown = -1
52 };
53
55 setId (i);
56 }
57 virtual ~Family() {}
58
59 inline Id id() const {
60 return _id;
61 }
62
63 inline const std::string &name() const {
64 return _name;
65 }
66
67 void setId (Id i);
68
69 private:
71 std::string _name;
72 };
73
74 // -----------------------------------------------------------------------
75 //
76 // SoC Class
77 //
78 // -----------------------------------------------------------------------
79 enum Id {
80
88 // Add New item here and update soc table in database !
89
90 //---
91 Unknown = -1
92 };
93
94 SoC (Id i = Unknown) {
95 setId (i);
96 }
97 virtual ~SoC() {}
98
99 inline Id id() const {
100 return _id;
101 }
102
103 inline const std::string & name() const {
104 return _name;
105 }
106
107 inline const Family & family() const {
108 return _family;
109 }
110
111 inline const Manufacturer & manufacturer() const {
112 return _manufacturer;
113 }
114
115 inline int i2cCount() const {
116 return _i2c_count;
117 }
118
119 inline int spiCount() const {
120 return _spi_count;
121 }
122
123 inline const std::vector<Pin::SpiCs> & spiCs() const {
124 return _spi_cs;
125 }
126
127 inline int uartCount() const {
128 return _uart_count;
129 }
130
131 void setId (Id i);
132
133 private:
135 std::string _name;
140 std::vector<Pin::SpiCs> _spi_cs;
142 };
143}
148/* ========================================================================== */
virtual ~Family()
Definition soc.h:57
const std::string & name() const
Definition soc.h:63
Id id() const
Definition soc.h:59
std::string _name
Definition soc.h:71
Family(Id i=Unknown)
Definition soc.h:54
const Manufacturer & manufacturer() const
Definition soc.h:111
const Family & family() const
Definition soc.h:107
void setId(Id i)
const std::vector< Pin::SpiCs > & spiCs() const
Definition soc.h:123
int _spi_count
Definition soc.h:139
int uartCount() const
Definition soc.h:127
int spiCount() const
Definition soc.h:119
virtual ~SoC()
Definition soc.h:97
Family _family
Definition soc.h:136
std::vector< Pin::SpiCs > _spi_cs
liste des broches de CS
Definition soc.h:140
const std::string & name() const
Definition soc.h:103
int _uart_count
Definition soc.h:141
std::string _name
Definition soc.h:135
Manufacturer _manufacturer
Definition soc.h:137
SoC(Id i=Unknown)
Definition soc.h:94
@ Bcm2709
Definition soc.h:82
@ Bcm2711
Definition soc.h:86
@ Bcm2710
Definition soc.h:83
@ Unknown
Definition soc.h:91
@ Bcm2712
Definition soc.h:87
@ Bcm2708
Definition soc.h:81
int _i2c_count
Definition soc.h:138
Id id() const
Definition soc.h:99
int i2cCount() const
Definition soc.h:115
Global namespace for Piduino.
Definition board.h:28