NAV Navbar

ADC

This section provides details of APIs that you can use to implement an ADC. To access the ADC functionality, it is necessary to define wiced_hal_adc.h in the source file. All the API value defines: GPIO configuration, enums, and return values are defined in the header file.

wiced_hal_adc_init()

Function Prototype

void wiced_hal_adc_init(void);

Example

wiced_hal_adc_init( );

Parameters

void: None

Return Value

void: None

Function Usage

This API function is used to initialize the ADC hardware to the default state. It does not need any parameter or return a value.

wiced_hal_adc_set_input_range()

Function Prototype

void wiced_hal_adc_set_input_range(ADC_INPUT_RANGE_SEL rangeIdx);

Example

wiced_hal_adc_set_input_range(ADC_RANGE_0_1P8V);

Parameters

Return Value

void: None

Function Usage

This API function is used to set an input voltage range for the ADC hardware to process. The ADC_INPUT_RANGE_SEL type parameter should be passed. Set the value to '0' for the input voltage range 0-3.6 V; it is '1' when the input voltage range is 0-1.8 V. No return value is needed.

wiced_hal_adc_read_raw_sample()

Function Prototype

INT16 wiced_hal_adc_read_raw_sample( ADC_INPUT_CHANNEL_SEL channel);

Example

#define CHANNEL_TO_MEASURE_DC_VOLT  ADC_INPUT_P28
Uint16_t raw_val = 0;
raw_val = wiced_hal_adc_read_raw_sample (CHANNEL_TO_MEASURE_DC_VOLT);
WICED_BT_TRACE ("Raw value of ADC Channel: %d", raw_val);

Parameters

Return Value

Raw digital value

Function Usage

This API function converts the analog signal to digital data and needs the parameter ADC_INPUT_CHANNEL_SEL, which represents the input GPIO pin to be measured. It returns the converted raw digital data that is read from the ADC hardware register.

In the example, ADC_INPUT_28 is the GPIO pin on which the input voltage is measured. The converted digital data is returned using the variable raw_val and printed using WICED_BT_TRACE.

wiced_hal_adc_read_voltage()

Function Prototype

UINT32 wiced_hal_adc_read_voltage(ADC_INPUT_CHANNEL_SEL channel);

Example

#define CHANNEL_TO_MEASURE_DC_VOLT  ADC_INPUT_P28
Uint16_t vtg_val = 0;
vtg_val = wiced_hal_adc_read_voltage(CHANNEL_TO_MEASURE_DC_VOLT);
WICED_BT_TRACE (Voltage value of ADC Channel (mV): %d", vtg_val);

Parameters

channel: Input channel is a GPIO pin

Return Value

Voltage value - mV

Function Usage

This API function reads the signal from the input pin and returns a voltage value instead of the raw count. The parameter passed is ADC_INPUT_CHANNEL_SEL, which represents a GPIO pin.

Unlike wiced_hal_adc_read_raw_sample(), this function returns the parameter as an input voltage (mV) measured at the GPIO, printed using the variable vtg_val.

I2C

This section provides the details of APIs that you can use to implement I2C.

wiced_hal_i2c_init()

Function Prototype

void wiced_hal_i2c_init(void);

Example

wiced_hal_i2c_init();

Parameters

None

Return Value

None

Description

This function initializes the I2C driver and its private values. This initialization sets the bus speed to 100 kHz by default (I2CM_SPEED_100KHZ). To make the bus run at another speed, use wiced_hal_i2c_set_speed().

wiced_hal_i2c_set_speed()

Function Prototype

void wiced_hal_i2c_set_speed (UINT8 speed);

Example

enum
{
    I2CM_SPEED_100KHZ = 240,
    I2CM_SPEED_400KHZ = 60,
    I2CM_SPEED_800KHZ = 30,
    I2CM_SPEED_1000KHZ = 24,
};

Parameters

Speed: Refers to the I2C bus speed for transferring data. It is the transport clock counter that counts the number of reference clock cycles.

Return Value

None

Description

This function sets the I2C bus speed. The default speed after initialization is 100 kHz, but the I2C bus can be configured to run at 100 kHz, 400 kHz, 800 kHz, and 1 MHz.

wiced_hal_i2c_get_speed()

Function Prototype

void wiced_hal_i2c_get_speed (UINT8 speed);

Example

static UINT8 current_speed;
current_speed = wiced_hal_i2c_get_speed ();

Parameters

None

Return Value

The SCL reference clock cycle counter value corresponding to the SCL speed is used in the I2C bus.

Description

This function is used to get the current I2C bus speed. Smaller numbers indicate a higher I2C speed.

wiced_hal_i2c_read()

Function Prototype

UINT8 wiced_hal_i2c_read (UINT8* data, UINT16 length, UINT8 slave);

Example

#define SLAVE_ADDRESS 0X40
UINT8_t data_reg[4] = {0x0F,0x0E,0x0D,0xCC};
UINT8 wiced_hal_i2c_read (UINT8 *) &data_reg, sizeof(data_reg), UINT8 slave_address);

