Last active
December 16, 2022 04:58
-
-
Save rk76feWF/7bde94a983ed59d8e025882f21bb2b18 to your computer and use it in GitHub Desktop.
CN割り込み
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setCN(void) | |
{ | |
_CNIE = 1; // 割り込みを有効化 | |
_CNIF = 0; // 割り込みのフラグを下げる | |
_CNIP = 1; // 割り込み優先度の設定 | |
_CN83IE = 1; // CN83PINの割り込みを有効化 | |
_CN23IE = 1; // CN24PINの割り込みを有効化 | |
_CN22IE = 1; // CN22PINの割り込みを有効化 | |
_CN55IE = 1; // CN55PINの割り込みを有効化 | |
return; | |
} | |
void __attribute__((interrupt, no_auto_psv)) _CNInterrupt(void) | |
{ | |
// _CNxIE = 1にしているピンが変化したらまとめてこの割り込み関数がよばれる。 | |
// この中でPORTレジスタとか見て処理書いて。 | |
_CNIF = 0; // 割り込みフラグを下げる | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment