CARME-M4 BSP  V1.5
carme.h File Reference
#include <stm32f4xx.h>
+ Include dependency graph for carme.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _CARME_Port_Pin_t
 CARME port and pin association structure. More...
 

Macros

#define FSMC_NOR_PSRAM_CS_ADDR(n)
 
#define FSMC_FLASH_BASE   FSMC_NOR_PSRAM_CS_ADDR(1)
 
#define FSMC_PSRAM_BASE   FSMC_NOR_PSRAM_CS_ADDR(2)
 
#define FSMC_LCD_SSD1963_BASE   FSMC_NOR_PSRAM_CS_ADDR(3)
 
#define FSMC_IO_BASE   FSMC_NOR_PSRAM_CS_ADDR(4)
 
#define FSMC_CARME_EXTENSION1_BASE   (FSMC_IO_BASE + 0x0000000)
 
#define FSMC_CARME_EXTENSION2_BASE   (FSMC_IO_BASE + 0x1000000)
 
#define FSMC_CAN_BASE   (FSMC_IO_BASE + 0x2000000)
 
#define CARME_AGPIO_9   GPIOI, GPIO_Pin_5
 
#define CARME_AGPIO_13   GPIOG, GPIO_Pin_15
 
#define CARME_AGPIO_21   GPIOI, GPIO_Pin_4
 
#define CARME_AGPIO_22   GPIOH, GPIO_Pin_2
 
#define CARME_AGPIO_90   GPIOF, GPIO_Pin_11
 
#define CARME_AGPIO_91   GPIOF, GPIO_Pin_10
 
#define CARME_AGPIO_93   GPIOF, GPIO_Pin_9
 
#define CARME_AGPIO_94   GPIOF, GPIO_Pin_8
 
#define CARME_AGPIO_96   GPIOF, GPIO_Pin_7
 
#define CARME_AGPIO_97   GPIOF, GPIO_Pin_6
 
#define CARME_AGPIO_99   GPIOC, GPIO_Pin_7
 
#define CARME_AGPIO_101   GPIOB, GPIO_Pin_15
 
#define CARME_AGPIO_102   GPIOB, GPIO_Pin_14
 
#define CARME_AGPIO_103   GPIOI, GPIO_Pin_0
 
#define CARME_AGPIO_105   GPIOB, GPIO_Pin_8
 
#define CARME_AGPIO_108   GPIOB, GPIO_Pin_6
 
#define CARME_AGPIO_115   GPIOB, GPIO_Pin_2
 
#define CARME_AGPIO_116   GPIOB, GPIO_Pin_1
 
#define CARME_LED_GREEN   GPIOI, GPIO_Pin_6
 
#define CARME_LED_RED   GPIOI, GPIO_Pin_7
 
#define CARME_AGPIO_PIN_116   ((uint32_t)0x00001)
 
#define CARME_AGPIO_PIN_115   ((uint32_t)0x00002)
 
#define CARME_AGPIO_PIN_108   ((uint32_t)0x00004)
 
#define CARME_AGPIO_PIN_105   ((uint32_t)0x00008)
 
#define CARME_AGPIO_PIN_103   ((uint32_t)0x00010)
 
#define CARME_AGPIO_PIN_102   ((uint32_t)0x00020)
 
#define CARME_AGPIO_PIN_101   ((uint32_t)0x00040)
 
#define CARME_AGPIO_PIN_99   ((uint32_t)0x00080)
 
#define CARME_AGPIO_PIN_97   ((uint32_t)0x00100)
 
#define CARME_AGPIO_PIN_96   ((uint32_t)0x00200)
 
#define CARME_AGPIO_PIN_94   ((uint32_t)0x00400)
 
#define CARME_AGPIO_PIN_93   ((uint32_t)0x00800)
 
#define CARME_AGPIO_PIN_91   ((uint32_t)0x01000)
 
#define CARME_AGPIO_PIN_90   ((uint32_t)0x02000)
 
#define CARME_AGPIO_PIN_22   ((uint32_t)0x04000)
 
#define CARME_AGPIO_PIN_21   ((uint32_t)0x08000)
 
#define CARME_AGPIO_PIN_13   ((uint32_t)0x10000)
 
#define CARME_AGPIO_PIN_9   ((uint32_t)0x20000)
 
#define CARME_LED_PIN_GREEN   ((uint32_t)0x40000)
 
#define CARME_LED_PIN_RED   ((uint32_t)0x80000)
 
#define CARME_NO_ERROR   0x0
 
#define CARME_ERROR_IO1_BASE   0x10
 
#define CARME_ERROR_IO2_BASE   0x20
 
#define CARME_ERROR_UART_BASE   0x30
 
#define CARME_ERROR_CAN_BASE   0x40
 
#define CARME_ERROR_I2C_BASE   0x60
 
#define CARME_ERROR_AUDIO_BASE   0x80
 
#define CARME_ERROR_ETH_BASE   0xA0
 
#define CARME_ERROR_USB_BASE   0xC0
 
#define CARME_ERROR_EEPROM_BASE   0xE0
 
#define CARME_GPIO_PIN_TO_SOURCE(GPIO_PIN)
 Get GPIO_PinSourcex from GPIO_Pin_x. More...
 
#define CARME_GPIO_TO_EXTIPORTSOURCE(GPIO_PORT)
 Get EXTI_PortSourceGPIOx from GPIOx. More...
 
#define CARME_GPIO_TO_EXTIPINSOURCE(GPIO_PIN)
 Get EXTI_PinSourcex from GPIO_Pin_x. More...
 
#define CARME_GPIO_TO_EXTILINE(GPIO_PIN)
 Get EXTI_Linex from GPIO_Pin_x. More...
 
#define max(a, b)   ( ((a) > (b)) ? (a) : (b) )
 Get the maximum of two numbers.
 
#define min(a, b)   ( ((a) < (b)) ? (a) : (b) )
 Get the minimum of two numbers.
 

Typedefs

typedef struct _CARME_Port_Pin_t CARME_Port_Pin_t
 CARME port and pin association structure.
 
typedef uint8_t ERROR_CODES
 Error variable.
 

Functions

void CARME_Init (void)
 CARME-M4 module initialization. More...
 
void CARME_GPIO_Init (CARME_Port_Pin_t *pPortPinAssociation, GPIO_InitTypeDef *pGPIO_InitStruct, uint8_t size)
 Initialize GPIO ports with a CARME_Port_Pin_t table. More...
 
void CARME_AGPIO_Set (uint32_t write, uint32_t mask)
 Set the AGPIO state. More...
 
void CARME_AGPIO_Get (uint32_t *pStatus)
 Get the AGPIO state. More...
 
void CARME_LED_Green_Set (void)
 Set the green LED on the CARME Module. More...
 
void CARME_LED_Green_Reset (void)
 Reset the green LED on the CARME Module. More...
 
void CARME_LED_Red_Set (void)
 Set the red LED on the CARME Module. More...
 
void CARME_LED_Red_Reset (void)
 Reset the red LED on the CARME Module. More...
 

Detailed Description

Version
1.0
Date
2013-01-09
Author
rct1

This software can be used by students and other personal of the Bern University of Applied Sciences under the terms of the MIT license. For other persons this software is under the terms of the GNU General Public License version 2.

Copyright © 2013, Bern University of Applied Sciences. All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

GNU GENERAL PUBLIC LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Definition in file carme.h.