RA Flexible Software Package Documentation
Release v5.6.0
|
|
Interface for accessing I/O ports and configuring I/O functionality.
The IOPort shared interface provides the ability to access the IOPorts of a device at both bit and port level. Port and pin direction can be changed.
Data Structures | |
struct | ioport_pin_cfg_t |
struct | ioport_cfg_t |
struct | ioport_api_t |
struct | ioport_instance_t |
Typedefs | |
typedef uint16_t | ioport_size_t |
IO port size. More... | |
typedef void | ioport_ctrl_t |
struct ioport_pin_cfg_t |
Pin identifier and pin configuration value
Data Fields | ||
---|---|---|
uint32_t | pin_cfg | Pin configuration - Use ioport_cfg_options_t parameters to configure. |
bsp_io_port_pin_t | pin | Pin identifier. |
struct ioport_cfg_t |
Multiple pin configuration data for loading into registers by R_IOPORT_Open()
Data Fields | ||
---|---|---|
uint16_t | number_of_pins | Number of pins for which there is configuration data. |
ioport_pin_cfg_t const * | p_pin_cfg_data | Pin configuration data. |
const void * | p_extend | Pointer to hardware extend configuration. |
struct ioport_api_t |
IOPort driver structure. IOPort functions implemented at the HAL layer will follow this API.
fsp_err_t(* ioport_api_t::open) (ioport_ctrl_t *const p_ctrl, const ioport_cfg_t *p_cfg) |
Initialize internal driver data and initial pin configurations. Called during startup. Do not call this API during runtime. Use ioport_api_t::pinsCfg for runtime reconfiguration of multiple pins.
[in] | p_ctrl | Pointer to control structure. Must be declared by user. Elements set here. |
[in] | p_cfg | Pointer to pin configuration data array. |
fsp_err_t(* ioport_api_t::close) (ioport_ctrl_t *const p_ctrl) |
Close the API.
[in] | p_ctrl | Pointer to control structure. |
fsp_err_t(* ioport_api_t::pinsCfg) (ioport_ctrl_t *const p_ctrl, const ioport_cfg_t *p_cfg) |
Configure multiple pins.
[in] | p_ctrl | Pointer to control structure. |
[in] | p_cfg | Pointer to pin configuration data array. |
fsp_err_t(* ioport_api_t::pinCfg) (ioport_ctrl_t *const p_ctrl, bsp_io_port_pin_t pin, uint32_t cfg) |
Configure settings for an individual pin.
[in] | p_ctrl | Pointer to control structure. |
[in] | pin | Pin to be read. |
[in] | cfg | Configuration options for the pin. |
fsp_err_t(* ioport_api_t::pinEventInputRead) (ioport_ctrl_t *const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t *p_pin_event) |
Read the event input data of the specified pin and return the level.
[in] | p_ctrl | Pointer to control structure. |
[in] | pin | Pin to be read. |
[in] | p_pin_event | Pointer to return the event data. |
fsp_err_t(* ioport_api_t::pinEventOutputWrite) (ioport_ctrl_t *const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t pin_value) |
Write pin event data.
[in] | p_ctrl | Pointer to control structure. |
[in] | pin | Pin event data is to be written to. |
[in] | pin_value | Level to be written to pin output event. |
fsp_err_t(* ioport_api_t::pinRead) (ioport_ctrl_t *const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t *p_pin_value) |
Read level of a pin.
[in] | p_ctrl | Pointer to control structure. |
[in] | pin | Pin to be read. |
[in] | p_pin_value | Pointer to return the pin level. |
fsp_err_t(* ioport_api_t::pinWrite) (ioport_ctrl_t *const p_ctrl, bsp_io_port_pin_t pin, bsp_io_level_t level) |
Write specified level to a pin.
[in] | p_ctrl | Pointer to control structure. |
[in] | pin | Pin to be written to. |
[in] | level | State to be written to the pin. |
fsp_err_t(* ioport_api_t::portDirectionSet) (ioport_ctrl_t *const p_ctrl, bsp_io_port_t port, ioport_size_t direction_values, ioport_size_t mask) |
Set the direction of one or more pins on a port.
[in] | p_ctrl | Pointer to control structure. |
[in] | port | Port being configured. |
[in] | direction_values | Value controlling direction of pins on port. |
[in] | mask | Mask controlling which pins on the port are to be configured. |
fsp_err_t(* ioport_api_t::portEventInputRead) (ioport_ctrl_t *const p_ctrl, bsp_io_port_t port, ioport_size_t *p_event_data) |
Read captured event data for a port.
[in] | p_ctrl | Pointer to control structure. |
[in] | port | Port to be read. |
[in] | p_event_data | Pointer to return the event data. |
fsp_err_t(* ioport_api_t::portEventOutputWrite) (ioport_ctrl_t *const p_ctrl, bsp_io_port_t port, ioport_size_t event_data, ioport_size_t mask_value) |
Write event output data for a port.
[in] | p_ctrl | Pointer to control structure. |
[in] | port | Port event data will be written to. |
[in] | event_data | Data to be written as event data to specified port. |
[in] | mask_value | Each bit set to 1 in the mask corresponds to that bit's value in event data. being written to port. |
fsp_err_t(* ioport_api_t::portRead) (ioport_ctrl_t *const p_ctrl, bsp_io_port_t port, ioport_size_t *p_port_value) |
Read states of pins on the specified port.
[in] | p_ctrl | Pointer to control structure. |
[in] | port | Port to be read. |
[in] | p_port_value | Pointer to return the port value. |
fsp_err_t(* ioport_api_t::portWrite) (ioport_ctrl_t *const p_ctrl, bsp_io_port_t port, ioport_size_t value, ioport_size_t mask) |
Write to multiple pins on a port.
[in] | p_ctrl | Pointer to control structure. |
[in] | port | Port to be written to. |
[in] | value | Value to be written to the port. |
[in] | mask | Mask controlling which pins on the port are written to. |
struct ioport_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
Data Fields | ||
---|---|---|
ioport_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
ioport_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
ioport_api_t const * | p_api | Pointer to the API structure for this instance. |
typedef uint16_t ioport_size_t |
IO port size.
IO port type used with ports
typedef void ioport_ctrl_t |
IOPORT control block. Allocate an instance specific control block to pass into the IOPORT API calls.