Parameters

Return Values

Description

This function reads the data from the given buffer of the I2C slave address. Though any arbitrary length of data may be read from the slave, atomic transactions greater than the hardware's capability are not possible; they will be split into multiple transactions. This is a blocking call. Interrupts will not affect the timing within a transaction.

wiced_hal_i2c_write()

Function Prototype

UINT8 wiced_hal_i2c_write (UINT8* data, UINT16 length, UINT8 slave);

Example

#define SLAVE_ADDRESS 0X40
UINT8_t data_reg[4] = {0x0F,0x0E,0x0D,0xCC};
UINT8 wiced_hal_i2c_write (UINT8 *) &data_reg, sizeof (data_reg), UINT8 slave_address);

Parameters

Return Values

Description

This function writes the data into the given buffer of the I2C slave address. The data bytes are transparent. Though any arbitrary length of data is written to the slave, atomic transactions greater than the hardware's capability are not possible - they will be split into multiple transactions. This is a blocking call. Interrupts will not affect timing within a transaction.

wiced_hal_i2c_combined_read()

Function Prototype

UINT8 wiced_hal_i2c_combined_read(UINT8 * tx_data, UINT8 tx_data_len, UINT8 * rx_data, UINT16 rx_data_len, UINT8 slave);

Example

#define SLAVE_DATA_REG 0X0F
UINT8_t data_reg[4] = {0x0F,0x0E,0x0D,0xCC};
UINT8 reg_addr = SLAVE_DATA_REG;
wiced_hal_i2c_combined_read((UINT8 *)&data_reg, sizeof(data_reg), &reg_addr, sizeof(UINT8), SLAVE_DATA_REG);

Parameters

Return Values

Description

This function executes two transactions back-to-back with a repeated start condition between the first and the second. tx_data is written to the slave in the first transaction while data is read back from the slave into rx_data in the second transaction.

BLE Peripheral

This section explains some basic functions required to configure a device as a BLE Peripheral. Include header files wiced_bt_gatt.h, wiced_bt_cfg.h. All the API, value defines, GPIO configuration, enums, and return values are defined in these header files. APIs explained below are arranged in the logical sequence of operation.

application_start()

Function Prototype

void application_start( );

Example

void application_start( );

Parameters

void

Return Value

void

Function Usage

The application_start function is the first function to be called when the application starts to execute. Here, the device configurations is set and the BT stack initialization function is called. The actual application initialization will happen when the stack reports that the BT device is ready.

wiced_bt_stack_init()

Function Prototype

wiced_result_t wiced_bt_stack_init(wiced_bt_management_cback_t *p_bt_management_cback, const wiced_bt_cfg_settings_t *p_bt_cfg_settings, 
const wiced_bt_cfg_buf_pool_t     
wiced_bt_cfg_buf_pools[WICED_BT_CFG_NUM_BUF_POOLS]);

