Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:03

0001 /**
0002  * @file
0003  *
0004  * @ingroup RTEMSBSPsARMLPC176X
0005  *
0006  * @brief Input/output module methods definitions.
0007  */
0008 
0009 /*
0010  * Copyright (c) 2014 Taller Technologies.
0011  *
0012  * @author  Boretto Martin    (martin.boretto@tallertechnologies.com)
0013  * @author  Diaz Marcos (marcos.diaz@tallertechnologies.com)
0014  * @author  Lenarduzzi Federico  (federico.lenarduzzi@tallertechnologies.com)
0015  * @author  Daniel Chicco  (daniel.chicco@tallertechnologies.com)
0016  *
0017  * The license and distribution terms for this file may be
0018  * found in the file LICENSE in this distribution or at
0019  * http://www.rtems.org/license/LICENSE.
0020  */
0021 
0022 #ifndef LIBBSP_ARM_LPC176X_IO_H
0023 #define LIBBSP_ARM_LPC176X_IO_H
0024 
0025 #include <assert.h>
0026 #include <rtems.h>
0027 #include <bsp/io-defs.h>
0028 
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif /* __cplusplus */
0032 
0033 /**
0034  * @brief Sets pin to the selected function.
0035  *
0036  * @param pin The pin to set.
0037  * @param function Defines the function to set.
0038  */
0039 void lpc176x_pin_select(
0040   uint32_t             pin,
0041   lpc176x_pin_function function
0042 );
0043 
0044 /**
0045  * @brief Sets pin to the selected mode.
0046  *
0047  * @param pin The pin to set.
0048  * @param mode Defines the mode to set.
0049  */
0050 void lpc176x_pin_set_mode(
0051   const uint32_t             pin,
0052   const lpc176x_pin_mode mode
0053 );
0054 
0055 /**
0056  * @brief Enables the module power and clock.
0057  *
0058  * @param  module Represents the module to be enabled.
0059  * @param  clock  Represents the clock to set for this module.
0060  * @return RTEMS_SUCCESFULL if the module was enabled succesfully.
0061  */
0062 rtems_status_code lpc176x_module_enable(
0063   lpc176x_module       module,
0064   lpc176x_module_clock clock
0065 );
0066 
0067 /**
0068  * @brief Checks if the current module is turned off and disables a module.
0069  *
0070  * @param  module Represents the module to be disabled.
0071  * @return RTEMS_SUCCESFULL if the module was disabled succesfully.
0072  */
0073 rtems_status_code lpc176x_module_disable( lpc176x_module module );
0074 
0075 /**
0076  * @brief Checks if the current module is enabled or not.
0077  *
0078  * @param  module Represents the module to be checked.
0079  * @return TRUE if the module is enabled.
0080  *         FALSE otherwise.
0081  */
0082 bool lpc176x_module_is_enabled( lpc176x_module module );
0083 
0084 #ifdef __cplusplus
0085 }
0086 #endif /* __cplusplus */
0087 
0088 #endif /* LIBBSP_ARM_LPC176X_IO_H */