Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example

Public functions of the GPIO PRAL driver. More...

+ Collaboration diagram for Public Functions:

Functions

volatile struct P33C_GPIO_INSTANCE_sp33c_GpioInstance_GetHandle (volatile uint16_t gpioInstance)
 Gets pointer to GPIO Instance SFR set. More...
 
volatile uint16_t p33c_GpioInstance_Dispose (volatile uint16_t gpioInstance)
 Resets all GPIO Instance registers to their RESET default values. More...
 
volatile struct P33C_GPIO_INSTANCE_s p33c_GpioInstance_ConfigRead (volatile uint16_t gpioInstance)
 Read the current configuration from the GPIO instance registers
More...
 
volatile uint16_t p33c_GpioInstance_ConfigWrite (volatile uint16_t gpioInstance, volatile struct P33C_GPIO_INSTANCE_s gpioConfig)
 Writes a user-defined configuration to the GPIO instance registers. More...
 

Detailed Description

Public functions of the GPIO PRAL driver.

This is the detailed description of public functions of the GPIO PRAL driver

Function Documentation

◆ p33c_GpioInstance_ConfigRead()

struct P33C_GPIO_INSTANCE_s p33c_GpioInstance_ConfigRead ( volatile uint16_t  gpioInstance)

Read the current configuration from the GPIO instance registers

Parameters
gpioInstanceIndex of the selected GPIO Instance (1=Port A, 2=Port B, etc.)
Returns
0 = failure, reading GPIO instance was not successful (returns NULL)
n = success, reading GPIO instance was successful (returns 16-bit wide pointer)

This function reads all registers with their current configuration into a data structure of type P33C_GPIO_INSTANCE_s. Users can read and verify or modify the configuration to write it back to the GPIO instance
registers or copy configurations to other instances of the same type.

Definition at line 77 of file p33c_gpio.c.

◆ p33c_GpioInstance_ConfigWrite()

uint16_t p33c_GpioInstance_ConfigWrite ( volatile uint16_t  gpioInstance,
volatile struct P33C_GPIO_INSTANCE_s  gpioConfig 
)

Writes a user-defined configuration to the GPIO instance registers.

Parameters
gpioInstanceIndex of the selected GPIO Instance (1=Port A, 2=Port B, etc.)
gpioConfigGPIO peripheral instance SFR object of type struct P33C_GPIO_INSTANCE_s
Returns
0 = failure, writing GPIO instance was not successful
1 = success, writing GPIO instance was successful

This function writes a user-defined GPIO instance configuration of type P33C_GPIO_INSTANCE_s to the GPIO instance registers. The individual register configurations have to be set in user-code before calling this function. To simplify the configuration process of standard functions, this driver provides templates, which can be loaded and written directly.

Definition at line 133 of file p33c_gpio.c.

+ Here is the caller graph for this function:

◆ p33c_GpioInstance_Dispose()

uint16_t p33c_GpioInstance_Dispose ( volatile uint16_t  gpioInstance)

Resets all GPIO Instance registers to their RESET default values.

Parameters
gpioInstanceIndex of the selected GPIO Instance (1=Port A, 2=Port B, etc.)
Returns
0 = failure, disposing GPIO instance was not successful
1 = success, disposing GPIO instance was successful

This function clears all GPIO Instance registers to their default values set when the device comes out of RESET.

Default configuration:

  • all outputs are set to logic functions
  • all analog functions are disabled
  • all pull-up and pull-down resistors are disabled
  • all GPIOs are operating in push-pull mode (open drain disabled)
  • all GPIOs are configured as input with their signal level HIGH

Definition at line 77 of file p33c_gpio.c.

+ Here is the call graph for this function:

◆ p33c_GpioInstance_GetHandle()

struct P33C_GPIO_INSTANCE_s * p33c_GpioInstance_GetHandle ( volatile uint16_t  gpioInstance)

Gets pointer to GPIO Instance SFR set.

Parameters
gpioInstanceIndex of the selected GPIO Instance (1=Port A, 2=Port B, etc.)
Returns
Pointer to GPIO instance object of type struct P33C_GPIO_INSTANCE_s of the selected GPIO instance

This function returns the pointer to a GPIO instance register set in Special Function Register memory space. This pointer can be used to directly write to/read from the Special Function Registers of a given peripheral instance.

Definition at line 45 of file p33c_gpio.c.

+ Here is the caller graph for this function: