CC32XX SimpleLink Host Driver  1.0.0.10
 All Data Structures Functions Variables Groups Pages
Configuration - Communication Interface

Macros

#define _SlFd_t   Fd_t
 
#define sl_IfOpen   spi_Open
 Opens an interface communication port to be used for communicating with a SimpleLink device. More...
 
#define sl_IfClose   spi_Close
 Closes an opened interface communication port. More...
 
#define sl_IfRead   spi_Read
 Attempts to read up to len bytes from an opened communication channel into a buffer starting at pBuff. More...
 
#define sl_IfWrite   spi_Write
 attempts to write up to len bytes to the SPI channel More...
 
#define sl_IfRegIntHdlr(InterruptHdl, pValue)   NwpRegisterInterruptHandler(InterruptHdl , pValue)
 register an interrupt handler routine for the host IRQ More...
 
#define sl_IfMaskIntHdlr()   NwpMaskInterrupt()
 Masks the Host IRQ. More...
 
#define sl_IfUnMaskIntHdlr()   NwpUnMaskInterrupt()
 Unmasks the Host IRQ. More...
 

Detailed Description

The SimpleLink device supports several standard communication protocol among SPI and
UART. CC32XX Host Driver implements SPI Communication Interface
Note
In CC32XX, SPI implementation uses DMA in order to increase the utilization of the communication channel. If user prefers to user UART, these interfaces need to be redefined

porting ACTION:

Macro Definition Documentation

#define sl_IfClose   spi_Close

Closes an opened interface communication port.

Parameters
fd- file descriptor of opened communication channel
Returns
upon successful completion, the function shall return 0. Otherwise, -1 shall be returned
See Also
sl_IfOpen , sl_IfRead , sl_IfWrite
Note
The prototype of the function is as follow: int xxx_IfClose(Fd_t Fd);
belongs to configuration_sec
Warning
#define sl_IfMaskIntHdlr ( )    NwpMaskInterrupt()

Masks the Host IRQ.

See Also
sl_IfUnMaskIntHdlr
Note
belongs to configuration_sec
Warning
#define sl_IfOpen   spi_Open

Opens an interface communication port to be used for communicating with a SimpleLink device.

            Given an interface name and option flags, this function opens 
        the communication port and creates a file descriptor. 
        This file descriptor is used afterwards to read and write 
        data from and to this specific communication channel.
            The speed, clock polarity, clock phase, chip select and all other 
        specific attributes of the channel are all should be set to hardcoded
        in this function.
Parameters
ifName- points to the interface name/path. The interface name is an optional attributes that the simple link driver receives on opening the driver (sl_Start). In systems that the spi channel is not implemented as part of the os device drivers, this parameter could be NULL.
flags- optional flags parameters for future use
Returns
upon successful completion, the function shall open the channel and return a non-negative integer representing the file descriptor. Otherwise, -1 shall be returned
See Also
sl_IfClose , sl_IfRead , sl_IfWrite
Note
The prototype of the function is as follow: Fd_t xxx_IfOpen(char* pIfName , unsigned long flags);
belongs to configuration_sec
Warning
#define sl_IfRead   spi_Read

Attempts to read up to len bytes from an opened communication channel into a buffer starting at pBuff.

Parameters
fd- file descriptor of an opened communication channel
pBuff- pointer to the first location of a buffer that contains enough space for all expected data
len- number of bytes to read from the communication channel
Returns
upon successful completion, the function shall return the number of read bytes. Otherwise, 0 shall be returned
See Also
sl_IfClose , sl_IfOpen , sl_IfWrite
Note
The prototype of the function is as follow: int xxx_IfRead(Fd_t Fd , char* pBuff , int Len);
belongs to configuration_sec
Warning
#define sl_IfRegIntHdlr (   InterruptHdl,
  pValue 
)    NwpRegisterInterruptHandler(InterruptHdl , pValue)

register an interrupt handler routine for the host IRQ

Parameters
InterruptHdl- pointer to interrupt handler routine
pValue- pointer to a memory structure that is passed to the interrupt handler.
Returns
upon successful registration, the function shall return 0. Otherwise, -1 shall be returned
See Also
Note
If there is already registered interrupt handler, the function should overwrite the old handler with the new one
If the handler is a null pointer, the function should un-register the interrupt handler, and the interrupts can be disabled.
belongs to configuration_sec
Warning
#define sl_IfUnMaskIntHdlr ( )    NwpUnMaskInterrupt()

Unmasks the Host IRQ.

See Also
sl_IfMaskIntHdlr
Note
belongs to configuration_sec
Warning
#define sl_IfWrite   spi_Write

attempts to write up to len bytes to the SPI channel

Parameters
fd- file descriptor of an opened communication channel
pBuff- pointer to the first location of a buffer that contains the data to send over the communication channel
len- number of bytes to write to the communication channel
Returns
upon successful completion, the function shall return the number of sent bytes. therwise, 0 shall be returned
See Also
sl_IfClose , sl_IfOpen , sl_IfRead
Note
This function could be implemented as zero copy and return only upon successful completion of writing the whole buffer, but in cases that memory allocation is not too tight, the function could copy the data to internal buffer, return back and complete the write in parallel to other activities as long as the other SPI activities would be blocked until the entire buffer write would be completed

The prototype of the function is as follow: int xxx_IfWrite(Fd_t Fd , char* pBuff , int Len);

Note
belongs to configuration_sec
Warning