Microchip® Advanced Software Framework

m2m_periph.h File Reference

WINC Peripherals Application Interface.

Copyright (c) 2016-2021 Microchip Technology Inc. and its subsidiaries.

Enumerations

enum  tenuGpioNum {
  M2M_PERIPH_GPIO0 = 0,
  M2M_PERIPH_GPIO1 = 1,
  M2M_PERIPH_GPIO2 = 2,
  M2M_PERIPH_GPIO3 = 3,
  M2M_PERIPH_GPIO4 = 4,
  M2M_PERIPH_GPIO5 = 5,
  M2M_PERIPH_GPIO6 = 6,
  M2M_PERIPH_GPIO_MAX
}
 A list of GPIO numbers configurable through the m2m_periph module. More...
 
enum  tenuPullupMask {
  M2M_PERIPH_PULLUP_DIS_HOST_WAKEUP = (1ul << 0),
  M2M_PERIPH_PULLUP_DIS_RTC_CLK = (1ul << 1),
  M2M_PERIPH_PULLUP_DIS_IRQN = (1ul << 2),
  M2M_PERIPH_PULLUP_DIS_GPIO_3 = (1ul << 3),
  M2M_PERIPH_PULLUP_DIS_GPIO_4 = (1ul << 4),
  M2M_PERIPH_PULLUP_DIS_GPIO_5 = (1ul << 5),
  M2M_PERIPH_PULLUP_DIS_SD_DAT3 = (1ul << 6),
  M2M_PERIPH_PULLUP_DIS_SD_DAT2_SPI_RXD = (1ul << 7),
  M2M_PERIPH_PULLUP_DIS_SD_DAT1_SPI_SSN = (1ul << 9),
  M2M_PERIPH_PULLUP_DIS_SD_CMD_SPI_SCK = (1ul << 10),
  M2M_PERIPH_PULLUP_DIS_SD_DAT0_SPI_TXD = (1ul << 11),
  M2M_PERIPH_PULLUP_DIS_GPIO_6 = (1ul << 12),
  M2M_PERIPH_PULLUP_DIS_SD_CLK = (1ul << 13),
  M2M_PERIPH_PULLUP_DIS_I2C_SCL = (1ul << 14),
  M2M_PERIPH_PULLUP_DIS_I2C_SDA = (1ul << 15),
  M2M_PERIPH_PULLUP_DIS_GPIO_11 = (1ul << 16),
  M2M_PERIPH_PULLUP_DIS_GPIO_12 = (1ul << 17),
  M2M_PERIPH_PULLUP_DIS_GPIO_13 = (1ul << 18),
  M2M_PERIPH_PULLUP_DIS_GPIO_14 = (1ul << 19),
  M2M_PERIPH_PULLUP_DIS_GPIO_15 = (1ul << 20),
  M2M_PERIPH_PULLUP_DIS_GPIO_16 = (1ul << 21),
  M2M_PERIPH_PULLUP_DIS_GPIO_17 = (1ul << 22),
  M2M_PERIPH_PULLUP_DIS_GPIO_18 = (1ul << 23),
  M2M_PERIPH_PULLUP_DIS_GPIO_19 = (1ul << 24),
  M2M_PERIPH_PULLUP_DIS_GPIO_20 = (1ul << 25),
  M2M_PERIPH_PULLUP_DIS_GPIO_21 = (1ul << 26),
  M2M_PERIPH_PULLUP_DIS_GPIO_22 = (1ul << 27),
  M2M_PERIPH_PULLUP_DIS_GPIO_23 = (1ul << 28),
  M2M_PERIPH_PULLUP_DIS_GPIO_24 = (1ul << 29)
}
 Bitwise-ORed flags for use in m2m_periph_pullup_ctrl. More...
 

Functions

NMI_API sint8 m2m_periph_gpio_get_val (uint8 u8GpioNum, uint8 *pu8GpioVal)
 Read an WINC15x0 GPIO input level. More...
 
NMI_API sint8 m2m_periph_gpio_set_dir (uint8 u8GpioNum, uint8 u8GpioDir)
 Configure a specific WINC15x0 pad as a GPIO and sets its direction (input or output). More...
 
NMI_API sint8 m2m_periph_gpio_set_val (uint8 u8GpioNum, uint8 u8GpioVal)
 Set an WINC15x0 GPIO output level high or low. More...
 
NMI_API sint8 m2m_periph_pullup_ctrl (uint32 pinmask, uint8 enable)
 Control the programmable pull-up resistor on the chip pads . More...
 

A list of GPIO numbers configurable through the m2m_periph module.

