XINU
device
gpio
gpioselect.c
Go to the documentation of this file.
1
/* gpioselect.h - pin multiplexing and control for the BBB ZCZ package */
2
#include <
xinu.h
>
3
4
/*------------------------------------------------------------------------
5
* gpioselect - Configure modes for GPIO pins
6
*------------------------------------------------------------------------
7
*/
8
devcall
gpioselect
(
9
uint32
pinreg,
/* Pin to be affected */
10
uint32
pinmode,
/* Multiplexed pin function */
11
uint32
pinsettings
/* Settings for the pin */
12
)
13
{
14
volatile
uint32
* confreg;
/* Pin configuration register */
15
16
/* Pick up the pin configuration register address */
17
18
confreg = &(((
uint32
*)
PINMUXBASE
)[pinreg]);
19
20
/* Apply the specified settings to the pin */
21
22
*confreg = pinmode|pinsettings;
23
24
return
OK
;
25
}
xinu.h
全てのシステムヘッダファイルをインクルードする。
OK
#define OK
処理が成功した場合
Definition:
kernel.h:77
gpioselect
devcall gpioselect(uint32 pinreg, uint32 pinmode, uint32 pinsettings)
Definition:
gpioselect.c:8
PINMUXBASE
#define PINMUXBASE
Definition:
gpioselect.h:5
uint32
unsigned int uint32
符号なし32ビット整数(unsigned int)
Definition:
kernel.h:15
devcall
int32 devcall
デバイスコール関数 返り値の型
Definition:
kernel.h:49
Generated by
1.8.13