SWRA704 June   2021 CC3120 , CC3130 , CC3135

 

  1.   Trademarks
  2. 1Introduction
  3. 2Porting the Host Driver
    1. 2.1 Porting Layer Files
    2. 2.2 Driver Enable/Disable
    3. 2.3 SPI Interface
      1. 2.3.1 Hardware Setup and Configuring Clocks
    4. 2.4 Memory Management
    5. 2.5 OS Abstraction: FreeRTOS
    6. 2.6 Timestamp Mechanism
    7. 2.7 Asynchronous Event Handler Routines
  4. 3Tips for Porting
    1. 3.1 Hardware Setup
    2. 3.2 Servicepack
    3. 3.3 Starting the Wi-Fi Driver in the Application Code
    4. 3.4 Configuring Clocks on the STM32L4
    5. 3.5 Terminal I/O Printing
    6. 3.6 Location of the Host Driver and Porting Files
    7. 3.7 Updating to the Latest Host Driver Version
  5. 4References
  6. 5License Information

Driver Enable/Disable

The CC31xx can be enabled and disabled by controlling the nHib signal. The host MCU controls the nHib signal by changing the output of a GPIO. The host can toggle the GPIO followed by a 10 millisecond delay. This delay ensures that the host driver observes the minumim hibernate time according to the timing requirements in the device-specific data sheet.

user.h:

#define sl_DeviceEnable()     NwpPowerOn()
#define sl_DeviceDisable()    NwpPowerOff()

cc_pal.h:

extern void NwpPowerOn(void);
extern void NwpPowerOff(void);

cc_pal.c:

void NwpPowerOn(void)
{
    HAL_GPIO_WritePin(HOST_nHIB_PORT, HOST_nHIB_PIN, 1);
}

void NwpPowerOff(void)
{
    HAL_GPIO_WritePin(HOST_nHIB_PORT, HOST_nHIB_PIN, 0);
    /* wait 10 msec */
    HAL_Delay(10);
}