| Electronic Components Datasheet Search |
|
SN8F5708 Datasheet(PDF) 79 Page - SONiX Technology Company |
|
|
|||||||||||||||||||||||||||||
SN8F5708 Datasheet(HTML) 79 Page - SONiX Technology Company |
|
79 / 204 page ![]() www.sonix.com.tw SN8F5708 Series Copyright © 2019, SONiX Technology Co., Ltd. External Interrupt Datasheet Rev. 2.4 79 13.2 Sample Code The following sample code demonstrates how to perform INT0/INT1/INT2 with interrupt. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 #define INT0Rsing (1 << 0) //INT0 trigger edge is rising edge #define INT0Falling (2 << 0) //INT0 trigger edge is falling edge #define INT0LeChge (3 << 0) //INT0 trigger edge is level chagne #define EINT0 (1 << 0) //INT0 interrupt enable #define INT1Rsing (1 << 2) //INT1 trigger edge is rising edge #define INT1Falling (2 << 2) //INT1 trigger edge is falling edge #define INT1LeChge (3 << 2) //INT1 trigger edge is level chagne #define EINT1 (1 << 2) //INT1 interrupt enable #define INT2Rsing (1 << 4) //INT2 trigger edge is rising edge #define INT2Falling (2 << 4) //INT2 trigger edge is falling edge #define INT2LeChge (3 << 4) //INT2 trigger edge is level chagne #define EINT2 (1 << 6) //INT2 interrupt enable void EnableINT(void) { // INT0 rising edge, INT1 falling edge, INT2 level change PEDGE = INT0Rising |INT1Falling | INT2LeChge; // Enable INT0/INT1 interrupt IEN0 |= EINT0 | EINT1; // Enable INT2 interrupt IEN4 |= EINT2; // Enable total interrupt IEN0 |= 0x80; P0 = 0x00; P0M = 0x07; } void INT0Interrupt(void) interrupt ISRInt0 //0x03 { //IE0 clear by hardware P00 = ~P00; } void INT1Interrupt(void) interrupt ISRInt1 //0x13 { //IE1 clear by hardware P01 = ~P01; } void INT2Interrupt(void) interrupt ISRInt2 //0xEB { //IE2 clear by hardware P02 = ~P02; } |
|
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 |