15. lpc17xx_gpio Module

General purpose IO client library functions. Find implementation details in LPC17xx CMSIS-Compliant Standard Peripheral Firmware Driver Library documentation.

robovero.lpc17xx_gpio.FIO_ByteClearValue(portNum, byteNum, bitValue)

Clear bits for FIO port in byte accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • byteNum: Byte part number, should be in range from 0 to 3
  • bitValue: Value that contains all bits in to clear, in range from 0 to 0xFF.
robovero.lpc17xx_gpio.FIO_ByteReadValue(portNum, byteNum)

Read Current state on port pin that have input direction of GPIO in byte accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • byteNum: Byte part number, should be in range from 0 to 3

Return:

  • Current value of FIO port pin of specified byte part.
robovero.lpc17xx_gpio.FIO_ByteSetDir(portNum, byteNum, bitValue, direction)

Set direction for FIO port in byte accessible style.

Args:

  • portNum: Port number, in range from 0 to 4

  • byteNum: Byte part number, should be in range from 0 to 3

  • bitValue: Value that contains all bits in to set direction, in range from 0 to

    0xFF.

  • direction: Direction value, should be:

    • 0: Input
    • 1: Output
robovero.lpc17xx_gpio.FIO_ByteSetMask(portNum, byteNum, bitValue, maskValue)

Set mask value for bits in FIO port in byte accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • byteNum: Byte part number, should be in range from 0 to 3
  • bitValue: Value that contains all bits in to set mask, in range from 0 to 0xFF
  • maskValue: Mask value contains state value for each bit:
    • 0: not mask
    • 1: mask
robovero.lpc17xx_gpio.FIO_ByteSetValue(portNum, byteNum, bitValue)

Set bits for FIO port in byte accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • byteNum: Byte part number, should be in range from 0 to 3
  • bitValue: Value that contains all bits in to set, in range from 0 to 0xFF.
robovero.lpc17xx_gpio.FIO_ClearInt(portNum, pinNum)

Clear GPIO interrupt (just used for P0.0-P0.30, P2.0-P2.13).

Args:

  • portNum: Port number to read value, should be: 0 or 2

  • bitValue: Value that contains all bits on GPIO to enable, in range from 0 to

    0xFFFFFFFF.

robovero.lpc17xx_gpio.FIO_ClearValue(portNum, bitValue)

Clear Value for bits that have output direction on GPIO port..

Args:

  • portNum: Port number value, should be in range from 0 to 4

  • bitValue: Value that contains all bits on GPIO to clear, in range from 0 to

    0xFFFFFFFF.

robovero.lpc17xx_gpio.FIO_GetIntStatus(portNum, pinNum, edgeState)

Get GPIO Interrupt Status (just used for P0.0-P0.30, P2.0-P2.13).

ArgS:

  • portNum: Port number to read value, should be: 0 or 2
  • pinNum: Pin number, should be: 0..30 (with port 0) and 0..13 (with port 2)
  • edgeState: state of edge, should be:
    • 0: Rising edge
    • 1: Falling edge

Return:

  • ENABLE: Interrupt has been generated due to a rising edge on P0.0
  • DISABLE: A rising edge has not been detected on P0.0
robovero.lpc17xx_gpio.FIO_HalfWordClearValue(portNum, halfwordNum, bitValue)

Clear bits for FIO port in halfword accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • halfwordNum: HalfWord part number, should be 0 (lower) or 1(upper)
  • bitValue: Value that contains all bits in to clear, in range from 0 to 0xFFFF.
robovero.lpc17xx_gpio.FIO_HalfWordReadValue(portNum, halfwordNum)

Read Current state on port pin that have input direction of GPIO in halfword accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • halfwordNum: HalfWord part number, should be 0 (lower) or 1(upper)

Return:

  • Current value of FIO port pin of specified halfword.
robovero.lpc17xx_gpio.FIO_HalfWordSetDir(portNum, halfwordNum, bitValue, direction)

Set direction for FIO port in halfword accessible style.

Args:

  • portNum: Port number, in range from 0 to 4

  • halfwordNum: HalfWord part number, should be 0 (lower) or 1(upper)

  • bitValue: Value that contains all bits in to set direction, in range from 0 to

    0xFFFF.

  • direction: Direction value, should be:

    • 0: Input
    • 1: Output
robovero.lpc17xx_gpio.FIO_HalfWordSetMask(portNum, halfwordNum, bitValue, maskValue)

Set mask value for bits in FIO port in halfword accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • halfwordNum: HalfWord part number, should be 0 (lower) or 1(upper)
  • bitValue: Value that contains all bits in to set, in range from 0 to 0xFFFF
  • maskValue: Mask value contains state value for each bit:
    • 0: not mask
    • 1: mask
robovero.lpc17xx_gpio.FIO_HalfWordSetValue(portNum, halfwordNum, bitValue)

Set bits for FIO port in halfword accessible style.

Args:

  • portNum: Port number, in range from 0 to 4
  • halfwordNum: HalfWord part number, should be 0 (lower) or 1(upper)
  • bitValue: Value that contains all bits in to set, in range from 0 to 0xFFFF.
robovero.lpc17xx_gpio.FIO_IntCmd(portNum, bitValue, edgeState)

