3.26.5 Pins Driver

Overview

The Pins Driver provides the Firmware Implementations of Device pins used by the Peripherals.

Features

Based on the Pin Configuration in MCC Melody User interface Pin specific registers are generated as listed below

  • GPIO Pin APIs
  • IOC - Interrupt-on-Change Registers and APIs
  • PPS - Peripheral Pin Select Module Registers
    • Input
    • Output
    • Bi-Directional
  • I/O Ports Registers
    • PORTx - Port Register
    • LATx - Latch Register
    • TRISx - Direction Register
    • ANSELx - Analog Register
    • CNPUx - Weak-Pull Up
    • CNPDx - Weak-Pull Down
    • ODCx - Output Drain

3.26.5.1 Module Documentation

3.26.5.1.1 Pins Driver

The Pin Driver directs the operation and function of the selected device pins using dsPIC MCUs.

Module description

The Pin Driver directs the operation and function of the selected device pins using dsPIC MCUs.

Definitions
  • #define IO_RA5_SetHigh() (_LATA5 = 1)

    Sets the RA5 GPIO Pin which has a custom name of IO_RA5 to High.

  • #define IO_RA5_SetLow() (_LATA5 = 0)

    Sets the RA5 GPIO Pin which has a custom name of IO_RA5 to Low.

  • #define IO_RA5_Toggle() (_LATA5 ^= 1)

    Toggles the RA5 GPIO Pin which has a custom name of IO_RA5.

  • #define IO_RA5_GetValue() _RA5

    Reads the value of the RA5 GPIO Pin which has a custom name of IO_RA5.

  • #define IO_RA5_SetDigitalInput() (_TRISA5 = 1)

    Configures the RA5 GPIO Pin which has a custom name of IO_RA5 as Input.

  • #define IO_RA5_SetDigitalOutput() (_TRISA5 = 0)

    Configures the RA5 GPIO Pin which has a custom name of IO_RA5 as Output.

  • #define IO_RA8_SetHigh() (_LATA8 = 1)

    Sets the RA8 GPIO Pin which has a custom name of IO_RA8 to High.

  • #define IO_RA8_SetLow() (_LATA8 = 0)

    Sets the RA8 GPIO Pin which has a custom name of IO_RA8 to Low.

  • #define IO_RA8_Toggle() (_LATA8 ^= 1)

    Toggles the RA8 GPIO Pin which has a custom name of IO_RA8.

  • #define IO_RA8_GetValue() _RA8

    Reads the value of the RA8 GPIO Pin which has a custom name of IO_RA8.

  • #define IO_RA8_SetDigitalInput() (_TRISA8 = 1)

    Configures the RA8 GPIO Pin which has a custom name of IO_RA8 as Input.

  • #define IO_RA8_SetDigitalOutput() (_TRISA8 = 0)

    Configures the RA8 GPIO Pin which has a custom name of IO_RA8 as Output.

  • #define IO_RA11_SetHigh() (_LATA11 = 1)

    Sets the RA11 GPIO Pin which has a custom name of IO_RA11 to High.

  • #define IO_RA11_SetLow() (_LATA11 = 0)

    Sets the RA11 GPIO Pin which has a custom name of IO_RA11 to Low.

  • #define IO_RA11_Toggle() (_LATA11 ^= 1)

    Toggles the RA11 GPIO Pin which has a custom name of IO_RA11.

  • #define IO_RA11_GetValue() _RA11

    Reads the value of the RA11 GPIO Pin which has a custom name of IO_RA11.

  • #define IO_RA11_SetDigitalInput() (_TRISA11 = 1)

    Configures the RA11 GPIO Pin which has a custom name of IO_RA11 as Input.

  • #define IO_RA11_SetDigitalOutput() (_TRISA11 = 0)

    Configures the RA11 GPIO Pin which has a custom name of IO_RA11 as Output.

Definition Documentation

IO_RA11_GetValue

#define IO_RA11_GetValue( ) _RA11

Reads the value of the RA11 GPIO Pin which has a custom name of IO_RA11.

Parameters:
none
Returns:

none  

IO_RA11_SetDigitalInput

#define IO_RA11_SetDigitalInput( ) (_TRISA11 = 1)

Configures the RA11 GPIO Pin which has a custom name of IO_RA11 as Input.

Parameters:
none
Returns:

none  

IO_RA11_SetDigitalOutput

#define IO_RA11_SetDigitalOutput( ) (_TRISA11 = 0)

Configures the RA11 GPIO Pin which has a custom name of IO_RA11 as Output.

Parameters:
none
Returns:

none  

IO_RA11_SetHigh

#define IO_RA11_SetHigh( ) (_LATA11 = 1)

Sets the RA11 GPIO Pin which has a custom name of IO_RA11 to High.

Precondition:

The RA11 must be set as Output Pin  

Parameters:
none
Returns:

none  

IO_RA11_SetLow

#define IO_RA11_SetLow( ) (_LATA11 = 0)

Sets the RA11 GPIO Pin which has a custom name of IO_RA11 to Low.

Precondition:

The RA11 must be set as Output Pin

Parameters:
none
Returns:

none  

IO_RA11_Toggle

#define IO_RA11_Toggle( ) (_LATA11 ^= 1)

Toggles the RA11 GPIO Pin which has a custom name of IO_RA11.

Precondition:

The RA11 must be set as Output Pin

Parameters:
none
Returns:

none  

IO_RA5_GetValue

#define IO_RA5_GetValue( ) _RA5

Reads the value of the RA5 GPIO Pin which has a custom name of IO_RA5.

Parameters:
none
Returns:

none  

IO_RA5_SetDigitalInput

#define IO_RA5_SetDigitalInput( ) (_TRISA5 = 1)

Configures the RA5 GPIO Pin which has a custom name of IO_RA5 as Input.

Parameters:
none
Returns:

none  

IO_RA5_SetDigitalOutput

#define IO_RA5_SetDigitalOutput( ) (_TRISA5 = 0)

Configures the RA5 GPIO Pin which has a custom name of IO_RA5 as Output.

Parameters:
none
Returns:

none  

IO_RA5_SetHigh

#define IO_RA5_SetHigh( ) (_LATA5 = 1)

Sets the RA5 GPIO Pin which has a custom name of IO_RA5 to High.

Precondition:

The RA5 must be set as Output Pin  

Parameters:
none
Returns:

none  

IO_RA5_SetLow

#define IO_RA5_SetLow( ) (_LATA5 = 0)

Sets the RA5 GPIO Pin which has a custom name of IO_RA5 to Low.

Precondition:

The RA5 must be set as Output Pin

Parameters:
none
Returns:

none  

IO_RA5_Toggle

#define IO_RA5_Toggle( ) (_LATA5 ^= 1)

Toggles the RA5 GPIO Pin which has a custom name of IO_RA5.

Precondition:

The RA5 must be set as Output Pin

Parameters:
none
Returns:

none  

IO_RA8_GetValue

#define IO_RA8_GetValue( ) _RA8

Reads the value of the RA8 GPIO Pin which has a custom name of IO_RA8.

Parameters:
none
Returns:

none  

IO_RA8_SetDigitalInput

#define IO_RA8_SetDigitalInput( ) (_TRISA8 = 1)

Configures the RA8 GPIO Pin which has a custom name of IO_RA8 as Input.

Parameters:
none
Returns:

none  

IO_RA8_SetDigitalOutput

#define IO_RA8_SetDigitalOutput( ) (_TRISA8 = 0)

Configures the RA8 GPIO Pin which has a custom name of IO_RA8 as Output.

Parameters:
none
Returns:

none  

IO_RA8_SetHigh

#define IO_RA8_SetHigh( ) (_LATA8 = 1)