Example

wiced_bt_stack_init( app_management_cback, &wiced_bt_cfg_settings, wiced_bt_cfg_buf_pools );

Parameters

Return Values

wiced_result_t: WICED_BT_SUCCESS on success, WICED_BT_FAILED if an error occurred.

Function Usage

This function initializes the Bluetooth controller and stack, and registers a callback for Bluetooth event notifications. wiced_bt_management_cback is app management callback in which the main code will be implemented. wiced_bt_cfg_settings is a pointer to the structure where all the stack configuration parameters are defined. These configurations are done in wiced_bt_cfg.c file. The wiced_bt_cfg_buf_pools structure configures the buffer pools used by the stack. It will return WICED_BT_SUCCESS on a successful initialization of the BT stack and WICED_BT_FAILED if there are invalid/missing parameters; missing parameters require header files.

app_management_cback()

Function Prototype

wiced_result_t app_management_cback(wiced_bt_management_evt_t event, wiced_bt_management_evt_data_t *p_event_data );

Example

wiced_result_t hello_sensor_management_cback( wiced_bt_management_evt_t event, wiced_bt_management_evt_data_t *p_event_data );

Parameters

Return Values

wiced_result_t: WICED_BT_SUCCESS on success, WICED_BT_FAILED if an error occurred.

Function Usage

This function is called when the BT stack is initialized. It will trigger different events according to the operation. It will return WICED_BT_SUCCESS on successful execution and WICED_BT_FAILED if an error occured.

wiced_bt_gatt_register()

Function Prototype

wiced_bt_gatt_status_t wiced_bt_gatt_register (wiced_bt_gatt_cback_t *p_gatt_cback); 

Example

wiced_bt_gatt_register(hello_sensor_gatts_callback);

Parameters

wiced_bt_gatt_cback_t: GATT notification callback

Return Value

wiced_bt_gatt_status_t: GATT status code

Function Usage

This API is used to register GATT notifications and events. It calls a callback for GATT notifications and various events like connection status and data requests from peer. The return status is a different event, and depends on the successful/failed execution of the API. See wiced_bt_gatt.h for more details.

app_gatts_callback()

Function Prototype

wiced_bt_gatt_status_t app_gatts_callback( wiced_bt_gatt_evt_t event, wiced_bt_gatt_event_data_t *p_data)

Example

wiced_bt_gatt_status_t hello_sensor_gatts_callback( wiced_bt_gatt_evt_t event, wiced_bt_gatt_event_data_t *p_data)
{
    wiced_bt_gatt_status_t result = WICED_BT_GATT_INVALID_PDU;
    switch(event)
    {
    case GATT_CONNECTION_STATUS_EVT:
        result = hello_sensor_gatts_conn_status_cb( &p_data->connection_status );
        break;

    case GATT_ATTRIBUTE_REQUEST_EVT:
        result = hello_sensor_gatts_req_cb( &p_data->attribute_request );
        break;

    default:
        break;
    }
    return result;
}

Parameters

Return Value

wiced_bt_gatt_status_t: GATT status code

Function Usage

This callback is called for various GATT events. It triggers different events based on the connection status and GATT attributes status. The return status is a different event, and depends on the successful or failed execution of the API. See wiced_bt_gatt.h for more details.

wiced_bt_gatt_db_init()

Function Prototype

wiced_bt_gatt_status_t wiced_bt_gatt_db_init(const uint8_t *p_gatt_db, uint16_t gatt_db_size); 

Example

wiced_bt_gatt_db_init (hello_sensor_gatt_database, sizeof(hello_sensor_gatt_database) );

Parameters

Return Value

Function Usage

