Mikroelektronika MIKROE-350 データシート

ページ / 526
CANSPI_RX_MSG_FLAGS
CANSPI_RX_MSG_FLAGS are flags related to reception of CAN message. If a par-
ticular bit is set then corresponding meaning is TRUE otherwise it will be FALSE.
const
CANSPI_RX_FILTER_BITS  
as byte = $07   ' Use this to access
filter bits
CANSPI_RX_FILTER_1     
as byte = $00
CANSPI_RX_FILTER_2     
as byte = $01
CANSPI_RX_FILTER_3     
as byte = $02
CANSPI_RX_FILTER_4     
as byte = $03
CANSPI_RX_FILTER_5     
as byte = $04
CANSPI_RX_FILTER_6     
as byte = $05
CANSPI_RX_OVERFLOW     
as byte = $08   ' Set if Overflowed
else cleared
CANSPI_RX_INVALID_MSG  
as byte = $10   ' Set if invalid
else cleared
CANSPI_RX_XTD_FRAME    
as byte = $20   ' Set if XTD mes-
sage else cleared
CANSPI_RX_RTR_FRAME    
as byte = $40   ' Set if RTR mes-
sage else cleared
CANSPI_RX_DBL_BUFFERED 
as byte = $80   ' Set if this mes-
sage was hardware double-buffered
You may use bitwise and to adjust the appropriate flags. For example:
if (MsgFlag and CANSPI_RX_OVERFLOW) <> 0 then
...
' Receiver overflow has occurred.
' We have lost our previous message.
end if
CANSPI_MASK
The CANSPI_MASK constants define mask codes. Function CANSPISetMask
expects one of these as it's argument:
const
CANSPI_MASK_B1 
as byte = 0
CANSPI_MASK_B2 
as byte = 1
CANSPI_FILTER
The CANSPI_FILTER constants define filter codes. Functions CANSPISetFilter
expects one of these as it's argument:
184
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroBasic PRO for AVR
CHAPTER 6