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

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

+ Collaboration diagram for Public Functions:

Functions

volatile uint16_t PPS_LockIO (void)
 Locks the Peripheral Pin Select Configuration registers against accidental changes. More...
 
volatile uint16_t PPS_UnlockIO (void)
 Unlocks the Peripheral Pin Select Configuration registers to enable changes. More...
 
volatile uint16_t PPS_RemapOutput (volatile uint8_t pinno, volatile uint8_t peripheral)
 Assigns a digital function output to a pin. More...
 
volatile uint16_t PPS_RemapInput (volatile uint8_t pinno, volatile uint8_t *peripheral)
 Assigns a pin to a digital function input. More...
 
volatile uint16_t PPS_UnmapOutput (volatile uint8_t pinno)
 Disconnects a pin from a digital function output. More...
 
volatile uint16_t PPS_UnmapInput (volatile uint8_t *peripheral)
 Disconnects a pin from a digital function input. More...
 

Detailed Description

Public functions of the PPS PRAL driver.

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

Function Documentation

◆ PPS_LockIO()

uint16_t PPS_LockIO ( void  )

Locks the Peripheral Pin Select Configuration registers against accidental changes.

Returns
unsigned integer 1: Success 0: Error

This inline-assembly routine locks the Port Multiplexing Configuration registers by keeping the required number of cycles during the Lock pocess. This function has to be called once before digital functions are mapped to a specific pin. Once called, a series of assignments can be executed.

Note
If bit IOL1WAY in the Oscillator Configuration Bits (FOSC) is set, only one pin assignment operation will be allowed. all following calls of Unlock() or Lock() will be ignored.
See also
p33c_pps.h

Definition at line 75 of file p33c_pps.c.

◆ PPS_RemapInput()

uint16_t PPS_RemapInput ( volatile uint8_t  pinno,
volatile uint8_t *  peripheral 
)

Assigns a pin to a digital function input.

Parameters
pinnoIndex number of the RPx-pin of type uint8_t, which should be assigned to the function
peripheralPointer to peripheral/function of type uint8_t, which should be assigned to the pin
Returns
unsigned integer 1: Success 0: Error

Any RPx pin can be assigned to a supported digital function input (e.g. UART RxD). To assign a pin to a function input, call

smpsPPS_RemapInput([RP-NUMBER], [FUNCTION])

lres |= smpsPPS_RemapInput(PIN_RP10, PPSIN_U1RX); // Assign RP10 to UART1 RxD
See also
p33SMPS_pps.h, FOSC, IOL1WAY, IOL1WAY_ON, IOL1WAY_OFF, smpsPPS_LockIO, smpsPPS_UnlockIO, smpsPPS_RemapOutput, smpsPPS_UnmapInput, smpsPPS_UnmapOutput

Definition at line 174 of file p33c_pps.c.

+ Here is the caller graph for this function:

◆ PPS_RemapOutput()

uint16_t PPS_RemapOutput ( volatile uint8_t  pinno,
volatile uint8_t  peripheral 
)

Assigns a digital function output to a pin.

Parameters
pinnoIndex number of the RPx-pin of type uint8_t, which should be assigned to the function
peripheralPeripheral/Function ID of type uint8_t, which should be assigned to the pin
Returns
unsigned integer 1: Success 0: Error

Any supported digital function output (e.g. UART TxD) can be assigned to one of the RPx pins of the MCU/DSC. To assign a function output to a pin, call

smpsPPS_RemapOutput([RP-NUMBER], [FUNCTION])

lres |= smpsPPS_RemapOutput(PIN_RP9 , PPSOUT_SYNCO1); // Assign RP9 to PWMSyncClkOutput
See also
p33c_pps.h

Definition at line 133 of file p33c_pps.c.

+ Here is the caller graph for this function:

◆ PPS_UnlockIO()

uint16_t PPS_UnlockIO ( void  )

Unlocks the Peripheral Pin Select Configuration registers to enable changes.

Returns
unsigned integer 1: Success 0: Error

This inline-assembly routine unlocks the Port Multiplexing Configuration registers by keeping the required number of cycles during the unlock process. This function has to be called once after digital functions have been mapped to a specific pin, to prevent accidental changes.

Note
If bit IOL1WAY in the Oscillator Configuration Bits (FOSC) is set, only one pin assignment operation will be allowed. all following calls of Unlock() or Lock() will be ignored.
See also
p33c_pps.h

Definition at line 102 of file p33c_pps.c.

◆ PPS_UnmapInput()

uint16_t PPS_UnmapInput ( volatile uint8_t *  peripheral)

Disconnects a pin from a digital function input.

Parameters
peripheralPointer to peripheral of type uint8_t, which should be assigned to the pin
Returns
unsigned integer
1: Success 0: Error

An existing assignment between any RPx pin and a supported digital function input will be dissolved.

smpsPPS_UnmapInput([RP-NUMBER])

lres |= smpsPPS_UnmapInput(PIN_RP10); // Dissolve RP10 assignment
See also
p33c_pps.h

Definition at line 240 of file p33c_pps.c.

+ Here is the call graph for this function:

◆ PPS_UnmapOutput()

uint16_t PPS_UnmapOutput ( volatile uint8_t  pinno)

Disconnects a pin from a digital function output.

Parameters
pinnoIndex number of the RPx-pin of type uint8_t, which should be assigned to the function
Returns
unsigned integer
1: Success 0: Error

An existing assignment between any RPx pin and a supported digital function output will be dissolved.

smpsPPS_UnmapOutput([RP-NUMBER])

lres |= smpsPPS_UnmapOutput(PIN_RP10); // Dissolve RP10 assignment
See also
p33c_pps.h

Definition at line 207 of file p33c_pps.c.

+ Here is the call graph for this function: