Contiki-NG
Loading...
Searching...
No Matches

Files

file  ioc.c
 Implementation of IOC functions.
 
file  ioc.h
 Header file with declarations for the I/O Control module.
 

IOC Functions

void ioc_init ()
 Initialise the IOC driver.
 
void ioc_set_over (uint8_t port, uint8_t pin, uint8_t over)
 Set Port:Pin override function.
 
uint32_t ioc_get_over (uint8_t port, uint8_t pin)
 Get Port:Pin override function.
 
void ioc_set_sel (uint8_t port, uint8_t pin, uint8_t sel)
 Function select for Port:Pin.
 
#define ioc_input_sel(port, pin)   ((port << 3) | pin)
 Generates an IOC_INPUT_SEL_PXn value from a port/pin number.
 

IOC Input Pin Select Registers

#define IOC_UARTRXD_UART0   0x400D4100
 UART0 RX.
 
#define IOC_UARTCTS_UART1   0x400D4104
 UART1 CTS.
 
#define IOC_UARTRXD_UART1   0x400D4108
 UART1 RX.
 
#define IOC_CLK_SSI_SSI0   0x400D410C
 SSI0 Clock.
 
#define IOC_SSIRXD_SSI0   0x400D4110
 SSI0 RX.
 
#define IOC_SSIFSSIN_SSI0   0x400D4114
 SSI0 FSSIN.
 
#define IOC_CLK_SSIIN_SSI0   0x400D4118
 SSI0 Clock SSIIN.
 
#define IOC_CLK_SSI_SSI1   0x400D411C
 SSI1 Clock.
 
#define IOC_SSIRXD_SSI1   0x400D4120
 SSI1 RX.
 
#define IOC_SSIFSSIN_SSI1   0x400D4124
 SSI1 FSSIN Select.
 
#define IOC_CLK_SSIIN_SSI1   0x400D4128
 SSI1 Clock SSIIN.
 
#define IOC_I2CMSSDA   0x400D412C
 I2C SDA.
 
#define IOC_I2CMSSCL   0x400D4130
 I2C SCL.
 
#define IOC_GPT0OCP1   0x400D4134
 GPT0OCP1.
 
#define IOC_GPT0OCP2   0x400D4138
 GPT0OCP2.
 
#define IOC_GPT1OCP1   0x400D413C
 GPT1OCP1.
 
#define IOC_GPT1OCP2   0x400D4140
 GPT1OCP2.
 
#define IOC_GPT2OCP1   0x400D4144
 GPT2OCP1.
 
#define IOC_GPT2OCP2   0x400D4148
 GPT2OCP2.
 
#define IOC_GPT3OCP1   0x400D414C
 GPT3OCP1.
 
#define IOC_GPT3OCP2   0x400D4150
 GPT3OCP2.
 

I/O Control Register Bit Masks

#define IOC_OVR_MASK   0x0000000F
 IOC_Pxn_OVER registers.
 
#define IOC_PXX_SEL_MASK   0x0000001F
 IOC_Pxn_SEL registers.
 
#define IOC_INPUT_SEL_MASK   0x0000001F
 All other IOC registers.
 

Values for IOC_PXX_OVER

#define IOC_OVERRIDE_OE   0x00000008
 Output Enable.
 
#define IOC_OVERRIDE_PUE   0x00000004
 Pull Up Enable.
 
#define IOC_OVERRIDE_PDE   0x00000002
 Pull Down Enable.
 
#define IOC_OVERRIDE_ANA   0x00000001
 Analog Enable.
 
#define IOC_OVERRIDE_DIS   0x00000000
 Override Disabled.
 

Detailed Description

Driver for the cc2538 I/O Control Module

Macro Definition Documentation

◆ ioc_input_sel

#define ioc_input_sel ( port,
pin )   ((port << 3) | pin)

Generates an IOC_INPUT_SEL_PXn value from a port/pin number.

Parameters
portThe port as a number (PA: 0, PB: 1 etc)
pinThe pin as a number
Returns
A value which can be written in the INPUT_SEL bits of various IOC registers

Definition at line 286 of file ioc.h.

Referenced by i2c_init(), and uart_init().

Function Documentation

◆ ioc_get_over()

uint32_t ioc_get_over ( uint8_t port,
uint8_t pin )

Get Port:Pin override function.

Parameters
portThe port as a number (PA: 0, PB: 1 etc)
pinThe pin as a number
Returns
The override function

The return value can be one of

  • IOC_OVERRIDE_OE: Output
  • IOC_OVERRIDE_PUE: Pull-Up
  • IOC_OVERRIDE_PDE: Pull-Down
  • IOC_OVERRIDE_ANA: Analog
  • IOC_OVERRIDE_DIS: Disabled

Definition at line 60 of file ioc.c.

Referenced by gpio_hal_arch_no_port_pin_cfg_get().

◆ ioc_set_over()

void ioc_set_over ( uint8_t port,
uint8_t pin,
uint8_t over )

Set Port:Pin override function.

Parameters
portThe port as a number (PA: 0, PB: 1 etc)
pinThe pin as a number
overThe desired override configuration

over can take the following values:

  • IOC_OVERRIDE_OE: Output
  • IOC_OVERRIDE_PUE: Pull-Up
  • IOC_OVERRIDE_PDE: Pull-Down
  • IOC_OVERRIDE_ANA: Analog
  • IOC_OVERRIDE_DIS: Disabled

Definition at line 54 of file ioc.c.

Referenced by configure(), gpio_hal_arch_no_port_pin_cfg_set(), i2c_init(), pwm_disable(), pwm_start(), pwm_stop(), rtcc_set_alarm_time_date(), spi_arch_lock_and_open(), spix_cs_init(), spix_init(), sys_ctrl_init(), and uart_init().

◆ ioc_set_sel()

void ioc_set_sel ( uint8_t port,
uint8_t pin,
uint8_t sel )

Function select for Port:Pin.

Parameters
portThe port as a number (PA: 0, PB: 1 etc)
pinThe pin as a number
selThe desired function

The value of sel can be any of the IOC_PXX_SEL_xyz defines. For example IOC_PXX_SEL_UART0_TXD will set the port to act as UART0 TX

Definition at line 66 of file ioc.c.

Referenced by i2c_init(), pwm_start(), spi_arch_lock_and_open(), spix_init(), and uart_init().