This API is used to initialize the GATT database. It passes the pointer to the first element in the GATT database along with the length of the database. The return status is a different event, and depends on the successful or failed execution of API. See wiced_bt_gatt.h for more details.

wiced_bt_ble_set_raw_advertisement_data()

Function Prototype

wiced_result_t wiced_bt_ble_set_raw_advertisement_data(UINT8 num_elem, wiced_bt_ble_advert_elem_t *p_data); 

Example

wiced_bt_ble_set_raw_advertisement_data(num_elem, adv_elem); 

Parameters

Return Value

wiced_result_t: WICED_BT_SUCCESS on success, WICED_BT_FAILED if an error occurred

Function Usage

This API is used to set the advertisement raw data, and should be called before starting the advertisement. It passes the structure to the pointer where the advertisement data such as the pointer to data, length, and advertisement type are passed.

wiced_bt_start_advertisements()

Function Prototype

wiced_result_t wiced_bt_start_advertisements(wiced_bt_ble_advert_mode_t advert_mode, wiced_bt_ble_address_type_t directed_advertisement_bdaddr_type, wiced_bt_device_address_ptr_t directed_advertisement_bdaddr_ptr); 

Example

wiced_bt_start_advertisements( BTM_BLE_ADVERT_UNDIRECTED_LOW, 0, NULL );

Parameters

Return Value

wiced_result_t: WICED_BT_SUCCESS on success,WICED_BT_FAILED if an error occurred

Function Usage

This API is used to start advertising. Advertisement data should be configured before starting advertisement. Advertisements are stopped upon successful LE connection establishment. This API passes the advertisement mode: a direct advertisement or not. As given in tje example, the device advertises with BTM_BLE_ADVERT_UNDIRECTED_LOW and undirected advertisement (0). It will return WICED_BT_SUCCESS on starting successful advertising and WICED_BT_FAILED if an error occurs.

Timer

This section provides details about the APIs required to access timer functionalities. THe header file named wiced_timer.h needs to be included in the source file. All the API, value defines, GPIO configuration, enums, and return values are defined in this header file.

wiced_init_timer()

Function Prototype

wiced_result_t wiced_init_timer( wiced_timer_t* p_timer, wiced_timer_callback_t TimerCb, TIMER_PARAM_TYPE cBackparam, wiced_timer_type_t type);

Example

wiced_timer_t ledBlinkTimer;
wiced_init_timer(&ledBlinkTimer, ledBlinkCallback, 0, WICED_MILLI_SECONDS_PERIODIC_TIMER);

Parameters

Return Value

wiced_result_t: WICED_BT_SUCCESS on success, WICED_BT_FAILED if an error occurred.

Description

This function initializes the timer. There are four types of timers; see enum wiced_timer_type_t for more information. It will return WICED_BT_SUCCESS on successful initialization of the timer and WICED_BT_FAILED if an error occurs.

wiced_start_timer()

Function Prototype

wiced_result_t wiced_start_timer(wiced_timer_t* p_timer, uint32_t timeout);

Example

#define BLINK_RATE (500)
wiced_timer_t BlinkTimer;
wiced_start_timer(&BlinkTimer, BLINK_RATE);

Parameters

Return Value

wiced_result_t: WICED_BT_SUCCESS on success, WICED_BT_FAILED if an error occurred

Description

This function initializes the timer using wiced_init_timer(); the API starts the timer. The timer running interferes with the low-power modes of the chip; the time during which the chip remains in the low-power mode is dependent on the timeout values of the active and running timers. Thus, the time to sleep is dependent on the time after which the next timer among the active timers expires.

wiced_stop_timer()

Function Prototype

wiced_result_t wiced_stop_timer(wiced_timer_t* p_timer);

Example

wiced_timer_t BlinkTimer;
wiced_stop_timer(&BlinkTimer);

Parameters

wiced_timer_t: Pointer to the timer structure

Return Value

