TNeoKernel
v1.04
|
Atomic bit-field access macros for PIC24/dsPIC.
Initially, the code was taken from the article by Alex Borisov (russian), and modified a bit.
The kernel would not probably provide that kind of functionality, but the kernel itself needs it, so, it is made public so that application can use it too.
Definition in file tn_arch_pic24_bfa.h.
Go to the source code of this file.
Macros | |
#define | TN_BFA_SET 0x1111 |
Command for TN_BFA() macro: Set bits in the bit field by mask; ... macro param should be set to the bit mask to set. More... | |
#define | TN_BFA_CLR 0x2222 |
Command for TN_BFA() macro: Clear bits in the bit field by mask; ... macro param should be set to the bit mask to clear. More... | |
#define | TN_BFA_INV 0x3333 |
Command for TN_BFA() macro: Invert bits in the bit field by mask; ... macro param should be set to the bit mask to invert. More... | |
#define | TN_BFA_WR 0xAAAA |
Command for TN_BFA() macro: Write bit field; ... macro param should be set to the value to write. More... | |
#define | TN_BFA_RD 0xBBBB |
Command for TN_BFA() macro: Read bit field; ... macro param ignored. More... | |
#define | TN_BFA(comm, reg_name, field_name,...) |
Macro for atomic access to the structure bit field. More... | |
#define | TN_BFAR(comm, reg_name, lower, upper,...) |
Macro for atomic access to the structure bit field specified as a range. More... | |
#define TN_BFA_SET 0x1111 |
Command for TN_BFA()
macro: Set bits in the bit field by mask; ...
macro param should be set to the bit mask to set.
Definition at line 76 of file tn_arch_pic24_bfa.h.
#define TN_BFA_CLR 0x2222 |
Command for TN_BFA()
macro: Clear bits in the bit field by mask; ...
macro param should be set to the bit mask to clear.
Definition at line 80 of file tn_arch_pic24_bfa.h.
#define TN_BFA_INV 0x3333 |
Command for TN_BFA()
macro: Invert bits in the bit field by mask; ...
macro param should be set to the bit mask to invert.
Definition at line 84 of file tn_arch_pic24_bfa.h.
#define TN_BFA_WR 0xAAAA |
Command for TN_BFA()
macro: Write bit field; ...
macro param should be set to the value to write.
Definition at line 88 of file tn_arch_pic24_bfa.h.
#define TN_BFA_RD 0xBBBB |
Command for TN_BFA()
macro: Read bit field; ...
macro param ignored.
Definition at line 92 of file tn_arch_pic24_bfa.h.
#define TN_BFA | ( | comm, | |
reg_name, | |||
field_name, | |||
... | |||
) |
Macro for atomic access to the structure bit field.
The BFA
acronym means Bit Field Access.
comm | command to execute:
|
reg_name | register name (PORTA , CMCON , ...). |
field_name | structure field name |
... | used if only comm != TN_BFA_RD . Meaning depends on the comm , see comments for specific command: TN_BFA_WR , etc. |
Usage examples:
Definition at line 154 of file tn_arch_pic24_bfa.h.
#define TN_BFAR | ( | comm, | |
reg_name, | |||
lower, | |||
upper, | |||
... | |||
) |
Macro for atomic access to the structure bit field specified as a range.
comm | command to execute:
|
reg_name | variable name (PORTA , CMCON , ...). Variable should be in the near memory (first 8 KB) |
lower | number of lowest affected bit of the field |
upper | number of highest affected bit of the field |
... | used if only comm != TN_BFA_RD . Meaning depends on the comm , see comments for specific command: TN_BFA_WR , etc. |
Usage examples:
Definition at line 270 of file tn_arch_pic24_bfa.h.