Netcruzer Library API  V2.03
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
nz_ioPortDefs.h File Reference

Defines for I/O ports. More...

Go to the source code of this file.

Data Structures

struct  _PCFG_DIN
 
struct  _PCFG_DOUT
 
union  _UCPORT_CONFIG
 
struct  IOPORT_CONFIG
 
struct  CFG_BLOCK_UC66_PORT
 
struct  CFG_BLOCK_SBC66_PORT
 
struct  UCPORT_PROP
 
struct  IOPORT_PROP
 
struct  TABLE_BLOCK_UC66_PORT
 
struct  TABLE_BLOCK_SBC66_PORT
 

Macros

#define IOPORT_ID_NA   0xff
 
#define UCPORT_ID_NA   0xff
 
#define UCPORT_INDEX_NA   0xff
 
#define BITADR_NA   0xffff
 
#define PCFG_NA_TYPE   0xff
 
#define PCFG_IN_FL_PULLUP   0x80
 
#define PCFG_IN_FL_PULLDOWN   0x40
 
#define PCFG_ADC_TYPE   0x01
 
#define PTYPE_ADC   0x0100
 
#define PCFG_ADC_PULLUP   PCFG_IN_FL_PULLUP
 
#define PCFG_ADC_PULLDOWN   PCFG_IN_FL_PULLDOWN
 
#define PCFG_ADC_2V5_10BIT   0x00
 
#define PCFG_ADC_3V3_10BIT   0x01
 
#define PCFG_ADC_2V5_12BIT   0x10
 
#define PCFG_ADC_3V3_12BIT   0x11
 
#define PCFG_DIN_TYPE   0x02
 
#define PTYPE_DIN   0x0200
 
#define PCFG_DIN_PULLUP   PCFG_IN_FL_PULLUP
 
#define PCFG_DIN_PULLDOWN   PCFG_IN_FL_PULLDOWN
 
#define PCFG_DIN_3V3_IN   0x00
 
#define PCFG_DIN_5V_IN   0x01
 
#define PCFG_UART_RX_TYPE   0x03
 
#define PTYPE_UART_IN   0x0300
 
#define PCFG_UART_PULLUP   PCFG_IN_FL_PULLUP
 
#define PCFG_UART_PULLDOWN   PCFG_IN_FL_PULLDOWN
 
#define PCFG_UART_NUMER_1   0x00
 
#define PCFG_UART_NUMER_2   0x01
 
#define PCFG_UART_NUMER_3   0x02
 
#define PCFG_UART_NUMER_4   0x03
 
#define PCFG_UART_NUMER_5   0x04
 
#define PCFG_UART_NUMER_6   0x05
 
#define PCFG_UART_NUMER_7   0x06
 
#define PCFG_UART_NUMER_8   0x07
 
#define PCFG_USART_RX_TYPE   0x04
 
#define PTYPE_USART_RX   0x0400
 
#define PCFG_USART_PULLUP   PCFG_IN_FL_PULLUP
 
#define PCFG_USART_PULLDOWN   PCFG_IN_FL_PULLDOWN
 
#define PCFG_USART_NUMER_1   0x00
 
#define PCFG_USART_NUMER_2   0x01
 
#define PCFG_USART_NUMER_3   0x02
 
#define PCFG_USART_NUMER_4   0x03
 
#define PCFG_USART_NUMER_5   0x04
 
#define PCFG_USART_NUMER_6   0x05
 
#define PCFG_USART_NUMER_7   0x06
 
#define PCFG_USART_NUMER_8   0x07
 
#define PCFG_SPI_SDI_TYPE   0x05
 
#define PTYPE_SPI_SDI   0x0500
 
#define PCFG_SPI_SS_TYPE   0x06
 
#define PTYPE_SPI_SS   0x0600
 
#define PCFG_SPI_PULLUP   PCFG_IN_FL_PULLUP
 
#define PCFG_SPI_PULLDOWN   PCFG_IN_FL_PULLDOWN
 
#define PCFG_SPI_NUMBER_1   0x00
 
#define PCFG_SPI_NUMBER_2   0x01
 
#define PCFG_SPI_NUMBER_3   0x02
 
#define PCFG_SPI_NUMBER_4   0x03
 
#define PCFG_SPI_NUMBER_5   0x04
 
#define PCFG_SPI_NUMBER_6   0x05
 
#define PCFG_SPI_NUMBER_7   0x06
 
#define PCFG_SPI_NUMBER_8   0x07
 
#define PCFG_OUT_FL_OPEN_COLL   0x80
 
#define PCFG_AOUT_TYPE   0x81
 
#define PTYPE_AOUT   0x8100
 
#define PCFG_AOUT_3V3   0x00
 
#define PCFG_AOUT_3V3_OC   0x01
 
#define PCFG_AOUT_5V   0x02
 
#define PCFG_AOUT_5V_OC   0x03
 
#define PCFG_DOUT_TYPE   0x82
 
#define PTYPE_DOUT   0x8200
 
#define PCFG_DOUT_3V3   0x00
 
#define PCFG_DOUT_3V3_OC   0x01
 
#define PCFG_DOUT_5V   0x02
 
#define PCFG_DOUT_5V_OC   0x03
 
#define PCFG_PWM_TYPE   0x83
 
#define PTYPE_PWM   0x8300
 
#define PCFG_PWM_3V3_10BIT   0x00
 
#define PCFG_PWM_3V3_OC_10BIT   0x01
 
#define PCFG_PWM_5V_10BIT   0x02
 
#define PCFG_PWM_5V_OC_10BIT   0x03
 
#define PCFG_PWM_3V3_12BIT   0x10
 
#define PCFG_PWM_3V3_OC_12BIT   0x11
 
#define PCFG_PWM_5V_12BIT   0x12
 
#define PCFG_PWM_5V_OC_12BIT   0x13
 
#define PCFG_VREFOUT_TYPE   0x84
 
#define PTYPE_VREFOUT   0x8400
 
#define PCFG_VREFOUT_xxx   0x00
 
#define PCFG_UART_OUT_TYPE   0x85
 
#define PTYPE_UART_OUT   0x8500
 
#define PCFG_USART_OUT_TYPE   0x86
 
#define PTYPE_USART_OUT   0x8600
 
#define PCFG_SPI_SDO_TYPE   0x87
 
#define PTYPE_SPI_SDO   0x8700
 
#define PCFG_SPI_CLK_TYPE   0x88
 
#define PTYPE_SPI_CLK   0x8800
 
#define PCFG_I2C_SDA_TYPE   0x89
 
#define PTYPE_I2C_SDA   0x8900
 
#define PCFG_I2C_SCL_TYPE   0x8A
 
#define PTYPE_I2C_SCL   0x8A00
 
#define PCFG_I2C_NUMBER_1   0x00
 
#define PCFG_I2C_NUMBER_2   0x01
 
#define PCFG_I2C_NUMBER_3   0x02
 
#define PCFG_I2C_NUMBER_4   0x03
 
#define PCFG_I2C_NUMBER_5   0x04
 
#define PCFG_I2C_NUMBER_6   0x05
 
#define PCFG_I2C_NUMBER_7   0x06
 
#define PCFG_I2C_NUMBER_8   0x07
 
#define getUcPortNumber()   ((sizeof(CFG_BLOCK_UC66_PORT) - sizeof(((CFG_BLOCK_UC66_PORT*)0)->reserve)) / sizeof(UCPORT_CONFIG))
 
#define UC_PORT_NUMBER   ((sizeof(CFG_BLOCK_UC66_PORT) - sizeof(((CFG_BLOCK_UC66_PORT*)0)->reserve)) / sizeof(UCPORT_CONFIG))
 
#define GET_UCPORT_INDEX(ele)   (offsetof(CFG_BLOCK_UC66_PORT, ele) / sizeof(UCPORT_CONFIG))
 
#define UCPORT_ID_MAX   UCPORT_ID_G15
 
#define UCPORT_PROP_NA_VAL   0xffffffff
 Microcontroller (UC) port property flags. Specifies what the hardware is capable of. More...
 
#define UCPORT_PROP_NA   0x80000000
 When set, all 32-bits are invalid = not available!
 
#define UCPORT_PROP_DIG_IN   0x00000001
 Digital Input.
 
#define UCPORT_PROP_DIG_OUT   0x00000002
 Digital Output.
 
#define UCPORT_PROP_ANALOG_IN   0x00000004
 Analog Input.
 
#define UCPORT_PROP_OPEN_COL   0x00000008
 Open Collector.
 
#define UCPORT_PROP_RP   0x00000010
 Remappable input/output pin.
 
#define UCPORT_PROP_RPI   0x00000020
 Remappable input pin.
 
#define UCPORT_PROP_PULLUP   0x00000040
 Pull-Up.
 
#define UCPORT_PROP_PULLDOWN   0x00000080
 Pull-Down.
 
#define UCPORT_PROP_5V   0x00000100
 5V tolerant
 
#define UCPORT_PROP_SDA   0x00000200
 I2C Data.
 
#define UCPORT_PROP_SCL   0x00000400
 I2C Clock.
 
#define UCPORT_PROP_INT   0x00000800
 Interrupt Input.
 

Typedefs

typedef enum _UCPORT_CONFIG_ID UCPORT_CONFIG_ID
 
typedef struct _PCFG_DIN UCPORT_CONFIG_DIN
 
typedef struct _PCFG_DOUT UCPORT_CONFIG_DOUT
 
typedef union _UCPORT_CONFIG UCPORT_CONFIG
 

Enumerations

enum  _UCPORT_CONFIG_ID {
  UCPORT_ID_A0 = 0, UCPORT_ID_A1, UCPORT_ID_A2, UCPORT_ID_A3,
  UCPORT_ID_A4, UCPORT_ID_A5, UCPORT_ID_A6, UCPORT_ID_A7,
  UCPORT_ID_A8, UCPORT_ID_A9, UCPORT_ID_A10, UCPORT_ID_A11,
  UCPORT_ID_A12, UCPORT_ID_A13, UCPORT_ID_A14, UCPORT_ID_A15,
  UCPORT_ID_B0 = 16, UCPORT_ID_B1, UCPORT_ID_B2, UCPORT_ID_B3,
  UCPORT_ID_B4, UCPORT_ID_B5, UCPORT_ID_B6, UCPORT_ID_B7,
  UCPORT_ID_B8, UCPORT_ID_B9, UCPORT_ID_B10, UCPORT_ID_B11,
  UCPORT_ID_B12, UCPORT_ID_B13, UCPORT_ID_B14, UCPORT_ID_B15,
  UCPORT_ID_C0 = 32, UCPORT_ID_C1, UCPORT_ID_C2, UCPORT_ID_C3,
  UCPORT_ID_C4, UCPORT_ID_C5, UCPORT_ID_C6, UCPORT_ID_C7,
  UCPORT_ID_C8, UCPORT_ID_C9, UCPORT_ID_C10, UCPORT_ID_C11,
  UCPORT_ID_C12, UCPORT_ID_C13, UCPORT_ID_C14, UCPORT_ID_C15,
  UCPORT_ID_D0 = 48, UCPORT_ID_D1, UCPORT_ID_D2, UCPORT_ID_D3,
  UCPORT_ID_D4, UCPORT_ID_D5, UCPORT_ID_D6, UCPORT_ID_D7,
  UCPORT_ID_D8, UCPORT_ID_D9, UCPORT_ID_D10, UCPORT_ID_D11,
  UCPORT_ID_D12, UCPORT_ID_D13, UCPORT_ID_D14, UCPORT_ID_D15,
  UCPORT_ID_E0 = 64, UCPORT_ID_E1, UCPORT_ID_E2, UCPORT_ID_E3,
  UCPORT_ID_E4, UCPORT_ID_E5, UCPORT_ID_E6, UCPORT_ID_E7,
  UCPORT_ID_E8, UCPORT_ID_E9, UCPORT_ID_E10, UCPORT_ID_E11,
  UCPORT_ID_E12, UCPORT_ID_E13, UCPORT_ID_E14, UCPORT_ID_E15,
  UCPORT_ID_F0 = 80, UCPORT_ID_F1, UCPORT_ID_F2, UCPORT_ID_F3,
  UCPORT_ID_F4, UCPORT_ID_F5, UCPORT_ID_F6, UCPORT_ID_F7,
  UCPORT_ID_F8, UCPORT_ID_F9, UCPORT_ID_F10, UCPORT_ID_F11,
  UCPORT_ID_F12, UCPORT_ID_F13, UCPORT_ID_F14, UCPORT_ID_F15,
  UCPORT_ID_G0 = 96, UCPORT_ID_G1, UCPORT_ID_G2, UCPORT_ID_G3,
  UCPORT_ID_G4, UCPORT_ID_G5, UCPORT_ID_G6, UCPORT_ID_G7,
  UCPORT_ID_G8, UCPORT_ID_G9, UCPORT_ID_G10, UCPORT_ID_G11,
  UCPORT_ID_G12, UCPORT_ID_G13, UCPORT_ID_G14, UCPORT_ID_G15
}
 

