Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
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.
 
#define sl_IfClose   spi_Close
 Closes an opened interface communication port.
 
#define sl_IfRead   spi_Read
 Attempts to read up to len bytes from an opened communication channel into a buffer starting at pBuff.
 
#define sl_IfWrite   spi_Write
 attempts to write up to len bytes to the SPI channel
 
#define sl_IfRegIntHdlr(InterruptHdl, pValue)   NwpRegisterInterruptHandler(InterruptHdl , pValue)
 register an interrupt handler routine for the host IRQ
 
#define sl_IfMaskIntHdlr()   NwpMaskInterrupt()
 Masks the Host IRQ.
 
#define sl_IfUnMaskIntHdlr()   NwpUnMaskInterrupt()
 Unmasks the Host IRQ.
 
#define _SlFd_t   Fd_t
 
#define sl_IfOpen   spi_Open
 Opens an interface communication port to be used for communicating with a SimpleLink device.
 
#define sl_IfClose   spi_Close
 Closes an opened interface communication port.
 
#define sl_IfRead   spi_Read
 Attempts to read up to len bytes from an opened communication channel into a buffer starting at pBuff.
 
#define sl_IfWrite   spi_Write
 attempts to write up to len bytes to the SPI channel
 
#define sl_IfRegIntHdlr(InterruptHdl, pValue)   NwpRegisterInterruptHandler(InterruptHdl , pValue)
 register an interrupt handler routine for the host IRQ
 
#define sl_IfMaskIntHdlr()   NwpMaskInterrupt()
 Masks the Host IRQ.
 
#define sl_IfUnMaskIntHdlr()   NwpUnMaskInterrupt()
 Unmasks the Host IRQ.
 

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

◆ _SlFd_t [1/2]

#define _SlFd_t   Fd_t

Definition at line 397 of file nonos_user.h.

◆ _SlFd_t [2/2]

#define _SlFd_t   Fd_t

Definition at line 396 of file user.h.

◆ sl_IfClose [1/2]

#define sl_IfClose   spi_Close

Closes an opened interface communication port.

\param              fd  -   file descriptor of opened communication channel

\return             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);
Note
belongs to configuration_sec
Warning

Definition at line 451 of file nonos_user.h.

◆ sl_IfClose [2/2]

#define sl_IfClose   spi_Close

Closes an opened interface communication port.

\param              fd  -   file descriptor of opened communication channel

\return             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);
Note
belongs to configuration_sec
Warning

Definition at line 450 of file user.h.

◆ sl_IfMaskIntHdlr [1/2]

#define sl_IfMaskIntHdlr ( )    NwpMaskInterrupt()

Masks the Host IRQ.

See also
sl_IfUnMaskIntHdlr
Note
belongs to configuration_sec
Warning

Definition at line 547 of file nonos_user.h.

◆ sl_IfMaskIntHdlr [2/2]

#define sl_IfMaskIntHdlr ( )    NwpMaskInterrupt()

Masks the Host IRQ.

See also
sl_IfUnMaskIntHdlr
Note
belongs to configuration_sec
Warning

Definition at line 546 of file user.h.

◆ sl_IfOpen [1/2]

#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);
Note
belongs to configuration_sec
Warning

Definition at line 432 of file nonos_user.h.

◆ sl_IfOpen [2/2]

#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);
Note
belongs to configuration_sec
Warning

Definition at line 431 of file user.h.

◆ sl_IfRead [1/2]

#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);
Note
belongs to configuration_sec
Warning

Definition at line 477 of file nonos_user.h.

◆ sl_IfRead [2/2]

#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);
Note
belongs to configuration_sec
Warning

Definition at line 476 of file user.h.

◆ sl_IfRegIntHdlr [1/2]

#define sl_IfRegIntHdlr (   InterruptHdl,
  pValue 
)    NwpRegisterInterruptHandler(InterruptHdl , pValue)

register an interrupt handler routine for the host IRQ

\param              InterruptHdl    -       pointer to interrupt handler routine

\param              pValue                  -       pointer to a memory structure that is passed
                                                            to the interrupt handler.

\return             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

\note       If the handler is a null pointer, the function should un-register the
            interrupt handler, and the interrupts can be disabled.
Note
belongs to configuration_sec
Warning

Definition at line 532 of file nonos_user.h.

◆ sl_IfRegIntHdlr [2/2]

#define sl_IfRegIntHdlr (   InterruptHdl,
  pValue 
)    NwpRegisterInterruptHandler(InterruptHdl , pValue)

register an interrupt handler routine for the host IRQ

\param              InterruptHdl    -       pointer to interrupt handler routine

\param              pValue                  -       pointer to a memory structure that is passed
                                                            to the interrupt handler.

\return             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

\note       If the handler is a null pointer, the function should un-register the
            interrupt handler, and the interrupts can be disabled.
Note
belongs to configuration_sec
Warning

Definition at line 531 of file user.h.

◆ sl_IfUnMaskIntHdlr [1/2]

#define sl_IfUnMaskIntHdlr ( )    NwpUnMaskInterrupt()

Unmasks the Host IRQ.

See also
sl_IfMaskIntHdlr
Note
belongs to configuration_sec
Warning

Definition at line 561 of file nonos_user.h.

◆ sl_IfUnMaskIntHdlr [2/2]

#define sl_IfUnMaskIntHdlr ( )    NwpUnMaskInterrupt()

Unmasks the Host IRQ.

See also
sl_IfMaskIntHdlr
Note
belongs to configuration_sec
Warning

Definition at line 560 of file user.h.

◆ sl_IfWrite [1/2]

#define sl_IfWrite   spi_Write

attempts to write up to len bytes to the SPI channel

\param              fd      -   file descriptor of an opened communication channel

\param              pBuff   -   pointer to the first location of a buffer that contains 
                    the data to send over the communication channel

\param      len     -   number of bytes to write to the communication channel

\return     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

Definition at line 507 of file nonos_user.h.

◆ sl_IfWrite [2/2]

#define sl_IfWrite   spi_Write

attempts to write up to len bytes to the SPI channel

\param              fd      -   file descriptor of an opened communication channel

\param              pBuff   -   pointer to the first location of a buffer that contains 
                    the data to send over the communication channel

\param      len     -   number of bytes to write to the communication channel

\return     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

Definition at line 506 of file user.h.