This article talks about how to use the echo command in user space to implement GPIO for a simple device driver.
For related subjects, please refer to the SOC Table of Contents.
We will now start testing and configuring the system. We can start by mounting both the SD card partitions.
cd /mnt
mkdir sd_1
mount /dev/mmcblk0p1 /mnt/sd_1
mkdir sd_2
mount /dev/mmcblk0p2 /mnt/sd_2
As we can see, both the partitions are now successfully mounted and accessible.
We execute
insmod fii-driver.ko
We now test to see if the /dev directory has successfully loaded the fii-module driver by executing the following:
cd /mnt/sd_2
ls -l /dev/fii-module
If it exists, it means that the driver was successfully loaded.
Next, we will go on to set up the DDR by using the following commands:
echo d 0000 > /dev/fii-module