Enable GPIO interrupt (just used for P0.0-P0.30, P2.0-P2.13).

Args:

  • portNum: Port number to read value, should be: 0 or 2

  • bitValue: Value that contains all bits on GPIO to enable, in range from 0 to

    0xFFFFFFFF.

  • edgeState: state of edge, should be:

    • 0: Rising edge
    • 1: Falling edge
robovero.lpc17xx_gpio.FIO_ReadValue(portNum)

Read Current state on port pin that have input direction of GPIO.

Args:

  • portNum: Port number to read value, in range from 0 to 4

Return:

  • Current value of GPIO port.
robovero.lpc17xx_gpio.FIO_SetDir(portNum, bitValue, direction)

Set Direction for GPIO port.

Args:

  • portNum: Port Number value, should be in range from 0 to 4

  • bitValue: Value that contains all bits to set direction, in range from 0 to

    0xFFFFFFFF.

  • direction: Direction value, should be:

    • 0: Input
    • 1: Output
robovero.lpc17xx_gpio.FIO_SetMask(portNum, bitValue, maskValue)

Set mask value for bits in FIO port.

Args:

  • portNum: Port number, in range from 0 to 4

  • bitValue: Value that contains all bits to set direction, in range from 0 to

    0xFFFFFFFF.

  • maskValue: Mask value contains state value for each bit: - 0: not mask - 1: mask

robovero.lpc17xx_gpio.FIO_SetValue(portNum, bitValue)

Set Value for bits that have output direction on GPIO port.

Args:

  • portNum: Port number value, should be in range from 0 to 4

  • bitValue: Value that contains all bits on GPIO to set, in range from 0 to

    0xFFFFFFFF

robovero.lpc17xx_gpio.GPIO_ClearInt(portNum, bitValue)

Clear GPIO interrupt (just used for P0.0-P0.30, P2.0-P2.13).

Args:

  • portNum: Port number to read value, should be: 0 or 2

  • bitValue: Value that contains all bits on GPIO to enable, in range from 0 to

    0xFFFFFFFF.

robovero.lpc17xx_gpio.GPIO_ClearValue(portNum, bitValue)

Clear Value for bits that have output direction on GPIO port..

Args:

  • portNum: Port number value, should be in range from 0 to 4

  • bitValue: Value that contains all bits on GPIO to clear, in range from 0 to

    0xFFFFFFFF.

robovero.lpc17xx_gpio.GPIO_GetIntStatus(portNum, pinNum, edgeState)

Get GPIO Interrupt Status (just used for P0.0-P0.30, P2.0-P2.13).

Args:

  • portNum: Port number to read value, should be: 0 or 2

  • pinNum: Pin number, should be: 0..30 (with port 0) and 0..13 (with port 2)

  • edgeState: state of edge, should be:

    0: Rising edge 1: Falling edge

Return:

  • ENABLE: Interrupt has been generated due to a rising edge on P0.0
  • DISABLE: A rising edge has not been detected on P0.0
class robovero.lpc17xx_gpio.GPIO_HalfWord_TypeDef(**kwargs)

Bases: robovero.internals.cstruct

Fast GPIO port half-word type definition.

  • FIODIRL: FIO direction register lower halfword part

  • FIODIRU: FIO direction register upper halfword part

  • FIOMASKL: FIO mask register lower halfword part

  • FIOMASKU: FIO mask register upper halfword part

  • FIOPINL: FIO pin register lower halfword part

  • FIOPINU: FIO pin register upper halfword part

  • FIOSETL: FIO set register lower halfword part

  • FIOSETU: FIO set register upper halfword part

  • FIOCLRL: FIO clear register lower halfword part

  • FIOCLRU: FIO clear register upper halfword part

  • ptr: LPC1769 memory address where structure is stored. Use this in place of

    the C reference operator (&).

robovero.lpc17xx_gpio.GPIO_IntCmd(portNum, bitValue, edgeState)

Enable GPIO interrupt (just used for P0.0-P0.30, P2.0-P2.13).

Args:

  • portNum: Port number to read value, should be: 0 or 2

  • bitValue: Value that contains all bits on GPIO to enable, in range from 0 to

    0xFFFFFFFF.

  • edgeState: state of edge, should be:

    • 0: Rising edge
    • 1: Falling edge
robovero.lpc17xx_gpio.GPIO_ReadValue(portNum)

Read Current state on port pin that have input direction of GPIO.

Args:

  • portNum: Port number to read value, in range from 0 to 4

Return:

  • Current value of GPIO port.
robovero.lpc17xx_gpio.GPIO_SetDir(portNum, bitValue, direction)

Set Direction for GPIO port.

Args:

  • portNum: Port Number value, should be in range from 0 to 4

  • bitValue: Value that contains all bits to set direction, in range from 0 to

    0xFFFFFFFF.

  • direction: Direction value, should be:

    • 0: Input
    • 1: Output
robovero.lpc17xx_gpio.GPIO_SetValue(portNum, bitValue)

Set Value for bits that have output direction on GPIO port.

Args:

  • portNum: Port number value, should be in range from 0 to 4

  • bitValue: Value that contains all bits on GPIO to set, in range from 0 to

    0xFFFFFFFF