The API function for setting a slot to receive messages is shown here. This function assumes that the mailbox was previously configured to receive and so makes the peripheral enter the Halt state. This is because it is safest to change the ID of a receive mailbox when the CAN peripheral is halted. The function sets the specified receive CAN ID for the specified mailbox using the two arguments given. The Mailbox is then obviously set to receive, and to use the mailbox's mask. Finally, Overwrite mode is chosen, and mailbox's receive interrupt is enabled unless USE_CAN_POLL was defined.