RTEMS 6.1-rc2
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
microblaze-gpio.h File Reference

MicroBlaze AXI GPIO definitions. More...

#include <bspopts.h>
#include <bsp/utility.h>
#include <rtems.h>

Go to the source code of this file.

Data Structures

struct  Microblaze_GPIO_registers
 
struct  Microblaze_GPIO_context
 

Macros

#define GLOBAL_INTERRUPT_REGISTER_ENABLE   BSP_BIT32(31)
 
#define CHANNEL_1_INTERRUPT_REGISTER   BSP_BIT32(0)
 
#define CHANNEL_2_INTERRUPT_REGISTER   BSP_BIT32(1)
 

Functions

void microblaze_gpio_set_data_direction (Microblaze_GPIO_context *ctx, uint32_t channel, uint32_t mask)
 Set pin configuration for the specified GPIO channel.
 
uint32_t microblaze_gpio_get_data_direction (Microblaze_GPIO_context *ctx, uint32_t channel)
 Get pin configuration for specified GPIO channel.
 
uint32_t microblaze_gpio_discrete_read (Microblaze_GPIO_context *ctx, uint32_t channel)
 Reads data for specified GPIO channel.
 
void microblaze_gpio_discrete_write (Microblaze_GPIO_context *ctx, uint32_t channel, uint32_t mask)
 Writes to data register for specified GPIO channel.
 
void microblaze_gpio_discrete_set (Microblaze_GPIO_context *ctx, uint32_t channel, uint32_t mask)
 Set bits to 1 on specified GPIO channel.
 
void microblaze_gpio_discrete_clear (Microblaze_GPIO_context *ctx, uint32_t channel, uint32_t mask)
 Set bits to 0 on specified GPIO channel.
 
rtems_vector_number microblaze_gpio_get_irq (Microblaze_GPIO_context *ctx)
 Returns the vector number of the interrupt handler.
 
void microblaze_gpio_interrupt_global_enable (Microblaze_GPIO_context *ctx)
 Turns on interrupts globally.
 
void microblaze_gpio_interrupt_global_disable (Microblaze_GPIO_context *ctx)
 Turns off interrupts globally.
 
void microblaze_gpio_interrupt_enable (Microblaze_GPIO_context *ctx, uint32_t channel)
 Enables interrupts on specified channel.
 
void microblaze_gpio_interrupt_disable (Microblaze_GPIO_context *ctx, uint32_t channel)
 Disables interrupts on specified channel.
 
void microblaze_gpio_interrupt_clear (Microblaze_GPIO_context *ctx, uint32_t channel)
 Clear status of interrupt signals on a specific channel.
 
uint32_t microblaze_gpio_interrupt_get_enabled (Microblaze_GPIO_context *ctx)
 Return a bitmask of the interrupts that are enabled.
 
uint32_t microblaze_gpio_interrupt_get_status (Microblaze_GPIO_context *ctx)
 Return a bitmask of the status of the interrupt signals.
 

Detailed Description

MicroBlaze AXI GPIO definitions.

Function Documentation

◆ microblaze_gpio_discrete_clear()

void microblaze_gpio_discrete_clear ( Microblaze_GPIO_context ctx,
uint32_t  channel,
uint32_t  mask 
)

Set bits to 0 on specified GPIO channel.

Parameters
[in]ctxthe GPIO context
[in]channelthe GPIO channel
[in]maskthe mask to be applied to @ channel
Return values
None

◆ microblaze_gpio_discrete_read()

uint32_t microblaze_gpio_discrete_read ( Microblaze_GPIO_context ctx,
uint32_t  channel 
)

Reads data for specified GPIO channel.

Parameters
[in]channelthe GPIO channel
Return values
Currentvalues in discretes register.

◆ microblaze_gpio_discrete_set()

void microblaze_gpio_discrete_set ( Microblaze_GPIO_context ctx,
uint32_t  channel,
uint32_t  mask 
)

