neocafe88 / final-project-assignment-neocafe88

Repo for hosting Project for ECEN 5713 Final project
0 stars 0 forks source link

Device driver for temperature sensor #2

Open neocafe88 opened 1 year ago

neocafe88 commented 1 year ago

Build a device driver for a pseudo (mock) temperature sensor. Random numbers will be generated for temperature readings.

DoD: A user program can read temperatures from the device.

Blocker: None

neocafe88 commented 1 year ago

The actual temperature sensor driver might not be needed as the BSP in Buildroot might provide it. Still, a pseudo driver can help develop other modules which needs the driver but the driver won't be available until the system is build for the board. (Test Mock)

The kernel driver module generates random number using the function 'get_random_bytes()'. The temperature will fluctuate 66 ~ 86 F.

DoD is verified as 'cat /dev/tempdriver' get a temperature successfully.

neocafe88 commented 1 year ago

The driver is adjusted to give the temperature data at an interval longer than 1 second. If it's read within a second, it will give 'no-read'. To check the time, <linux/jiffies> was used.