|
Open Model Railroad Network (OpenMRN)
|
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. | |
The SimpleLink device supports several standard communication protocol among SPI and UART. CC32XX Host Driver implements SPI Communication Interface
porting ACTION:
| #define _SlFd_t Fd_t |
Definition at line 397 of file nonos_user.h.
| #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
\note The prototype of the function is as follow:
int xxx_IfClose(Fd_t Fd);
Definition at line 451 of file nonos_user.h.
| #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
\note The prototype of the function is as follow:
int xxx_IfClose(Fd_t Fd);
| #define sl_IfMaskIntHdlr | ( | ) | NwpMaskInterrupt() |
Masks the Host IRQ.
Definition at line 547 of file nonos_user.h.
| #define sl_IfMaskIntHdlr | ( | ) | NwpMaskInterrupt() |
| #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.
| 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 |
\note The prototype of the function is as follow:
Fd_t xxx_IfOpen(char* pIfName , unsigned long flags);
Definition at line 432 of file nonos_user.h.
| #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.
| 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 |
\note The prototype of the function is as follow:
Fd_t xxx_IfOpen(char* pIfName , unsigned long flags);
| #define sl_IfRead spi_Read |
Attempts to read up to len bytes from an opened communication channel into a buffer starting at pBuff.
| 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 |
\note The prototype of the function is as follow:
int xxx_IfRead(Fd_t Fd , char* pBuff , int Len);
Definition at line 477 of file nonos_user.h.
| #define sl_IfRead spi_Read |
Attempts to read up to len bytes from an opened communication channel into a buffer starting at pBuff.
| 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 |
\note The prototype of the function is as follow:
int xxx_IfRead(Fd_t Fd , char* pBuff , int Len);
| #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
\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.
Definition at line 532 of file nonos_user.h.
| #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
\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.
| #define sl_IfUnMaskIntHdlr | ( | ) | NwpUnMaskInterrupt() |
Unmasks the Host IRQ.
Definition at line 561 of file nonos_user.h.
| #define sl_IfUnMaskIntHdlr | ( | ) | NwpUnMaskInterrupt() |
| #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
\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);
Definition at line 507 of file nonos_user.h.
| #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
\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);