Port Mapping for RJ25.
More...
#include <src/MePort.h>
Port Mapping for RJ25.
Class: MePort
- Description
- Declaration of Class MePort
- Copyright (C), 2012-2016, MakeBlock
◆ MePort() [1/3]
Alternate Constructor which can call your own function to map the MePort to arduino port, no pins are used or initialized here
◆ MePort() [2/3]
| MePort::MePort |
( |
uint8_t |
port | ) |
|
Alternate Constructor which can call your own function to map the MePort to arduino port, no pins are used or initialized here, but PWM frequency set to 976 Hz
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
◆ MePort() [3/3]
| MePort::MePort |
( |
uint8_t |
port, |
|
|
uint8_t |
slot |
|
) |
| |
Alternate Constructor which can call your own function to map the MePort to arduino port, no pins are used or initialized here, but PWM frequency set to 976 Hz
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
| [in] | slot | - SLOT1 or SLOT2 |
◆ aRead1()
| int16_t MePort::aRead1 |
( |
void |
| ) |
|
- Function
- aRead1
- Description
- Read the analog value on slot1 of current RJ25 object's port
- Output
- None
- Returns
- Analog value from 0-1023
- Others
- None
◆ aRead2()
| int16_t MePort::aRead2 |
( |
void |
| ) |
|
- Function
- aRead2
- Description
- Read the analog value on slot2 of current RJ25 object's port
- Output
- None
- Returns
- Analog value from 0-1023
- Others
- None
◆ aWrite1()
| void MePort::aWrite1 |
( |
int16_t |
value | ) |
|
- Function
- aWrite1
- Description
- Set the PWM output value on slot1 of current RJ25 object's port
- Parameters
-
| [in] | value | - Analog value between 0 to 255 |
- Output
- None
- Returns
- None
- Others
- None
◆ aWrite2()
| void MePort::aWrite2 |
( |
int16_t |
value | ) |
|
- Function
- aWrite2
- Description
- Set the PWM output value on slot2 of current RJ25 object's port
- Parameters
-
| [in] | value | - Analog value between 0 to 255 |
- Output
- None
- Returns
- None
- Others
- None
◆ dpRead1()
| bool MePort::dpRead1 |
( |
void |
| ) |
|
- Function
- dpRead1
- Description
- Read the digital input value on slot1 of current RJ25 object's port, the input mode set as INPUT_PULLUP.
- Output
- None
- Returns
- Digital input value
- Others
- None
◆ dpRead2()
| bool MePort::dpRead2 |
( |
void |
| ) |
|
- Function
- dpRead2
- Description
- Read the digital input value on slot2 of current RJ25 object's port, the input mode set as INPUT_PULLUP.
- Output
- None
- Returns
- Digital input value
- Others
- None
◆ dRead1()
| bool MePort::dRead1 |
( |
uint8_t |
mode = INPUT | ) |
|
- Function
- dRead1
- Description
- Read the digital input value on slot1 of current RJ25 object's port
- Parameters
-
| [in] | mode | - digital input mode INPUT or INPUT_PULLUP |
- Output
- None
- Returns
- Digital input value
- Others
- None
◆ dRead2()
| bool MePort::dRead2 |
( |
uint8_t |
mode = INPUT | ) |
|
- Function
- dRead2
- Description
- Read the digital input value on slot2 of current RJ25 object's port
- Parameters
-
| [in] | mode | - digital input mode INPUT or INPUT_PULLUP |
- Output
- None
- Returns
- Digital input value
- Others
- None
◆ dWrite1()
| void MePort::dWrite1 |
( |
bool |
value | ) |
|
- Function
- dWrite1
- Description
- Set the digital output value on slot1 of current RJ25 object's port
- Parameters
-
| [in] | value | - digital output value HIGH or LOW |
- Output
- None
- Returns
- None
- Others
- None
◆ dWrite2()
| void MePort::dWrite2 |
( |
bool |
value | ) |
|
- Function
- dWrite2
- Description
- Set the digital output value on slot2 of current RJ25 object's port
- Parameters
-
| [in] | value | - digital output value HIGH or LOW |
- Output
- None
- Returns
- None
- Others
- None
◆ getPort()
| uint8_t MePort::getPort |
( |
void |
| ) |
|
- Function
- getPort
- Description
- Get current valid port of current RJ25 object
- Output
- None
- Returns
- Port bumber from PORT_1 to M2
- Others
- None
◆ getSlot()
| uint8_t MePort::getSlot |
( |
void |
| ) |
|
- Function
- getSlot
- Description
- Get current valid slot of current RJ25 object's port
- Output
- None
- Returns
- Slot bumber SLOT1 or SLOT2
- Others
- None
◆ pin() [1/2]
| uint8_t MePort::pin |
( |
uint8_t |
port, |
|
|
uint8_t |
slot |
|
) |
| |
- Function
- pin
- Description
- Return the arduino pin number of current RJ25 object's port
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
| [in] | slot | - SLOT1 or SLOT2 |
- Output
- None
- Returns
- The PIN number of arduino
- Others
- None
◆ pin() [2/2]
| uint8_t MePort::pin |
( |
void |
| ) |
|
- Function
- pin
- Description
- Return the arduino pin number of current RJ25 object's port, if the RJ25 module have one available PIN.
- Output
- None
- Returns
- The PIN number of arduino
- Others
- None
◆ pin1()
| uint8_t MePort::pin1 |
( |
void |
| ) |
|
- Function
- pin1
- Description
- Return the arduino pin number of current RJ25 object's slot1
- Output
- None
- Returns
- The PIN number of arduino
- Others
- None
◆ pin2()
| uint8_t MePort::pin2 |
( |
void |
| ) |
|
- Function
- pin2
- Description
- Return the arduino pin number of current RJ25 object's slot2
- Output
- None
- Returns
- The PIN number of arduino
- Others
- None
◆ reset() [1/2]
| void MePort::reset |
( |
uint8_t |
port | ) |
|
- Function
- reset
- Description
- Reset the RJ25 available PIN by its port
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
- Output
- None
- Returns
- None
- Others
- None
◆ reset() [2/2]
| void MePort::reset |
( |
uint8_t |
port, |
|
|
uint8_t |
slot |
|
) |
| |
- Function
- reset
- Description
- Reset the RJ25 available PIN by its port and slot
- Parameters
-
| [in] | port | - RJ25 port from PORT_1 to M2 |
| [in] | slot | - SLOT1 or SLOT2 |
- Output
- None
- Returns
- None
- Others
- None
◆ _port
- Description
- Variables used to store the port
◆ _slot
- Description
- Variables used to store the slot
◆ s1
- Description
- Variables used to store the slot1 gpio number
◆ s2
- Description
- Variables used to store the slot2 gpio number
The documentation for this class was generated from the following files: