您的位置:首页 > 编程语言 > ASP

raspberry GPIO 低权限寄存器访问函数简介

2013-04-15 23:36 316 查看
bcm2835 1.25
Main Page
Modules
Files
Examples



Functions

Low level register access

Functions

uint32_t bcm2835_peri_read (volatile
uint32_t *paddr)
uint32_t bcm2835_peri_read_nb (volatile
uint32_t *paddr)
void bcm2835_peri_write (volatile
uint32_t *paddr, uint32_t value)
void bcm2835_peri_write_nb (volatile
uint32_t *paddr, uint32_t value)
void bcm2835_peri_set_bits (volatile
uint32_t *paddr, uint32_t value, uint32_t mask)

Detailed Description

These functions provide low level register access, and should not generally need to be used

Function Documentation

uint32_t bcm2835_peri_read(volatile uint32_t * paddr)
Reads 32 bit value from a peripheral address The read is done twice, and is therefore always safe in terms of manual section 1.3 Peripheral access precautions for correct memory ordering

Parameters:
[in]paddrPhysical address to read from. See BCM2835_GPIO_BASE etc.
Returns:the value read from the 32 bit register

See also:Physical Addresses

uint32_t bcm2835_peri_read_nb(volatile uint32_t * paddr)
Reads 32 bit value from a peripheral address without the read barrier You should only use this when your code has previously called bcm2835_peri_read() within
the same peripheral, and no other peripheral access has occurred since.

Parameters:
[in]paddrPhysical address to read from. See BCM2835_GPIO_BASE etc.
Returns:the value read from the 32 bit register

See also:Physical Addresses

void bcm2835_peri_set_bits(volatile uint32_t * paddr,
uint32_t value,
uint32_t mask
)
Alters a number of bits in a 32 peripheral regsiter. It reads the current valu and then alters the bits deines as 1 in mask, according to the bit value in value. All other bits that are 0 in the mask are unaffected. Use this to alter
a subset of the bits in a register. The write is done twice, and is therefore always safe in terms of manual section 1.3 Peripheral access precautions for correct memory ordering

Parameters:
[in]paddrPhysical address to read from. See BCM2835_GPIO_BASE etc.
[in]valueThe 32 bit value to write, masked in by mask.
[in]maskBitmask that defines the bits that will be altered in the register.
See also:Physical Addresses

void bcm2835_peri_write(volatile uint32_t * paddr,
uint32_t value
)
Writes 32 bit value from a peripheral address The write is done twice, and is therefore always safe in terms of manual section 1.3 Peripheral access precautions for correct memory ordering

Parameters:
[in]paddrPhysical address to read from. See BCM2835_GPIO_BASE etc.
[in]valueThe 32 bit value to write
See also:Physical Addresses

void bcm2835_peri_write_nb(volatile uint32_t * paddr,
uint32_t value
)
Writes 32 bit value from a peripheral address without the write barrier You should only use this when your code has previously called bcm2835_peri_write() within
the same peripheral, and no other peripheral access has occurred since.

Parameters:
[in]paddrPhysical address to read from. See BCM2835_GPIO_BASE etc.
[in]valueThe 32 bit value to write
See also:Physical Addresses
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