Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Port I/O APIs

Functions

static void sys_out8 (uint8_t data, io_port_t port)
 Output a byte to an I/O port.
static uint8_t sys_in8 (io_port_t port)
 Input a byte from an I/O port.
static void sys_out16 (uint16_t data, io_port_t port)
 Output a 16 bits to an I/O port.
static uint16_t sys_in16 (io_port_t port)
 Input 16 bits from an I/O port.
static void sys_out32 (uint32_t data, io_port_t port)
 Output 32 bits to an I/O port.
static uint32_t sys_in32 (io_port_t port)
 Input 32 bits from an I/O port.
static void sys_io_set_bit (io_port_t port, unsigned int bit)
 Set the designated bit from port to 1.
static void sys_io_clear_bit (io_port_t port, unsigned int bit)
 Clear the designated bit from port to 0.
static int sys_io_test_bit (io_port_t port, unsigned int bit)
 Test the bit from port if it is set or not.
static int sys_io_test_and_set_bit (io_port_t port, unsigned int bit)
 Test the bit from port and set it.
static int sys_io_test_and_clear_bit (io_port_t port, unsigned int bit)
 Test the bit from port and clear it.

Detailed Description

Function Documentation

◆ sys_in16()

uint16_t sys_in16 ( io_port_t port)
inlinestatic

#include <zephyr/sys/sys_io.h>

Input 16 bits from an I/O port.

This function reads 16 bits from the port.

Parameters
portthe port address from where to read the 16 bits
Returns
the 16 bits read

◆ sys_in32()

uint32_t sys_in32 ( io_port_t port)
inlinestatic

#include <zephyr/sys/sys_io.h>

Input 32 bits from an I/O port.

This function reads 32 bits from the port.

Parameters
portthe port address from where to read the 32 bits
Returns
the 32 bits read

◆ sys_in8()

uint8_t sys_in8 ( io_port_t port)
inlinestatic

#include <zephyr/sys/sys_io.h>

Input a byte from an I/O port.

This function reads a byte from the port.

Parameters
portthe port address from where to read the byte
Returns
the byte read

◆ sys_io_clear_bit()

void sys_io_clear_bit ( io_port_t port,
unsigned int bit )
inlinestatic

#include <zephyr/sys/sys_io.h>

Clear the designated bit from port to 0.

This functions takes the designated bit starting from port and sets it to 0.

Parameters
portthe port address from where to look for the bit
bitthe designated bit to clear (from 0 to n)

◆ sys_io_set_bit()

void sys_io_set_bit ( io_port_t port,
unsigned int bit )
inlinestatic

#include <zephyr/sys/sys_io.h>

Set the designated bit from port to 1.

This functions takes the designated bit starting from port and sets it to 1.

Parameters
portthe port address from where to look for the bit
bitthe designated bit to set (from 0 to n)

◆ sys_io_test_and_clear_bit()

int sys_io_test_and_clear_bit ( io_port_t port,
unsigned int bit )
inlinestatic

#include <zephyr/sys/sys_io.h>

Test the bit from port and clear it.

This functions takes the designated bit starting from port, tests its current setting and clears it. It will return the previous setting.

Parameters
portthe port address from where to look for the bit
bitthe designated bit to test and clear (from 0 to n)
Returns
0 if it was clear, 1 otherwise

◆ sys_io_test_and_set_bit()

int sys_io_test_and_set_bit ( io_port_t port,
unsigned int bit )
inlinestatic

#include <zephyr/sys/sys_io.h>

Test the bit from port and set it.

This functions takes the designated bit starting from port, tests its current setting and sets it. It will return the previous setting.

Parameters
portthe port address from where to look for the bit
bitthe designated bit to test and set (from 0 to n)
Returns
1 if it was set, 0 otherwise

◆ sys_io_test_bit()

int sys_io_test_bit ( io_port_t port,
unsigned int bit )
inlinestatic

#include <zephyr/sys/sys_io.h>

Test the bit from port if it is set or not.

This functions takes the designated bit starting from port and tests its current setting. It will return the current setting.

Parameters
portthe port address from where to look for the bit
bitthe designated bit to test (from 0 to n)
Returns
1 if it is set, 0 otherwise

◆ sys_out16()

void sys_out16 ( uint16_t data,
io_port_t port )
inlinestatic

#include <zephyr/sys/sys_io.h>

Output a 16 bits to an I/O port.

This function writes a 16 bits to the given port.

Parameters
datathe 16 bits to write
portthe port address where to write the 16 bits

◆ sys_out32()

void sys_out32 ( uint32_t data,
io_port_t port )
inlinestatic

#include <zephyr/sys/sys_io.h>

Output 32 bits to an I/O port.

This function writes 32 bits to the given port.

Parameters
datathe 32 bits to write
portthe port address where to write the 32 bits

◆ sys_out8()

void sys_out8 ( uint8_t data,
io_port_t port )
inlinestatic

#include <zephyr/sys/sys_io.h>

Output a byte to an I/O port.

This function writes a byte to the given port.

Parameters
datathe byte to write
portthe port address where to write the byte