aboutsummaryrefslogtreecommitdiff
path: root/hsm-gpio/Hsm/GPIO
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-08-19 03:56:40 +0000
committerPaul Oliver <contact@pauloliver.dev>2025-08-23 22:59:12 +0000
commit307cb1b1094c73fd15eab378c27ac0073696b739 (patch)
tree730949857bd356a7d1f1739b1c8c28967d0461e4 /hsm-gpio/Hsm/GPIO
parent4efe903a671b288ac485f2d2a9c9aabf2eb7b199 (diff)
Improves formatting
Diffstat (limited to 'hsm-gpio/Hsm/GPIO')
-rw-r--r--hsm-gpio/Hsm/GPIO/FFI.hs (renamed from hsm-gpio/Hsm/GPIO/FFI.hsc)14
1 files changed, 8 insertions, 6 deletions
diff --git a/hsm-gpio/Hsm/GPIO/FFI.hsc b/hsm-gpio/Hsm/GPIO/FFI.hs
index f0f5737..c1bb9e8 100644
--- a/hsm-gpio/Hsm/GPIO/FFI.hsc
+++ b/hsm-gpio/Hsm/GPIO/FFI.hs
@@ -51,20 +51,20 @@ newtype LineDirection
= LineDirection CInt
deriving Show
-foreign import capi "gpiod.h value GPIOD_LINE_DIRECTION_INPUT"
+foreign import capi safe "gpiod.h value GPIOD_LINE_DIRECTION_INPUT"
input :: LineDirection
-foreign import capi "gpiod.h value GPIOD_LINE_DIRECTION_OUTPUT"
+foreign import capi safe "gpiod.h value GPIOD_LINE_DIRECTION_OUTPUT"
output :: LineDirection
newtype LineValue
= LineValue CInt
deriving (Show, Storable)
-foreign import capi "gpiod.h value GPIOD_LINE_VALUE_ACTIVE"
+foreign import capi safe "gpiod.h value GPIOD_LINE_VALUE_ACTIVE"
active :: LineValue
-foreign import capi "gpiod.h value GPIOD_LINE_VALUE_INACTIVE"
+foreign import capi safe "gpiod.h value GPIOD_LINE_VALUE_INACTIVE"
inactive :: LineValue
foreign import capi unsafe "gpiod.h gpiod_line_settings_new"
@@ -88,7 +88,8 @@ foreign import capi unsafe "gpiod.h gpiod_line_config_free"
lineConfigFree :: Ptr LineConfig -> IO ()
foreign import capi unsafe "gpiod.h gpiod_line_config_add_line_settings"
- lineConfigAddLineSettings :: Ptr LineConfig -> Ptr CUInt -> CSize -> Ptr LineSettings -> IO CInt
+ lineConfigAddLineSettings
+ :: Ptr LineConfig -> Ptr CUInt -> CSize -> Ptr LineSettings -> IO CInt
data RequestConfig
@@ -104,7 +105,8 @@ foreign import capi unsafe "gpiod.h gpiod_request_config_set_consumer"
data LineRequest
foreign import capi unsafe "gpiod.h gpiod_chip_request_lines"
- chipRequestLines :: Ptr Chip -> Ptr RequestConfig -> Ptr LineConfig -> IO (Ptr LineRequest)
+ chipRequestLines
+ :: Ptr Chip -> Ptr RequestConfig -> Ptr LineConfig -> IO (Ptr LineRequest)
foreign import capi unsafe "gpiod.h gpiod_line_request_release"
lineRequestRelease :: Ptr LineRequest -> IO ()