added ethernet phy type as an option in settings - #210

This commit is contained in:
proddy
2021-11-21 13:51:02 +01:00
parent dc84f91044
commit 53de2ca25b
13 changed files with 150 additions and 118 deletions

View File

@@ -10,9 +10,7 @@ export const BOARD_PROFILES: BoardProfiles = {
NODEMCU: 'NodeMCU 32S',
'MH-ET': 'MH-ET Live D1 Mini',
LOLIN: 'Lolin D32',
OLIMEX: 'Olimex ESP32-EVB',
TLK110: 'Generic Ethernet (TLK110)',
LAN8720: 'Generic Ethernet (LAN8720)'
OLIMEX: 'Olimex ESP32-EVB'
};
export function boardProfileSelectItems() {

View File

@@ -93,6 +93,7 @@ class EMSESPSettingsForm extends Component<EMSESPSettingsFormProps> {
rx_gpio: json.rx_gpio,
tx_gpio: json.tx_gpio,
pbutton_gpio: json.pbutton_gpio,
phy_type: json.phy_type,
board_profile: event.target.value
});
this.setState({ processing: false });
@@ -306,7 +307,7 @@ class EMSESPSettingsForm extends Component<EMSESPSettingsFormProps> {
'Not a valid GPIO'
]}
name="dallas_gpio"
label="Dallas GPIO (0=none)"
label="Dallas GPIO (0=disabled)"
fullWidth
variant="outlined"
value={data.dallas_gpio}
@@ -332,7 +333,7 @@ class EMSESPSettingsForm extends Component<EMSESPSettingsFormProps> {
'Not a valid GPIO'
]}
name="led_gpio"
label="LED GPIO (0=none)"
label="LED GPIO (0=disabled)"
fullWidth
variant="outlined"
value={data.led_gpio}
@@ -341,6 +342,21 @@ class EMSESPSettingsForm extends Component<EMSESPSettingsFormProps> {
margin="normal"
/>
</Grid>
<Grid item xs={4}>
<SelectValidator
name="phy_type"
label="PHY Module Type"
value={data.phy_type}
fullWidth
variant="outlined"
onChange={handleValueChange('phy_type')}
margin="normal"
>
<MenuItem value={0}>No Ethernet</MenuItem>
<MenuItem value={1}>LAN8720</MenuItem>
<MenuItem value={2}>TLK110</MenuItem>
</SelectValidator>
</Grid>
</Grid>
)}

View File

@@ -11,6 +11,7 @@ export interface EMSESPSettings {
shower_alert: boolean;
rx_gpio: number;
tx_gpio: number;
phy_type: number;
dallas_gpio: number;
dallas_parasite: boolean;
led_gpio: number;