Sets the RA8 GPIO Pin which has a custom name of IO_RA8 to High.

Precondition:

The RA8 must be set as Output Pin  

Parameters:
none
Returns:

none  

IO_RA8_SetLow

#define IO_RA8_SetLow( ) (_LATA8 = 0)

Sets the RA8 GPIO Pin which has a custom name of IO_RA8 to Low.

Precondition:

The RA8 must be set as Output Pin

Parameters:
none
Returns:

none  

IO_RA8_Toggle

#define IO_RA8_Toggle( ) (_LATA8 ^= 1)

Toggles the RA8 GPIO Pin which has a custom name of IO_RA8.

Precondition:

The RA8 must be set as Output Pin

Parameters:
none
Returns:

none  

Function Documentation

PINS_Initialize()

void PINS_Initialize (void )

Initializes the PINS module.

Parameters:
none
Returns:

none  

3.26.5.2 File Documentation

3.26.5.2.1 source/pins.h File Reference

#include <xc.h>

Macros

  • #define IO_RA5_SetHigh() (_LATA5 = 1)

    Sets the RA5 GPIO Pin which has a custom name of IO_RA5 to High.

  • #define IO_RA5_SetLow() (_LATA5 = 0)

    Sets the RA5 GPIO Pin which has a custom name of IO_RA5 to Low.

  • #define IO_RA5_Toggle() (_LATA5 ^= 1)

    Toggles the RA5 GPIO Pin which has a custom name of IO_RA5.

  • #define IO_RA5_GetValue() _RA5

    Reads the value of the RA5 GPIO Pin which has a custom name of IO_RA5.

  • #define IO_RA5_SetDigitalInput() (_TRISA5 = 1)

    Configures the RA5 GPIO Pin which has a custom name of IO_RA5 as Input.

  • #define IO_RA5_SetDigitalOutput() (_TRISA5 = 0)

    Configures the RA5 GPIO Pin which has a custom name of IO_RA5 as Output.

  • #define IO_RA8_SetHigh() (_LATA8 = 1)

    Sets the RA8 GPIO Pin which has a custom name of IO_RA8 to High.

  • #define IO_RA8_SetLow() (_LATA8 = 0)

    Sets the RA8 GPIO Pin which has a custom name of IO_RA8 to Low.

  • #define IO_RA8_Toggle() (_LATA8 ^= 1)

    Toggles the RA8 GPIO Pin which has a custom name of IO_RA8.

  • #define IO_RA8_GetValue() _RA8

    Reads the value of the RA8 GPIO Pin which has a custom name of IO_RA8.

  • #define IO_RA8_SetDigitalInput() (_TRISA8 = 1)

    Configures the RA8 GPIO Pin which has a custom name of IO_RA8 as Input.

  • #define IO_RA8_SetDigitalOutput() (_TRISA8 = 0)

    Configures the RA8 GPIO Pin which has a custom name of IO_RA8 as Output.

  • #define IO_RA11_SetHigh() (_LATA11 = 1)

    Sets the RA11 GPIO Pin which has a custom name of IO_RA11 to High.

  • #define IO_RA11_SetLow() (_LATA11 = 0)

    Sets the RA11 GPIO Pin which has a custom name of IO_RA11 to Low.

  • #define IO_RA11_Toggle() (_LATA11 ^= 1)

    Toggles the RA11 GPIO Pin which has a custom name of IO_RA11.

  • #define IO_RA11_GetValue() _RA11

    Reads the value of the RA11 GPIO Pin which has a custom name of IO_RA11.

  • #define IO_RA11_SetDigitalInput() (_TRISA11 = 1)

    Configures the RA11 GPIO Pin which has a custom name of IO_RA11 as Input.

  • #define IO_RA11_SetDigitalOutput() (_TRISA11 = 0)

    Configures the RA11 GPIO Pin which has a custom name of IO_RA11 as Output.

Detailed Description

PINS Generated Driver Header File