Classes | Enumerations | Functions
m2m_periph.h File Reference

WINC3400 Peripherals Application Interface. More...

#include "common/include/nm_common.h"
#include "driver/include/m2m_types.h"
Include dependency graph for m2m_periph.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tstrI2cMasterInitParam
 I2C master configuration parameters. More...
 
struct  tstrPerphInitParam
 Peripheral module initialization parameters. More...
 

Enumerations

enum  tenuGpioNum { M2M_PERIPH_GPIO15, M2M_PERIPH_GPIO16, M2M_PERIPH_GPIO18, M2M_PERIPH_GPIO_MAX }
 A list of GPIO numbers configurable through the m2m_periph module. More...
 
enum  tenuI2cMasterFlags { I2C_MASTER_NO_FLAGS = 0x00, I2C_MASTER_NO_STOP = 0x01, I2C_MASTER_NO_START = 0x02 }
 Bitwise-ORed flags for use in m2m_periph_i2c_master_write and m2m_periph_i2c_master_read. More...
 
enum  tenuI2cMasterSclMuxOpt {
  M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_HOST_WAKEUP, M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_SD_DAT3, M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_GPIO13, M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_GPIO4,
  M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_I2C_SCL, M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_NUM
}
 Allowed pin multiplexing options for I2C master SCL signal. More...
 
enum  tenuI2cMasterSdaMuxOpt {
  M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_RTC_CLK, M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_SD_CLK, M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_GPIO14, M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_GPIO6,
  M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_I2C_SDA, M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_NUM
}
 Allowed pin multiplexing options for I2C master SDA signal. More...
 
enum  tenuPullupEnable1Mask {
  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_GPIO_6 = (1ul << 6), M2M_PERIPH_PULLUP_DIS_SD_CLK = (1ul << 7),
  M2M_PERIPH_PULLUP_DIS_SD_CMD_SPI_SCK = (1ul << 8), M2M_PERIPH_PULLUP_DIS_SD_DAT0_SPI_TXD = (1ul << 9), M2M_PERIPH_PULLUP_DIS_SD_DAT1_SPI_SSN = (1ul << 10), M2M_PERIPH_PULLUP_DIS_SD_DAT1_SPI_RXD = (1ul << 11),
  M2M_PERIPH_PULLUP_DIS_SD_DAT3 = (1ul << 12)
}
 
enum  tenuPullupEnable2Mask {
  M2M_PERIPH_PULLUP_DIS_GPIO_13 = (1ul << 0), M2M_PERIPH_PULLUP_DIS_GPIO_14 = (1ul << 1), M2M_PERIPH_PULLUP_DIS_GPIO_15 = (1ul << 2), M2M_PERIPH_PULLUP_DIS_GPIO_16 = (1ul << 3),
  M2M_PERIPH_PULLUP_DIS_GPIO_17 = (1ul << 4), M2M_PERIPH_PULLUP_DIS_GPIO_18 = (1ul << 5), M2M_PERIPH_PULLUP_DIS_GPIO_19 = (1ul << 6), M2M_PERIPH_PULLUP_DIS_GPIO_20 = (1ul << 7),
  M2M_PERIPH_PULLUP_DIS_GPIO_22 = (1ul << 9), M2M_PERIPH_PULLUP_DIS_GPIO_23 = (1ul << 10), M2M_PERIPH_PULLUP_DIS_GPIO_38 = (1ul << 25), M2M_PERIPH_PULLUP_DIS_GPIO_39 = (1ul << 26),
  M2M_PERIPH_PULLUP_DIS_GPIO_40 = (1ul << 27), M2M_PERIPH_PULLUP_DIS_GPIO_42 = (1ul << 29)
}
 

Functions

NMI_API sint8 m2m_periph_gpio_get_val (uint8 u8GpioNum, uint8 *pu8GpioVal)
 Read an NMC1500 GPIO input level. More...
 
NMI_API 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...
 
NMI_API sint8 m2m_periph_gpio_set_val (uint8 u8GpioNum, uint8 u8GpioVal)
 Set an NMC1500 GPIO output level high or low. More...
 
NMI_API sint8 m2m_periph_init (tstrPerphInitParam *param)
 Initialize the NMC1500 peripheral driver module. More...
 
NMI_API sint8 m2m_periph_pullup_ctrl (uint32 pinmask, uint8 enable)
 Control the programmable pull-up resistor on the chip pads . More...
 

Detailed Description

WINC3400 Peripherals Application Interface.

Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.

Definition in file m2m_periph.h.

Enumeration Type Documentation

◆ tenuGpioNum

A list of GPIO numbers configurable through the m2m_periph module.

Enumerator
M2M_PERIPH_GPIO15 

GPIO15 pad

M2M_PERIPH_GPIO16 

GPIO16 pad

M2M_PERIPH_GPIO18 

GPIO18 pad

M2M_PERIPH_GPIO_MAX 

Definition at line 74 of file m2m_periph.h.

◆ tenuI2cMasterFlags

Bitwise-ORed flags for use in m2m_periph_i2c_master_write and m2m_periph_i2c_master_read.

See also
m2m_periph_i2c_master_write m2m_periph_i2c_master_read
Enumerator
I2C_MASTER_NO_FLAGS 

No flags.

I2C_MASTER_NO_STOP 

No stop bit after this transaction. Useful for scattered buffer read/write operations.

I2C_MASTER_NO_START 

No start bit at the beginning of this transaction. Useful for scattered buffer read/write operations.

Definition at line 141 of file m2m_periph.h.

◆ tenuI2cMasterSclMuxOpt

Allowed pin multiplexing options for I2C master SCL signal.

Enumerator
M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_HOST_WAKEUP 

I2C master SCL is avaiable on HOST_WAKEUP.

M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_SD_DAT3 

I2C master SCL is avaiable on SD_DAT3 (GPIO 7).

M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_GPIO13 

I2C master SCL is avaiable on GPIO 13.

M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_GPIO4 

I2C master SCL is avaiable on GPIO 4.

M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_I2C_SCL 

I2C master SCL is avaiable on I2C slave SCL.

M2M_PERIPH_I2C_MASTER_SCL_MUX_OPT_NUM 

Definition at line 89 of file m2m_periph.h.

◆ tenuI2cMasterSdaMuxOpt

Allowed pin multiplexing options for I2C master SDA signal.

Enumerator
M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_RTC_CLK 

I2C master SDA is avaiable on RTC_CLK.

M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_SD_CLK 

I2C master SDA is avaiable on SD_CLK (GPIO 8).

M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_GPIO14 

I2C master SDA is avaiable on GPIO 14.

M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_GPIO6 

I2C master SDA is avaiable on GPIO 6.

M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_I2C_SDA 

I2C master SDA is avaiable on I2C slave SDA.

M2M_PERIPH_I2C_MASTER_SDA_MUX_OPT_NUM 

Definition at line 105 of file m2m_periph.h.

◆ tenuPullupEnable1Mask

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_GPIO_6 
M2M_PERIPH_PULLUP_DIS_SD_CLK 
M2M_PERIPH_PULLUP_DIS_SD_CMD_SPI_SCK 
M2M_PERIPH_PULLUP_DIS_SD_DAT0_SPI_TXD 
M2M_PERIPH_PULLUP_DIS_SD_DAT1_SPI_SSN 
M2M_PERIPH_PULLUP_DIS_SD_DAT1_SPI_RXD 
M2M_PERIPH_PULLUP_DIS_SD_DAT3 

Definition at line 160 of file m2m_periph.h.

◆ tenuPullupEnable2Mask

Enumerator
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_22 
M2M_PERIPH_PULLUP_DIS_GPIO_23 
M2M_PERIPH_PULLUP_DIS_GPIO_38 
M2M_PERIPH_PULLUP_DIS_GPIO_39 
M2M_PERIPH_PULLUP_DIS_GPIO_40 
M2M_PERIPH_PULLUP_DIS_GPIO_42 

Definition at line 175 of file m2m_periph.h.

Function Documentation

◆ m2m_periph_gpio_get_val()

NMI_API sint8 m2m_periph_gpio_get_val ( uint8  u8GpioNum,
uint8 pu8GpioVal 
)

Read an NMC1500 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 SHALL return 0 for success and a negative value otherwise.
See also
tenuGpioNum

◆ m2m_periph_gpio_set_dir()

NMI_API 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).

Parameters
[in]u8GpioNumGPIO number. Allowed values are defined in tenuGpioNum.
[in]u8GpioDirGPIO direction: Zero = input. Non-zero = output.
Returns
The function SHALL return 0 for success and a negative value otherwise.
See also
tenuGpioNum

◆ m2m_periph_gpio_set_val()

NMI_API sint8 m2m_periph_gpio_set_val ( uint8  u8GpioNum,
uint8  u8GpioVal 
)

Set an NMC1500 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

◆ m2m_periph_init()

NMI_API sint8 m2m_periph_init ( tstrPerphInitParam param)

Initialize the NMC1500 peripheral driver module.

Parameters
[in]paramPeripheral module initialization structure. See members of tstrPerphInitParam.
Returns
The function SHALL return 0 for success and a negative value otherwise.
See also
tstrPerphInitParam

◆ m2m_periph_pullup_ctrl()

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 SHALL return 0 for success and a negative value otherwise.
See also
tenuPullupMask


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:06