| Electronic Components Datasheet Search |
|
SH7047F Datasheet(PDF) 29 Page - Renesas Technology Corp |
|
|
|||||||||||||||||||||||||||||
SH7047F Datasheet(HTML) 29 Page - Renesas Technology Corp |
|
29 / 85 page ![]() Rev. 1.00, 08/03, page 21 of 74 2.8 Reception Program Listing /********************************************************************************/ /* HCAN-2 Reception Program (Example 2) */ /********************************************************************************/ #include <stdio.h> /* Library function header file */ #include <machine.h> /* Library function header file */ #include "SH7047.h" /* Peripheral register definition header file */ /********************************************************************************/ /* Function prototype declarations */ /********************************************************************************/ void r_main(void ); void RM1_IRR1(void); /********************************************************************************/ /* Define constants */ /********************************************************************************/ #define DTMR (*(unsigned short *)0xFFFFD080) /* DTC register data */ #define DTCRA (*(unsigned short *)0xFFFFD082) /* DTC register data */ #define DTCRB (*(unsigned short *)0xFFFFD086) /* DTC register data */ #define DTSAR (*(unsigned long *)0xFFFFD088) /* DTC register data */ #define DTDAR (*(unsigned long *)0xFFFFD08C) /* DTC register data */ #define MBbuff (*(unsigned char *)0xFFFFD100) /* Storage area for received data */ /********************************************************************************/ /* Main routine */ /********************************************************************************/ void r_main(void){ unsigned short *work; /* Initialize storage area for received data */ work = (unsigned short *)0xFFFFD100; do { *work = 0x0000; work++; } while(work < (unsigned short *)0xFFFFD108); /* DTC settings */ DTMR = 0xA890; /* Increment both DTSAR and DTDAR after transfer completes, set block transfer mode and byte transfer */ DTSAR = (unsigned long)&HCAN_MB0.MD7; /* Set transfer source address */ DTDAR = (unsigned long)&MBbuff; /* Set transfer destination address */ DTCRA = 0x0001; /* Block transfer: 1 block */ DTCRB = 0x0008; /* Block length: 8 bytes */ DTC.DTBR = 0xFFFF; /* Register data base address */ DTC.DTEF |= 0x04; /* HCAN-2 interrupt (RM1) */ /* Clear bit MCR0 */ HCAN_MCR = 0x0000; /* Clear reset request bit */ /* Set local acceptance filter */ HCAN_MB0.LAFM15 = 0x0000; /* Set identifier filter mask for mailbox 0 */ /* Clear bit IRR0 */ HCAN_IRR = 0x0001; /* Clear reset interrupt flag (to clear, write 1) */ /* Set pins */ |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |