1 | /** |
---|
2 | * @file io.h |
---|
3 | * |
---|
4 | * @ingroup lpc176x |
---|
5 | * |
---|
6 | * @brief Input/output module methods definitions. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2014 Taller Technologies. |
---|
11 | * |
---|
12 | * @author Boretto Martin (martin.boretto@tallertechnologies.com) |
---|
13 | * @author Diaz Marcos (marcos.diaz@tallertechnologies.com) |
---|
14 | * @author Lenarduzzi Federico (federico.lenarduzzi@tallertechnologies.com) |
---|
15 | * @author Daniel Chicco (daniel.chicco@tallertechnologies.com) |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be |
---|
18 | * found in the file LICENSE in this distribution or at |
---|
19 | * http://www.rtems.org/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef LIBBSP_ARM_LPC176X_IO_H |
---|
23 | #define LIBBSP_ARM_LPC176X_IO_H |
---|
24 | |
---|
25 | #include <assert.h> |
---|
26 | #include <rtems.h> |
---|
27 | #include <bsp/io-defs.h> |
---|
28 | |
---|
29 | #ifdef __cplusplus |
---|
30 | extern "C" { |
---|
31 | #endif /* __cplusplus */ |
---|
32 | |
---|
33 | /** |
---|
34 | * @brief Sets pin to the selected function. |
---|
35 | * |
---|
36 | * @param pin The pin to set. |
---|
37 | * @param function Defines the function to set. |
---|
38 | */ |
---|
39 | void lpc176x_pin_select( |
---|
40 | uint32_t pin, |
---|
41 | lpc176x_pin_function function |
---|
42 | ); |
---|
43 | |
---|
44 | /** |
---|
45 | * @brief Sets pin to the selected mode. |
---|
46 | * |
---|
47 | * @param pin The pin to set. |
---|
48 | * @param mode Defines the mode to set. |
---|
49 | */ |
---|
50 | void lpc176x_pin_set_mode( |
---|
51 | const uint32_t pin, |
---|
52 | const lpc176x_pin_mode mode |
---|
53 | ); |
---|
54 | |
---|
55 | /** |
---|
56 | * @brief Enables the module power and clock. |
---|
57 | * |
---|
58 | * @param module Represents the module to be enabled. |
---|
59 | * @param clock Represents the clock to set for this module. |
---|
60 | * @return RTEMS_SUCCESFULL if the module was enabled succesfully. |
---|
61 | */ |
---|
62 | rtems_status_code lpc176x_module_enable( |
---|
63 | lpc176x_module module, |
---|
64 | lpc176x_module_clock clock |
---|
65 | ); |
---|
66 | |
---|
67 | /** |
---|
68 | * @brief Checks if the current module is turned off and disables a module. |
---|
69 | * |
---|
70 | * @param module Represents the module to be disabled. |
---|
71 | * @return RTEMS_SUCCESFULL if the module was disabled succesfully. |
---|
72 | */ |
---|
73 | rtems_status_code lpc176x_module_disable( lpc176x_module module ); |
---|
74 | |
---|
75 | /** |
---|
76 | * @brief Checks if the current module is enabled or not. |
---|
77 | * |
---|
78 | * @param module Represents the module to be checked. |
---|
79 | * @return TRUE if the module is enabled. |
---|
80 | * FALSE otherwise. |
---|
81 | */ |
---|
82 | bool lpc176x_module_is_enabled( lpc176x_module module ); |
---|
83 | |
---|
84 | #ifdef __cplusplus |
---|
85 | } |
---|
86 | #endif /* __cplusplus */ |
---|
87 | |
---|
88 | #endif /* LIBBSP_ARM_LPC176X_IO_H */ |
---|