RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Functions
microblaze-gpio.c File Reference

MicroBlaze AXI GPIO implementation. More...

#include <assert.h>
#include <bsp/fatal.h>
#include <bsp/fdt.h>
#include <bsp/microblaze-gpio.h>
#include <libfdt.h>

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 implementation.

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