Set bits to 1 on specified GPIO channel.

Parameters
[in]ctxthe GPIO context
[in]channelthe GPIO channel
[in]maskthe mask to be applied to @ channel
Return values
None

◆ microblaze_gpio_discrete_write()

void microblaze_gpio_discrete_write ( Microblaze_GPIO_context ctx,
uint32_t  channel,
uint32_t  mask 
)

Writes to data register for specified GPIO channel.

Parameters
[in]ctxthe GPIO context
[in]channelthe GPIO channel
[in]maskthe mask to be applied to @ channel
Return values
None

◆ microblaze_gpio_get_data_direction()

uint32_t microblaze_gpio_get_data_direction ( Microblaze_GPIO_context ctx,
uint32_t  channel 
)

Get pin configuration for specified GPIO channel.

Gets the current pin configuration for a specified GPIO channel. Bits set to 0 are output, and bits set to 1 are input.

Parameters
[in]ctxthe GPIO context
[in]channelthe GPIO channel
Return values
bitmaskspecifiying which pins on a channel are input or output

◆ microblaze_gpio_get_irq()

rtems_vector_number microblaze_gpio_get_irq ( Microblaze_GPIO_context ctx)

Returns the vector number of the interrupt handler.

Parameters
[in]ctxthe GPIO context
Return values
thevector number

◆ microblaze_gpio_interrupt_clear()

void microblaze_gpio_interrupt_clear ( Microblaze_GPIO_context ctx,
uint32_t  channel 
)

Clear status of interrupt signals on a specific channel.

Parameters
[in]ctxthe GPIO context
[in]channelthe channel to clear the interrupt pending status from
Return values
None

◆ microblaze_gpio_interrupt_disable()

void microblaze_gpio_interrupt_disable ( Microblaze_GPIO_context ctx,
uint32_t  channel 
)

Disables interrupts on specified channel.

Parameters
[in]ctxthe GPIO context
[in]channelthe channel to turn interrupts on for
Return values
None

◆ microblaze_gpio_interrupt_enable()

void microblaze_gpio_interrupt_enable ( Microblaze_GPIO_context ctx,
uint32_t  channel 
)

Enables interrupts on specified channel.

Parameters
[in]ctxthe GPIO context
[in]channelthe channel to enable interrupts on
Return values
None

◆ microblaze_gpio_interrupt_get_enabled()

uint32_t microblaze_gpio_interrupt_get_enabled ( Microblaze_GPIO_context ctx)

Return a bitmask of the interrupts that are enabled.

Parameters
[in]ctxthe GPIO context
Return values
thebitmask of enabled interrupts

◆ microblaze_gpio_interrupt_get_status()

uint32_t microblaze_gpio_interrupt_get_status ( Microblaze_GPIO_context ctx)

Return a bitmask of the status of the interrupt signals.

Parameters
[in]ctxthe GPIO context
Return values
bitmaskcontaining statuses of interrupt signals

◆ microblaze_gpio_interrupt_global_disable()

void microblaze_gpio_interrupt_global_disable ( Microblaze_GPIO_context ctx)

Turns off interrupts globally.

Parameters
[in]ctxthe GPIO context
Return values
None

◆ microblaze_gpio_interrupt_global_enable()

void microblaze_gpio_interrupt_global_enable ( Microblaze_GPIO_context ctx)

Turns on interrupts globally.

Parameters
[in]ctxthe GPIO context
Return values
None

◆ microblaze_gpio_set_data_direction()

void microblaze_gpio_set_data_direction ( Microblaze_GPIO_context ctx,
uint32_t  channel,
uint32_t  mask 
)

Set pin configuration for the specified GPIO channel.

Changes the pin configuration for a channel. Bits set to 0 are output, and bits set to 1 are input.

Parameters
[in]ctxthe GPIO context
[in]channelthe GPIO channel
[in]maskthe mask to be applied to @ channel
Return values
None