WILC Peripherials Application Interface.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
#include "driver/include/m2m_periph.h"
#include "driver/source/nmasic.h"
#include "driver/source/m2m_hif.h"
Macros | |
#define | GPIO_OP_DIR 0 |
#define | GPIO_OP_GET 2 |
#define | GPIO_OP_SET 1 |
Functions | |
static sint8 | get_gpio_idx (uint8 u8GpioNum) |
static sint8 | gpio_ioctl (uint8 op, uint8 u8GpioNum, uint8 u8InVal, uint8 *pu8OutVal) |
GPIO read/write skeleton with wakeup/sleep capability. More... | |
sint8 | m2m_periph_gpio_get_val (uint8 u8GpioNum, uint8 *pu8GpioVal) |
Read an NMC1500 GPIO input level. More... | |
sint8 | m2m_periph_gpio_pullup_ctrl (uint8 u8GpioNum, uint8 u8PullupEn) |
Set an NMC1500 GPIO pullup resisitor enable or disable. More... | |
sint8 | m2m_periph_gpio_set_dir (uint8 u8GpioNum, uint8 u8GpioDir) |
Configure a specific NMC1500 pad as a GPIO and sets its direction (input or output). More... | |
sint8 | m2m_periph_gpio_set_val (uint8 u8GpioNum, uint8 u8GpioVal) |
Set an NMC1500 GPIO output level high or low. More... | |
sint8 | m2m_periph_i2c_master_init (tstrI2cMasterInitParam *param) |
Initialize and configure the NMC1500 I2C master peripheral. More... | |
sint8 | m2m_periph_i2c_master_read (uint8 u8SlaveAddr, uint8 *pu8Buf, uint16 u16BufLen, uint16 *pu16ReadLen, uint8 flags) |
Write a stream of bytes to the I2C slave device. More... | |
sint8 | m2m_periph_i2c_master_write (uint8 u8SlaveAddr, uint8 *pu8Buf, uint16 u16BufLen, uint8 flags) |
Write a stream of bytes to the I2C slave device. More... | |
sint8 | m2m_periph_init (tstrPerphInitParam *param) |
Initialize the NMC1500 peripheral driver module. More... | |
sint8 | m2m_periph_pullup_ctrl (uint32 pinmask, uint8 enable) |
Control the programmable pull-up resistor on the chip pads . More... | |
#define GPIO_OP_DIR 0 |
Referenced by gpio_ioctl(), and m2m_periph_gpio_set_dir().
#define GPIO_OP_GET 2 |
Referenced by gpio_ioctl(), and m2m_periph_gpio_get_val().
#define GPIO_OP_SET 1 |
Referenced by gpio_ioctl(), and m2m_periph_gpio_set_val().
References M2M_PERIPH_GPIO15, M2M_PERIPH_GPIO16, M2M_PERIPH_GPIO18, and M2M_PERIPH_GPIO_MAX.
Referenced by gpio_ioctl().
GPIO read/write skeleton with wakeup/sleep capability.
References get_gpio_idx(), get_gpio_val(), GPIO_OP_DIR, GPIO_OP_GET, GPIO_OP_SET, hif_chip_sleep(), hif_chip_wake(), M2M_SUCCESS, set_gpio_dir(), and set_gpio_val().
Referenced by m2m_periph_gpio_get_val(), m2m_periph_gpio_set_dir(), and m2m_periph_gpio_set_val().
Read an NMC1500 GPIO input level.
Read an WINC15x0 GPIO input level.
[in] | u8GpioNum | GPIO number. Allowed values are defined in tenuGpioNum. |
[out] | pu8GpioVal | GPIO input value. Zero = low, non-zero = high. |
[in] | u8GpioNum | GPIO number. Allowed values are defined in tenuGpioNum. |
[out] | pu8GpioVal | GPIO input value. Zero = low, non-zero = high. |
Set an NMC1500 GPIO pullup resisitor enable or disable.
[in] | u8GpioNum | GPIO number. Allowed values are defined in tenuGpioNum. |
[in] | u8PullupEn | Zero: pullup disabled. Non-zero: pullup enabled. |
References M2M_SUCCESS.
Configure a specific NMC1500 pad as a GPIO and sets its direction (input or output).
Configure a specific WINC15x0 pad as a GPIO and sets its direction (input or output).
[in] | u8GpioNum | GPIO number. Allowed values are defined in tenuGpioNum. |
[in] | u8GpioDir | GPIO direction: Zero = input. Non-zero = output. |
[in] | u8GpioNum | GPIO number. Allowed values are defined in tenuGpioNum. |
[in] | u8GpioDir | GPIO direction: Zero = input. Non-zero = output. |
Set an NMC1500 GPIO output level high or low.
Set an WINC15x0 GPIO output level high or low.
[in] | u8GpioNum | GPIO number. Allowed values are defined in tenuGpioNum. |
[in] | u8GpioVal | GPIO output value. Zero = low, non-zero = high. |
[in] | u8GpioNum | GPIO number. Allowed values are defined in tenuGpioNum. |
[in] | u8GpioVal | GPIO output value. Zero = low, non-zero = high. |
NMI_API sint8 m2m_periph_i2c_master_init | ( | tstrI2cMasterInitParam * | param | ) |
Initialize and configure the NMC1500 I2C master peripheral.
[in] | param | I2C master initialization structure. See members of tstrI2cMasterInitParam. |
References M2M_SUCCESS.
NMI_API sint8 m2m_periph_i2c_master_read | ( | uint8 | u8SlaveAddr, |
uint8 * | pu8Buf, | ||
uint16 | u16BufLen, | ||
uint16 * | pu16ReadLen, | ||
uint8 | flags | ||
) |
Write a stream of bytes to the I2C slave device.
[in] | u8SlaveAddr | 7-bit I2C slave address. |
[out] | pu8Buf | A pointer to an output buffer in which a stream of bytes are received. |
[in] | u16BufLen | Max output buffer length in bytes. |
[out] | pu16ReadLen | Actual number of bytes received. |
[in] | flags | Write operation bitwise-ORed flags. See tenuI2cMasterFlags. |
References M2M_SUCCESS.
NMI_API sint8 m2m_periph_i2c_master_write | ( | uint8 | u8SlaveAddr, |
uint8 * | pu8Buf, | ||
uint16 | u16BufLen, | ||
uint8 | flags | ||
) |
Write a stream of bytes to the I2C slave device.
[in] | u8SlaveAddr | 7-bit I2C slave address. |
[in] | pu8Buf | A pointer to an input buffer which contains a stream of bytes. |
[in] | u16BufLen | Input buffer length in bytes. |
[in] | flags | Write operation bitwise-ORed flags. See tenuI2cMasterFlags. |
References M2M_SUCCESS.
NMI_API sint8 m2m_periph_init | ( | tstrPerphInitParam * | param | ) |
Initialize the NMC1500 peripheral driver module.
[in] | param | Peripheral module initialization structure. See members of tstrPerphInitParam. |
Control the programmable pull-up resistor on the chip pads .
[in] | pinmask | Write operation bitwise-ORed mask for which pads to control. Allowed values are defined in tenuPullupMask. |
[in] | enable | Set to 0 to disable pull-up resistor. Non-zero will enable the pull-up. |
[in] | pinmask | Write operation bitwise-ORed mask for which pads to control. Allowed values are defined in tenuPullupMask. |
[in] | enable | Set to 0 to disable pull-up resistor. Non-zero will enable the pull-up. |
Referenced by app_wifi_init(), and disable_pullups().