Variables

const WORD TRIS_PORTID_BITADR_MAP []
 
const BYTE PORTID_UCPORT_MAP []
 

Detailed Description

Defines for I/O ports.

Author
Modtronix Engineering
Compiler:
MPLAB XC16

Description

Defines for I/O ports

Configuration

The following defines are used to configure this module, and should be placed in projdefs.h. Note that all items marked [-DEFAULT-] are defaults, and do not have to be placed in projdefs.h if they contain desired configuration! For details, see Project Configuration.

// *********************************************************************
// ---------------------- ioPorts Configuration ------------------------
// *********************************************************************

Software License Agreement

The software supplied herewith is owned by Modtronix Engineering, and is protected under applicable copyright laws. The software supplied herewith is intended and supplied to you, the Company customer, for use solely and exclusively on products manufactured by Modtronix Engineering. The code may be modified and can be used free of charge for commercial and non commercial applications. All rights are reserved. Any use in violation of the foregoing restrictions may subject the user to criminal sanctions under applicable laws, as well as to civil liability for the breach of the terms and conditions of this license.

THIS SOFTWARE IS PROVIDED IN AN 'AS IS' CONDITION. NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.

File History

2013-11-20, David H. (DH):

  • Initial version

Macro Definition Documentation

#define GET_UCPORT_INDEX (   ele)    (offsetof(CFG_BLOCK_UC66_PORT, ele) / sizeof(UCPORT_CONFIG))

Get index of given port in CFG_BLOCK_UC66_PORT. This is used for various tables

Parameters
eleThe "Microcontroller Port". Can use a literal constant, like "B5" for example. Or, can use the UCPORT_xx defines, for example UCPORT_05
#define getUcPortNumber ( )    ((sizeof(CFG_BLOCK_UC66_PORT) - sizeof(((CFG_BLOCK_UC66_PORT*)0)->reserve)) / sizeof(UCPORT_CONFIG))

Get number of UCPORT_CONFIG structures. This is the number of Microcontroller (UC) ports that can be configured

#define UCPORT_PROP_NA_VAL   0xffffffff

Microcontroller (UC) port property flags. Specifies what the hardware is capable of.

Not defined (use 0xff = erased flash)

Typedef Documentation

Microcontroller (UC) Port Config. Is used to configure a port of the CPU Ensure all WORDs and DWORDs are on 16-bit boundaries, must be done seeing that this struct can be located in internal FLASH!

Microcontroller (UC) Port IDs

Enumeration Type Documentation

Microcontroller (UC) Port IDs