![]() |
Synergy Software Package User's Manual
|
Driver for the I/O Ports. More...
Driver for the I/O Ports.
The IOPort HAL drivers provide the ability to access the I/O Ports of a device at both bit and port level. Port and pin direction can be changed. In addition a number of configuration APIs are provided to change the functionality of individual pins.
| ssp_err_t R_IOPORT_EthernetModeCfg | ( | ioport_ethernet_channel_t | channel, |
| ioport_ethernet_mode_t | mode | ||
| ) |
Configures Ethernet channel PHY mode. Implements ioport_api_t::ethModeCfg.
| SSP_SUCCESS | Ethernet PHY mode set. |
| SSP_ERR_INVALID_ARGUMENT | Channel or mode not valid. |
| SSP_ERR_UNSUPPORTED | Ethernet configuration not supported on this device. |
| ssp_err_t R_IOPORT_Init | ( | const ioport_cfg_t * | p_cfg | ) |
Initializes internal driver data, then calls R_IOPORT_PinsCfg to configure pins.
| SSP_SUCCESS | Pin configuration data written to PFS register(s) |
| SSP_ERR_ASSERTION | NULL pointer |
| ssp_err_t R_IOPORT_PinCfg | ( | ioport_port_pin_t | pin, |
| uint32_t | cfg | ||
| ) |
Configures the settings of a pin. Implements ioport_api_t::pinCfg.
| SSP_SUCCESS | Pin configured. |
| SSP_ERR_INVALID_ARGUMENT | Invalid pin |
| ssp_err_t R_IOPORT_PinDirectionSet | ( | ioport_port_pin_t | pin, |
| ioport_direction_t | direction | ||
| ) |
Sets the direction of an individual pin on a port. Implements ioport_api_t::pinDirectionSet.
| SSP_SUCCESS | Pin direction updated. |
| SSP_ERR_INVALID_ARGUMENT | The pin and/or direction not valid. |
| ssp_err_t R_IOPORT_PinEventInputRead | ( | ioport_port_pin_t | pin, |
| ioport_level_t * | p_pin_event | ||
| ) |
Reads the value of the event input data of a specific pin. Implements ioport_api_t::pinEventInputRead.
The pin event data is captured in response to a trigger from the ELC. This function enables this data to be read. Using the event system allows the captured data to be stored when it occurs and then read back at a later time.
| SSP_SUCCESS | Pin read. |
| SSP_ERR_INVALID_ARGUMENT | Pin not valid. |
| SSP_ERR_ASSERTION | NULL pointer |
| ssp_err_t R_IOPORT_PinEventOutputWrite | ( | ioport_port_pin_t | pin, |
| ioport_level_t | pin_value | ||
| ) |
This function writes the event output data value to a pin. Implements ioport_api_t::pinEventOutputWrite.
Using the event system enables a pin state to be stored by this function in advance of being output on the pin. The output to the pin will occur when the ELC event occurs.
| SSP_SUCCESS | Pin event data written. |
| SSP_ERR_INVALID_ARGUMENT | Pin or value not valid. |
| ssp_err_t R_IOPORT_PinRead | ( | ioport_port_pin_t | pin, |
| ioport_level_t * | p_pin_value | ||
| ) |
Reads the level on a pin. Implements ioport_api_t::pinRead.
| SSP_SUCCESS | Pin read. |
| SSP_ERR_INVALID_ARGUMENT | Invalid argument |
| SSP_ERR_ASSERTION | NULL pointer |
| ssp_err_t R_IOPORT_PinsCfg | ( | const ioport_cfg_t * | p_cfg | ) |
Configures the functions of multiple pins by loading configuration data into pin PFS registers. Implements ioport_api_t::pinsCfg.
This function initializes the supplied list of PmnPFS registers with the supplied values. This data can be generated by the ISDE pin configurator or manually by the developer. Different pin configurations can be loaded for different situations such as low power modes and test.*
| SSP_SUCCESS | Pin configuration data written to PFS register(s) |
| SSP_ERR_ASSERTION | NULL pointer |
| ssp_err_t R_IOPORT_PinWrite | ( | ioport_port_pin_t | pin, |
| ioport_level_t | level | ||
| ) |
Sets a pin's output either high or low. Implements ioport_api_t::pinWrite.
| SSP_SUCCESS | Pin written to. |
| SSP_ERR_INVALID_ARGUMENT | The pin and/or level not valid. |
| ssp_err_t R_IOPORT_PortDirectionSet | ( | ioport_port_t | port, |
| ioport_size_t | direction_values, | ||
| ioport_size_t | mask | ||
| ) |
Sets the direction of individual pins on a port. Implements ioport_api_t::portDirectionSet().
Multiple pins on a port can be set to inputs or outputs at once. Each bit in the mask parameter corresponds to a pin on the port. For example, bit 7 corresponds to pin 7, bit 6 to pin 6, and so on. If a bit is set to 1 then the corresponding pin will be changed to an input or an output as specified by the direction values. If a mask bit is set to 0 then the direction of the pin will not be changed.
| SSP_SUCCESS | Port direction updated. |
| SSP_ERR_INVALID_ARGUMENT | The port and/or mask not valid. |
High bits
Low bits
New value to write to port direction register
| ssp_err_t R_IOPORT_PortEventInputRead | ( | ioport_port_t | port, |
| ioport_size_t * | p_event_data | ||
| ) |
Reads the value of the event input data. Implements ioport_api_t::portEventInputRead().
The event input data for the port will be read. Each bit in the returned value corresponds to a pin on the port. For example, bit 7 corresponds to pin 7, bit 6 to pin 6, and so on.
The port event data is captured in response to a trigger from the ELC. This function enables this data to be read. Using the event system allows the captured data to be stored when it occurs and then read back at a later time.
| SSP_SUCCESS | Port read. |
| SSP_ERR_INVALID_ARGUMENT | Port not valid. |
| SSP_ERR_ASSERTION | NULL pointer |
| ssp_err_t R_IOPORT_PortEventOutputWrite | ( | ioport_port_t | port, |
| ioport_size_t | event_data, | ||
| ioport_size_t | mask_value | ||
| ) |
This function writes the set and reset event output data for a port. Implements ioport_api_t::portEventOutputWrite.
Using the event system enables a port state to be stored by this function in advance of being output on the port. The output to the port will occur when the ELC event occurs.
The input value will be written to the specified port when an ELC event configured for that port occurs. Each bit in the value parameter corresponds to a bit on the port. For example, bit 7 corresponds to pin 7, bit 6 to pin 6, and so on. Each bit in the mask parameter corresponds to a pin on the port.
| SSP_SUCCESS | Port event data written. |
| SSP_ERR_INVALID_ARGUMENT | Port and/or mask not valid. |
| ssp_err_t R_IOPORT_PortRead | ( | ioport_port_t | port, |
| ioport_size_t * | p_port_value | ||
| ) |
Reads the value on an IO port. Implements ioport_api_t::portRead.
The specified port will be read, and the levels for all the pins will be returned. Each bit in the returned value corresponds to a pin on the port. For example, bit 7 corresponds to pin 7, bit 6 to pin 6, and so on. *
| SSP_SUCCESS | Port read. |
| SSP_ERR_INVALID_ARGUMENT | Port not valid. |
| SSP_ERR_ASSERTION | NULL pointer |
| ssp_err_t R_IOPORT_PortWrite | ( | ioport_port_t | port, |
| ioport_size_t | value, | ||
| ioport_size_t | mask | ||
| ) |
Writes to multiple pins on a port. Implements ioport_api_t::portWrite.
The input value will be written to the specified port. Each bit in the value parameter corresponds to a bit on the port. For example, bit 7 corresponds to pin 7, bit 6 to pin 6, and so on. Each bit in the mask parameter corresponds to a pin on the port.
Only the bits with the corresponding bit in the mask value set will be updated. e.g. value = 0xFFFF, mask = 0x0003 results in only bits 0 and 1 being updated.
| SSP_SUCCESS | Port written to. |
| SSP_ERR_INVALID_ARGUMENT | The port and/or mask not valid. |
High bits
Low bits
| ssp_err_t R_IOPORT_VersionGet | ( | ssp_version_t * | p_data | ) |
Returns IOPort HAL driver version. Implements ioport_api_t::versionGet.
| SSP_SUCCESS | Version information read. |
| SSP_ERR_ASSERTION | The parameter p_data is NULL. |