wiced_result_t: WICED_BT_SUCCESS on success, WICED_BT_FAILED `if an error occurred

Description

This function is used to stop the timer from running.

wiced_is_timer_in_use()

Function Prototype

wiced_bool_t wiced_is_timer_in_use(wiced_timer_t* p_timer); 

Example

wiced_timer_t BlinkTimer;
wiced_is_timer_in_use (&BlinkTimer);

Parameters

p_timer: Pointer to the timer structure

Return Value

wiced_bool_t: TRUE if timer is in use, FALSE if timer is not in use

Description

This function checks if the timer is currently being used. It returns TRUE if the timer is in use and FALSE if the timer is not in use.

wiced_deinit_timer()

Function Prototype

wiced_result_t wiced_deinit_timer( wiced_timer_t* p_timer ); 

Example

wiced_timer_t BlinkTimer;
wiced_deinit_timer(&BlinkTimer);

Parameters

p_timer: Pointer to the timer structure

Return Value

wiced_result_t: WICED_BT_SUCCESS on success, WICED_BT_FAILED if an error occurred

Description

This function de-initializes the timer instance and stops the timer if it is running.

PWM

Include wiced_hal_pwm.h in your source file. All the API, value defines, GPIO configuration, enums, and return values are defined in this header file.

wiced_hal_pwm_configure_pin()

Function Prototype

void wiced_hal_pwm_configure_pin( UINT8  pin, UINT8 PWM);

Example


#define PWM_CHANNEL  PWM0
wiced_hal_pwm_configure_pin(WICED_GPIO_PIN_LED_2, PWM_CHANNEL);

Parameters

Return Value

void: None

Function Usage

This API is used to configure any GPIO pin as a PWM port. Any GPIO can be selected to configure as PWM; more information about GPIOs is given in wiced_platform.h. wiced_hal_pwm.h contains a structure where all six PWM channels of the hardware PWM block are defined. Each of the channels has its own 16-bit counter.

wiced_hal_pwm_get_params()

Function Prototype

void wiced_hal_pwm_get_params( uint32_t clock_frequency_in, uint32_t duty_cycle, uint32_t pwm_frequency_out, pwm_config_t * params_out);

Example

#define PWM_INP_CLK_IN_HZ   (512*1000)
#define PWM_FREQ_IN_HZ      (10000)
#define PWM_DUTY_CYCLE      40

wiced_hal_pwm_get_params(PWM_INP_CLK_IN_HZ, PWM_DUTY_CYCLE, PWM_FREQ_IN_HZ, &pwm_config);

Parameters

Return Value

void: None

Function Usage

This API is used to calculate the API parameters. Input frequency is set in Hz, duty cycle is given in percentage, desired output frequency is also defined in Hz and the last parameter is the pointer to structure where the count values are defined. These values are used in the wiced_hal_pwm_start() API function while starting the PWM block.

wiced_hal_pwm_start()

Function Prototype

BOOL32 wiced_hal_pwm_start(UINT8 channel, PwmClockType clk, UINT32 toggleCount, UINT32 initCount, BOOL32 invert);

Example

#define PWM_CHANNEL   PWM0
wiced_hal_pwm_start(PWM_CHANNEL, PMU_CLK, pwm_config.toggle_count, pwm_config.init_count, 0);

Parameters

Return Value

BOOL32: '1' if PWM started successfully, otherwise '0'

Function Usage

This API is used to start the PWM with the desired settings. It is necessary to call wiced_hal_pwm_configure_pin() and wiced_hal_pwm_get_params() before calling this API function.

wiced_hal_pwm_change_values()

Function Prototype

BOOL32 wiced_hal_pwm_change_values(UINT8 channel, UINT32 toggleCount, UINT32 initCount);

Example

#define PWM_CHANNEL         PWM0
wiced_hal_pwm_change_values(PWM_CHANNEL, pwm_config.toggle_count, pwm_config.init_count);

Parameters

Return Value

BOOL32: 1 if PWM changed successfully, Otherwise 0

Function Usage

This API is used to change the PWM duty cycle and initial count at run time.

wiced_hal_pwm_get_toggle_count()

Function Prototype

UINT32 wiced_hal_pwm_get_toggle_count(UINT8 channel);

Example

#define PWM_CHANNEL  PWM0
wiced_hal_pwm_get_toggle_count(PWM_CHANNEL);

Parameters

Channel: Desired PWM channel from which toggle count is obtained

Return Value

UINT32: Value at which PWM is going to toggle

Function Usage

This API is used to read the current toggle count (duty cycle) setting.

wiced_hal_pwm_get_init_value()

Function Prototype

UINT32 wiced_hal_pwm_get_init_value(UINT8 channel); 

Example

#define PWM_CHANNEL  PWM0
wiced_hal_pwm_get_init_value(PWM_CHANNEL);

Parameters

Channel: Desired PWM channel from which initial count is obtained

Return Value

UINT32: Initial count of PWM

Function Usage

This API is used to give the current initial count setting for the corresponding PWM channel. The return value is the initial count value of the PWM.

wiced_hal_pwm_enable()

Function Prototype

void wiced_hal_pwm_enable(UINT8 channel);

Example

#define PWM_CHANNEL  PWM0
WICED_BT_TRACE("Starting PWM... \n\r");
wiced_hal_pwm_enable(PWM_CHANNEL);

Parameters

Channel: Desired PWM channel to enable

Return Value

void: None

Function Usage

This API is used to enable the PWM channel which is already preconfigured using wiced_hal_pwm_configure_pin(). The parameter passed is the channel which needs to be enabled. As an example (shown on the right), the PWM could be started in a button interrupt callback.

wiced_hal_pwm_disable ()

Function Prototype

void wiced_hal_pwm_disable(UINT8 channel););

Example

#define PWM_CHANNEL  PWM0
WICED_BT_TRACE("Stopping PWM... \n\r");
wiced_hal_pwm_disable(PWM_CHANNEL);

Parameters

Channel: Desired PWM channel to disable

Return Value

void: None

Function Usage

This API is used to disable the PWM channel. The parameter passed is the channel which needs to be disabled. As shown in example, the PWM could be disabled in a button interrupt callback.

GPIO

This section provides details of the list of parameters and defined functions needed to access the General-Purpose Input/Ouput (GPIO) driver. It is necessary to define wiced_hal_gpio.h file in your source file. All the API, value defines, GPIO configuration, enums, return values are defined in this header file.

wiced_hal_gpio_init()

Function Prototype

void wiced_hal_gpio_init(void);

Example

wiced_hal_gpio_init();

Parameters

void: none

Return Value

void: none

Function Usage

This API initializes the GPIO driver and its private values. Also, programs all GPIOs to be ready for use. This must be invoked before accessing any GPIO driver services, typically at boot. This is independent of other drivers and must be one of the first to be initialized.

wiced_hal_gpio_configure_pin()

Function Prototype

void wiced_hal_gpio_configure_pin(UINT32 pin, UINT32 config, UINT32 outputVal);

Example

wiced_hal_gpio_configure_pin(WICED_P02,GPIO_OUTPUT_ENABLE, GPIO_PIN_OUTPUT_LOW)

Parameters

Return Value

void

Function Usage

This API configures a GPIO pin. This API ensures that the GPIO will activate with the correct external value.

wiced_hal_gpio_set_pin_output()

Function Prototype

void wiced_hal_gpio_set_pin_output(UINT32 pin, UINT32 val);

Example

Wiced_hal_gpio_configure_pin(WICED_P02,GPIO_OUTPUT_ENABLE, GPIO_PIN_OUTPUT_LOW)

Parameters

Return Value

void

Function Usage

Sets the output value of a pin.

wiced_hal_gpio_get_pin_output()

Function Prototype

UINT32 wiced_hal_gpio_get_pin_output(UINT32 pin);

Example

WICED_BT_TRACE("%d",wiced_hal_gpio_get_pin_output(WICED_P02));  

Parameters

Pin id: 0-39

Return Value

Returns 1 if output port of the pin is configured 1, likewise for 0. Returns 0xFF if the input parameters are out of range.

Function Usage

Get the programmed output value of a pin.

wiced_hal_gpio_get_pin_input_status()

Function Prototype

UINT32 wiced_hal_gpio_get_pin_input_status(UINT32 pin);

Example

WICED_BT_TRACE("%d",wiced_hal_gpio_get_pin_input_status(WICED_P02));  

Parameters

Pin id: 0-39

Return Value

Returns 1 if the pin is high, 0 if the pin is low.

Function Usage

Read the current value at a pin. Note that for this to be valid, the pin must be configured with input enabled.

wiced_hal_gpio_get_pin_interrupt_status()

Function Prototype

UINT32 wiced_hal_gpio_get_pin_interrupt_status(UINT32 pin);

Example

wiced_hal_gpio_get_pin_interrupt_status(WICED_GPIO_PIN_BUTTON_1);

Parameters

Pin id: 0-39

Return Value

Returns 1 if an interrupt (programmed edge) was detected at the pin, 0 if not. Returns 0xFF if the input parameters are out of range.

Function Usage

Get the interrupt status of a pin

wiced_hal_gpio_register_pin_for_interrupt()

Function Prototype

void wiced_hal_gpio_register_pin_for_interrupt(UINT16 pin, void (*userfn)(void*, UINT8), void* userdata);

Example

wiced_hal_gpio_register_pin_for_interrupt( WICED_GPIO_PIN_BUTTON_1, button_cback, NULL );

Parameters

Return Value

void

Function Usage

Register a function for notification of changes to a pin (via interrupt). Note that this is independent of configuring the pin for interrupts; a call to configurePin() is also required. Also, note that once registered, you CANNOT UNREGISTER; registration is meant to be a startup activity. To stop receiving notifications, re-configure the pin and disable the interrupt using configurePin().

wiced_hal_unassign_gpio_function()

Function Prototype

void wiced_hal_unassign_gpio_function(uint32_t pin,uint32_t function)

Example

wiced_hal_unassign_gpio_function (WICED_P33, WICED_SWDCK);

Parameters

Pin id: 0-39

Return Value

void

Function Usage

This reconfigures the internal Super Mux to disconnect from peripherals. The pin is not associated with a function, such as, PWM, Serial Comm and so on. It will be a GPIO.

wiced_hal_gpio_clear_pin_interrupt_status()

Function Prototype

UINT32 wiced_hal_gpio_clear_pin_interrupt_status(UINT32 pin);

Example

wiced_hal_gpio_clear_pin_interrupt_status(WICED_GPIO_PIN_BUTTON_1);

Parameters

Pin id: 0-39

Return Value

Returns 1 if successful, 0xFF if the input parameters are out of range.

Function Usage

Clear the interrupt status of a pin manually.

wiced_hal_gpio_disable_all_inputs()

Function Prototype

void wiced_hal_gpio_disable_all_inputs(void);

Example

wiced_hal_gpio_disable_all_inputs();

Parameters

void

Return Value

void

Function Usage

Configures all GPIOs to be INPUT DISABLED.

wiced_hal_gpio_select_function()

Function Prototype

wiced_bt_gpio_select_status_t wiced_hal_gpio_select_function(wiced_bt_gpio_numbers_t pin, wiced_bt_gpio_function_t function);

Example

Wiced_hal_gpio_select_function(WICED_P33,WICED_SWDCK);

Parameters

Return Value

wiced_bt_gpio_select_status_t

Function Usage

Configure a GPIO pin to have the chosen functionality, such as, Serial Communication or PWM and so on.