Enumerator
M2M_PERIPH_GPIO0 

GPIO0 pad

M2M_PERIPH_GPIO1 

GPIO1 pad

M2M_PERIPH_GPIO2 

GPIO2 pad

M2M_PERIPH_GPIO3 

GPIO3 pad

M2M_PERIPH_GPIO4 

GPIO4 pad

M2M_PERIPH_GPIO5 

GPIO5 pad

M2M_PERIPH_GPIO6 

GPIO6 pad

M2M_PERIPH_GPIO_MAX 

Bitwise-ORed flags for use in m2m_periph_pullup_ctrl.

See Also
m2m_periph_pullup_ctrl
Enumerator
M2M_PERIPH_PULLUP_DIS_HOST_WAKEUP 
M2M_PERIPH_PULLUP_DIS_RTC_CLK 
M2M_PERIPH_PULLUP_DIS_IRQN 
M2M_PERIPH_PULLUP_DIS_GPIO_3 
M2M_PERIPH_PULLUP_DIS_GPIO_4 
M2M_PERIPH_PULLUP_DIS_GPIO_5 
M2M_PERIPH_PULLUP_DIS_SD_DAT3 
M2M_PERIPH_PULLUP_DIS_SD_DAT2_SPI_RXD 
M2M_PERIPH_PULLUP_DIS_SD_DAT1_SPI_SSN 
M2M_PERIPH_PULLUP_DIS_SD_CMD_SPI_SCK 
M2M_PERIPH_PULLUP_DIS_SD_DAT0_SPI_TXD 
M2M_PERIPH_PULLUP_DIS_GPIO_6 
M2M_PERIPH_PULLUP_DIS_SD_CLK 
M2M_PERIPH_PULLUP_DIS_I2C_SCL 
M2M_PERIPH_PULLUP_DIS_I2C_SDA 
M2M_PERIPH_PULLUP_DIS_GPIO_11 
M2M_PERIPH_PULLUP_DIS_GPIO_12 
M2M_PERIPH_PULLUP_DIS_GPIO_13 
M2M_PERIPH_PULLUP_DIS_GPIO_14 
M2M_PERIPH_PULLUP_DIS_GPIO_15 
M2M_PERIPH_PULLUP_DIS_GPIO_16 
M2M_PERIPH_PULLUP_DIS_GPIO_17 
M2M_PERIPH_PULLUP_DIS_GPIO_18 
M2M_PERIPH_PULLUP_DIS_GPIO_19 
M2M_PERIPH_PULLUP_DIS_GPIO_20 
M2M_PERIPH_PULLUP_DIS_GPIO_21 
M2M_PERIPH_PULLUP_DIS_GPIO_22 
M2M_PERIPH_PULLUP_DIS_GPIO_23 
M2M_PERIPH_PULLUP_DIS_GPIO_24 

NMI_API sint8 m2m_periph_gpio_get_val ( uint8  u8GpioNum,
uint8 pu8GpioVal 
)

Read an WINC15x0 GPIO input level.

Parameters
[in]u8GpioNumGPIO number. Allowed values are defined in tenuGpioNum.
[out]pu8GpioValGPIO input value. Zero = low, non-zero = high.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
See Also
tenuGpioNum
NMI_API sint8 m2m_periph_gpio_set_dir ( uint8  u8GpioNum,
uint8  u8GpioDir 
)

Configure a specific WINC15x0 pad as a GPIO and sets its direction (input or output).

Parameters
[in]u8GpioNumGPIO number. Allowed values are defined in tenuGpioNum.
[in]u8GpioDirGPIO direction: Zero = input. Non-zero = output.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
See Also
tenuGpioNum
NMI_API sint8 m2m_periph_gpio_set_val ( uint8  u8GpioNum,
uint8  u8GpioVal 
)

Set an WINC15x0 GPIO output level high or low.

Parameters
[in]u8GpioNumGPIO number. Allowed values are defined in tenuGpioNum.
[in]u8GpioValGPIO output value. Zero = low, non-zero = high.
Returns
The function SHALL return 0 for success and a negative value otherwise.
See Also
tenuGpioNum
NMI_API sint8 m2m_periph_pullup_ctrl ( uint32  pinmask,
uint8  enable 
)

Control the programmable pull-up resistor on the chip pads .

Parameters
[in]pinmaskWrite operation bitwise-ORed mask for which pads to control. Allowed values are defined in tenuPullupMask.
[in]enableSet to 0 to disable pull-up resistor. Non-zero will enable the pull-up.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
See Also
tenuPullupMask