CARME-M4 BSP  V1.5
CARME-M4 Core Module

CARME Core Module functions and defines. More...

+ Collaboration diagram for CARME-M4 Core Module:

Files

file  carme.h
 
file  carme.c
 

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.
 
#define CARME_ACTIVATE_EXT_FLASH   0
 
#define CARME_GPIO_PIN_TO_MODER(GPIO_PIN)
 Get the pin moder from the pin number. More...
 

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...
 
static void CARME_FSMC_Init (void)
 Initialization of the FSMC. This bus is used for the connection to the CarmeIO1 and CarmeIO2 module, the CAN driver (SJA1000) and the LCD driver. More...
 
static void CARME_FSMC_GPIO_Init (void)
 Initialization of the FSMC GPIO pins. This bus is used for the connection to the extension modules, the CAN driver (SJA1000) and the LCD driver. More...
 
static void CARME_AGPIO_Init (void)
 CARME AGPIO initialization. More...
 
static uint8_t CARME_AGPIO_GetMode (GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
 Get the AGPIO mode. More...
 

Variables

static CARME_Port_Pin_t CARME_AGPIO_Port_Pin []
 CARME AGPIO Port and Pin association. More...
 

Detailed Description

CARME Core Module functions and defines.

Macro Definition Documentation

#define CARME_ACTIVATE_EXT_FLASH   0

Activate external Flash

Definition at line 85 of file carme.c.

#define CARME_AGPIO_101   GPIOB, GPIO_Pin_15

Additional GPIO 101

Definition at line 102 of file carme.h.

#define CARME_AGPIO_102   GPIOB, GPIO_Pin_14

Additional GPIO 102

Definition at line 103 of file carme.h.

#define CARME_AGPIO_103   GPIOI, GPIO_Pin_0

Additional GPIO 103

Definition at line 104 of file carme.h.

#define CARME_AGPIO_105   GPIOB, GPIO_Pin_8

Additional GPIO 105

Definition at line 105 of file carme.h.

#define CARME_AGPIO_108   GPIOB, GPIO_Pin_6

Additional GPIO 108

Definition at line 106 of file carme.h.

#define CARME_AGPIO_115   GPIOB, GPIO_Pin_2

Additional GPIO 115

Definition at line 107 of file carme.h.

#define CARME_AGPIO_116   GPIOB, GPIO_Pin_1

Additional GPIO 116

Definition at line 108 of file carme.h.

#define CARME_AGPIO_13   GPIOG, GPIO_Pin_15

Additional GPIO 13

Definition at line 92 of file carme.h.

#define CARME_AGPIO_21   GPIOI, GPIO_Pin_4

Additional GPIO 21

Definition at line 93 of file carme.h.

#define CARME_AGPIO_22   GPIOH, GPIO_Pin_2

Additional GPIO 22

Definition at line 94 of file carme.h.

#define CARME_AGPIO_9   GPIOI, GPIO_Pin_5

Additional GPIO 9

Definition at line 91 of file carme.h.

#define CARME_AGPIO_90   GPIOF, GPIO_Pin_11

Additional GPIO 90

Definition at line 95 of file carme.h.

#define CARME_AGPIO_91   GPIOF, GPIO_Pin_10

Additional GPIO 91

Definition at line 96 of file carme.h.

#define CARME_AGPIO_93   GPIOF, GPIO_Pin_9

Additional GPIO 93

Definition at line 97 of file carme.h.

#define CARME_AGPIO_94   GPIOF, GPIO_Pin_8

Additional GPIO 94

Definition at line 98 of file carme.h.

#define CARME_AGPIO_96   GPIOF, GPIO_Pin_7

Additional GPIO 96

Definition at line 99 of file carme.h.

#define CARME_AGPIO_97   GPIOF, GPIO_Pin_6

Additional GPIO 97

Definition at line 100 of file carme.h.

#define CARME_AGPIO_99   GPIOC, GPIO_Pin_7

Additional GPIO 99

Definition at line 101 of file carme.h.

#define CARME_AGPIO_PIN_101   ((uint32_t)0x00040)

Additional GPIO 101 Pin

Definition at line 119 of file carme.h.

#define CARME_AGPIO_PIN_102   ((uint32_t)0x00020)

Additional GPIO 102 Pin

Definition at line 118 of file carme.h.

#define CARME_AGPIO_PIN_103   ((uint32_t)0x00010)

Additional GPIO 103 Pin

Definition at line 117 of file carme.h.

#define CARME_AGPIO_PIN_105   ((uint32_t)0x00008)

Additional GPIO 105 Pin

Definition at line 116 of file carme.h.

#define CARME_AGPIO_PIN_108   ((uint32_t)0x00004)

Additional GPIO 108 Pin

Definition at line 115 of file carme.h.

#define CARME_AGPIO_PIN_115   ((uint32_t)0x00002)

Additional GPIO 115 Pin

Definition at line 114 of file carme.h.

#define CARME_AGPIO_PIN_116   ((uint32_t)0x00001)

Additional GPIO 116 Pin

Definition at line 113 of file carme.h.

#define CARME_AGPIO_PIN_13   ((uint32_t)0x10000)

Additional GPIO 13 Pin

Definition at line 129 of file carme.h.

#define CARME_AGPIO_PIN_21   ((uint32_t)0x08000)

Additional GPIO 21 Pin

Definition at line 128 of file carme.h.

#define CARME_AGPIO_PIN_22   ((uint32_t)0x04000)

Additional GPIO 22 Pin

Definition at line 127 of file carme.h.

#define CARME_AGPIO_PIN_9   ((uint32_t)0x20000)

Additional GPIO 9 Pin

Definition at line 130 of file carme.h.

#define CARME_AGPIO_PIN_90   ((uint32_t)0x02000)

Additional GPIO 90 Pin

Definition at line 126 of file carme.h.

#define CARME_AGPIO_PIN_91   ((uint32_t)0x01000)

Additional GPIO 91 Pin

Definition at line 125 of file carme.h.

#define CARME_AGPIO_PIN_93   ((uint32_t)0x00800)

Additional GPIO 93 Pin

Definition at line 124 of file carme.h.

#define CARME_AGPIO_PIN_94   ((uint32_t)0x00400)

Additional GPIO 94 Pin

Definition at line 123 of file carme.h.

#define CARME_AGPIO_PIN_96   ((uint32_t)0x00200)

Additional GPIO 96 Pin

Definition at line 122 of file carme.h.

#define CARME_AGPIO_PIN_97   ((uint32_t)0x00100)

Additional GPIO 97 Pin

Definition at line 121 of file carme.h.

#define CARME_AGPIO_PIN_99   ((uint32_t)0x00080)

Additional GPIO 99 Pin

Definition at line 120 of file carme.h.

#define CARME_ERROR_AUDIO_BASE   0x80

Audio codec errors

Definition at line 141 of file carme.h.

#define CARME_ERROR_CAN_BASE   0x40

CAN errors

Definition at line 139 of file carme.h.

#define CARME_ERROR_EEPROM_BASE   0xE0

EEPROM errors

Definition at line 144 of file carme.h.

#define CARME_ERROR_ETH_BASE   0xA0

Ethernet errors

Definition at line 142 of file carme.h.

#define CARME_ERROR_I2C_BASE   0x60

I2C errors

Definition at line 140 of file carme.h.

#define CARME_ERROR_IO1_BASE   0x10

CARME IO1 errors

Definition at line 136 of file carme.h.

#define CARME_ERROR_IO2_BASE   0x20

CARME IO2 errors

Definition at line 137 of file carme.h.

#define CARME_ERROR_UART_BASE   0x30

UART errors

Definition at line 138 of file carme.h.

#define CARME_ERROR_USB_BASE   0xC0

USB errors

Definition at line 143 of file carme.h.

#define CARME_GPIO_PIN_TO_MODER (   GPIO_PIN)
Value:
( \
((GPIO_PIN) & GPIO_Pin_0) ? GPIO_MODER_MODER0 : /* bit 0 is set? */ \
((GPIO_PIN) & GPIO_Pin_1) ? GPIO_MODER_MODER1 : /* bit 1 is set? */ \
((GPIO_PIN) & GPIO_Pin_2) ? GPIO_MODER_MODER2 : /* bit 2 is set? */ \
((GPIO_PIN) & GPIO_Pin_3) ? GPIO_MODER_MODER3 : /* bit 3 is set? */ \
((GPIO_PIN) & GPIO_Pin_4) ? GPIO_MODER_MODER4 : /* bit 4 is set? */ \
((GPIO_PIN) & GPIO_Pin_5) ? GPIO_MODER_MODER5 : /* bit 5 is set? */ \
((GPIO_PIN) & GPIO_Pin_6) ? GPIO_MODER_MODER6 : /* bit 6 is set? */ \
((GPIO_PIN) & GPIO_Pin_7) ? GPIO_MODER_MODER7 : /* bit 7 is set? */ \
((GPIO_PIN) & GPIO_Pin_8) ? GPIO_MODER_MODER8 : /* bit 8 is set? */ \
((GPIO_PIN) & GPIO_Pin_9) ? GPIO_MODER_MODER9 : /* bit 9 is set? */ \
((GPIO_PIN) & GPIO_Pin_10) ? GPIO_MODER_MODER10 : /* bit 10 is set? */\
((GPIO_PIN) & GPIO_Pin_11) ? GPIO_MODER_MODER11 : /* bit 11 is set? */\
((GPIO_PIN) & GPIO_Pin_12) ? GPIO_MODER_MODER12 : /* bit 12 is set? */\
((GPIO_PIN) & GPIO_Pin_13) ? GPIO_MODER_MODER13 : /* bit 13 is set? */\
((GPIO_PIN) & GPIO_Pin_14) ? GPIO_MODER_MODER14 : /* bit 14 is set? */\
((GPIO_PIN) & GPIO_Pin_15) ? GPIO_MODER_MODER15 : /* bit 15 is set? */\
-1) /* no bits are set */

Get the pin moder from the pin number.

Definition at line 90 of file carme.c.

#define CARME_GPIO_PIN_TO_SOURCE (   GPIO_PIN)
Value:
( \
((GPIO_PIN) & GPIO_Pin_0) ? GPIO_PinSource0 : /* bit 0 is set? */ \
((GPIO_PIN) & GPIO_Pin_1) ? GPIO_PinSource1 : /* bit 1 is set? */ \
((GPIO_PIN) & GPIO_Pin_2) ? GPIO_PinSource2 : /* bit 2 is set? */ \
((GPIO_PIN) & GPIO_Pin_3) ? GPIO_PinSource3 : /* bit 3 is set? */ \
((GPIO_PIN) & GPIO_Pin_4) ? GPIO_PinSource4 : /* bit 4 is set? */ \
((GPIO_PIN) & GPIO_Pin_5) ? GPIO_PinSource5 : /* bit 5 is set? */ \
((GPIO_PIN) & GPIO_Pin_6) ? GPIO_PinSource6 : /* bit 6 is set? */ \
((GPIO_PIN) & GPIO_Pin_7) ? GPIO_PinSource7 : /* bit 7 is set? */ \
((GPIO_PIN) & GPIO_Pin_8) ? GPIO_PinSource8 : /* bit 8 is set? */ \
((GPIO_PIN) & GPIO_Pin_9) ? GPIO_PinSource9 : /* bit 9 is set? */ \
((GPIO_PIN) & GPIO_Pin_10) ? GPIO_PinSource10 : /* bit 10 is set? */\
((GPIO_PIN) & GPIO_Pin_11) ? GPIO_PinSource11 : /* bit 11 is set? */\
((GPIO_PIN) & GPIO_Pin_12) ? GPIO_PinSource12 : /* bit 12 is set? */\
((GPIO_PIN) & GPIO_Pin_13) ? GPIO_PinSource13 : /* bit 13 is set? */\
((GPIO_PIN) & GPIO_Pin_14) ? GPIO_PinSource14 : /* bit 14 is set? */\
((GPIO_PIN) & GPIO_Pin_15) ? GPIO_PinSource15 : /* bit 15 is set? */\
-1) /* no bits are set */

Get GPIO_PinSourcex from GPIO_Pin_x.

Definition at line 149 of file carme.h.

#define CARME_GPIO_TO_EXTILINE (   GPIO_PIN)
Value:
( \
((GPIO_PIN) & GPIO_Pin_0) ? EXTI_Line0 : /* bit 0 is set? */ \
((GPIO_PIN) & GPIO_Pin_1) ? EXTI_Line1 : /* bit 1 is set? */ \
((GPIO_PIN) & GPIO_Pin_2) ? EXTI_Line2 : /* bit 2 is set? */ \
((GPIO_PIN) & GPIO_Pin_3) ? EXTI_Line3 : /* bit 3 is set? */ \
((GPIO_PIN) & GPIO_Pin_4) ? EXTI_Line4 : /* bit 4 is set? */ \
((GPIO_PIN) & GPIO_Pin_5) ? EXTI_Line5 : /* bit 5 is set? */ \
((GPIO_PIN) & GPIO_Pin_6) ? EXTI_Line6 : /* bit 6 is set? */ \
((GPIO_PIN) & GPIO_Pin_7) ? EXTI_Line7 : /* bit 7 is set? */ \
((GPIO_PIN) & GPIO_Pin_8) ? EXTI_Line8 : /* bit 8 is set? */ \
((GPIO_PIN) & GPIO_Pin_9) ? EXTI_Line9 : /* bit 9 is set? */ \
((GPIO_PIN) & GPIO_Pin_10) ? EXTI_Line10 : /* bit 10 is set? */\
((GPIO_PIN) & GPIO_Pin_11) ? EXTI_Line11 : /* bit 11 is set? */\
((GPIO_PIN) & GPIO_Pin_12) ? EXTI_Line12 : /* bit 12 is set? */\
((GPIO_PIN) & GPIO_Pin_13) ? EXTI_Line13 : /* bit 13 is set? */\
((GPIO_PIN) & GPIO_Pin_14) ? EXTI_Line14 : /* bit 14 is set? */\
((GPIO_PIN) & GPIO_Pin_15) ? EXTI_Line15 : /* bit 15 is set? */\
-1) /* no bits are set */
#define EXTI_Line1
#define EXTI_Line13
#define EXTI_Line2
#define EXTI_Line10
#define EXTI_Line11
#define EXTI_Line14
#define EXTI_Line12
#define EXTI_Line7
#define EXTI_Line5
#define EXTI_Line0
#define EXTI_Line15
#define EXTI_Line3
#define EXTI_Line9
#define EXTI_Line6
#define EXTI_Line4
#define EXTI_Line8

Get EXTI_Linex from GPIO_Pin_x.

Definition at line 208 of file carme.h.

#define CARME_GPIO_TO_EXTIPINSOURCE (   GPIO_PIN)
Value:
( \
((GPIO_PIN) & GPIO_Pin_0) ? EXTI_PinSource0 : /* bit 0 is set? */ \
((GPIO_PIN) & GPIO_Pin_1) ? EXTI_PinSource1 : /* bit 1 is set? */ \
((GPIO_PIN) & GPIO_Pin_2) ? EXTI_PinSource2 : /* bit 2 is set? */ \
((GPIO_PIN) & GPIO_Pin_3) ? EXTI_PinSource3 : /* bit 3 is set? */ \
((GPIO_PIN) & GPIO_Pin_4) ? EXTI_PinSource4 : /* bit 4 is set? */ \
((GPIO_PIN) & GPIO_Pin_5) ? EXTI_PinSource5 : /* bit 5 is set? */ \
((GPIO_PIN) & GPIO_Pin_6) ? EXTI_PinSource6 : /* bit 6 is set? */ \
((GPIO_PIN) & GPIO_Pin_7) ? EXTI_PinSource7 : /* bit 7 is set? */ \
((GPIO_PIN) & GPIO_Pin_8) ? EXTI_PinSource8 : /* bit 8 is set? */ \
((GPIO_PIN) & GPIO_Pin_9) ? EXTI_PinSource9 : /* bit 9 is set? */ \
((GPIO_PIN) & GPIO_Pin_10) ? EXTI_PinSource10 : /* bit 10 is set? */\
((GPIO_PIN) & GPIO_Pin_11) ? EXTI_PinSource11 : /* bit 11 is set? */\
((GPIO_PIN) & GPIO_Pin_12) ? EXTI_PinSource12 : /* bit 12 is set? */\
((GPIO_PIN) & GPIO_Pin_13) ? EXTI_PinSource13 : /* bit 13 is set? */\
((GPIO_PIN) & GPIO_Pin_14) ? EXTI_PinSource14 : /* bit 14 is set? */\
((GPIO_PIN) & GPIO_Pin_15) ? EXTI_PinSource15 : /* bit 15 is set? */\
-1) /* no bits are set */

Get EXTI_PinSourcex from GPIO_Pin_x.

Definition at line 186 of file carme.h.

#define CARME_GPIO_TO_EXTIPORTSOURCE (   GPIO_PORT)
Value:
( \
(GPIO_PORT == GPIOA) ? EXTI_PortSourceGPIOA : /* Port A? */ \
(GPIO_PORT == GPIOB) ? EXTI_PortSourceGPIOB : /* Port B? */ \
(GPIO_PORT == GPIOC) ? EXTI_PortSourceGPIOC : /* Port C? */ \
(GPIO_PORT == GPIOD) ? EXTI_PortSourceGPIOD : /* Port D? */ \
(GPIO_PORT == GPIOE) ? EXTI_PortSourceGPIOE : /* Port E? */ \
(GPIO_PORT == GPIOF) ? EXTI_PortSourceGPIOF : /* Port F? */ \
(GPIO_PORT == GPIOG) ? EXTI_PortSourceGPIOG : /* Port G? */ \
(GPIO_PORT == GPIOH) ? EXTI_PortSourceGPIOH : /* Port H? */ \
(GPIO_PORT == GPIOI) ? EXTI_PortSourceGPIOI : /* Port I? */ \
-1) /* no port is set */

Get EXTI_PortSourceGPIOx from GPIOx.

Definition at line 171 of file carme.h.

#define CARME_LED_GREEN   GPIOI, GPIO_Pin_6

Green LED on module

Definition at line 109 of file carme.h.

#define CARME_LED_PIN_GREEN   ((uint32_t)0x40000)

Green LED Pin

Definition at line 131 of file carme.h.

#define CARME_LED_PIN_RED   ((uint32_t)0x80000)

Red LED Pin

Definition at line 132 of file carme.h.

#define CARME_LED_RED   GPIOI, GPIO_Pin_7

Red LED on module

Definition at line 110 of file carme.h.

#define CARME_NO_ERROR   0x0

No error

Examples:
can.c.

Definition at line 135 of file carme.h.

#define FSMC_CAN_BASE   (FSMC_IO_BASE + 0x2000000)

CAN controller SJA1000

Definition at line 88 of file carme.h.

#define FSMC_CARME_EXTENSION1_BASE   (FSMC_IO_BASE + 0x0000000)

CARME Extension 1

Definition at line 86 of file carme.h.

#define FSMC_CARME_EXTENSION2_BASE   (FSMC_IO_BASE + 0x1000000)

CARME Extension 2

Definition at line 87 of file carme.h.

#define FSMC_FLASH_BASE   FSMC_NOR_PSRAM_CS_ADDR(1)

External flash

Definition at line 82 of file carme.h.

#define FSMC_IO_BASE   FSMC_NOR_PSRAM_CS_ADDR(4)

External IO

Definition at line 85 of file carme.h.

#define FSMC_LCD_SSD1963_BASE   FSMC_NOR_PSRAM_CS_ADDR(3)

LCD SSD1963 controller

Definition at line 84 of file carme.h.

#define FSMC_NOR_PSRAM_CS_ADDR (   n)
Value:
(0x60000000 + ((n) - 1) \
* 0x4000000)

address formula

Definition at line 79 of file carme.h.

#define FSMC_PSRAM_BASE   FSMC_NOR_PSRAM_CS_ADDR(2)

External ram

Definition at line 83 of file carme.h.

Function Documentation

void CARME_AGPIO_Get ( uint32_t *  pStatus)

Get the AGPIO state.

Parameters
[out]pStatusWord with the actual state.
Returns
None

Definition at line 592 of file carme.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uint8_t CARME_AGPIO_GetMode ( GPIO_TypeDef *  GPIOx,
uint16_t  GPIO_Pin 
)
static

Get the AGPIO mode.

Parameters
[in]GPIOxWhere x can be (A..I) to select the GPIO peripheral.
[in]GPIO_Pinspecifies the port bit to be read.
Returns
0 = GPIO_Mode_IN
1 = GPIO_Mode_OUT
2 = GPIO_Mode_AF
3 = GPIO_Mode_AN

Definition at line 639 of file carme.c.

+ Here is the caller graph for this function:

static void CARME_AGPIO_Init ( void  )
static

CARME AGPIO initialization.

Returns
None

Definition at line 520 of file carme.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CARME_AGPIO_Set ( uint32_t  write,
uint32_t  mask 
)

Set the AGPIO state.

Parameters
[in]writeWord with the new state.
[in]maskWord with the mask.
Returns
None

Definition at line 567 of file carme.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void CARME_FSMC_GPIO_Init ( void  )
static

Initialization of the FSMC GPIO pins. This bus is used for the connection to the extension modules, the CAN driver (SJA1000) and the LCD driver.

Returns
None

CARME FSMC Port and Pin association

< FSMC_A0

< FSMC_A1

< FSMC_A2

< FSMC_A3

< FSMC_A4

< FSMC_A5

< FSMC_A6

< FSMC_A7

< FSMC_A8

< FSMC_A9

< FSMC_A10

< FSMC_A11

< FSMC_A12

< FSMC_A13

< FSMC_A14

< FSMC_A15

< FSMC_A16

< FSMC_A17

< FSMC_A18

< FSMC_A19

< FSMC_A20

< FSMC_A21

< FSMC_A22

< FSMC_A23

< FSMC_A24

< FSMC_A25

< FSMC_D0

< FSMC_D1

< FSMC_D2

< FSMC_D3

< FSMC_D4

< FSMC_D5

< FSMC_D6

< FSMC_D7

< FSMC_D8

< FSMC_D9

< FSMC_D10

< FSMC_D11

< FSMC_D12

< FSMC_D13

< FSMC_D14

< FSMC_D15

< FSMC_NE1

< FSMC_NE2

< FSMC_NE3

< FSMC_NE4

< FSMC_NL

< FSMC_CLK

< FSMC_NOE

< FSMC_NWE

< FSMC_NWAIT

< FSMC_NBL0

< FSMC_NBL1

Definition at line 194 of file carme.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void CARME_FSMC_Init ( void  )
static

Initialization of the FSMC. This bus is used for the connection to the CarmeIO1 and CarmeIO2 module, the CAN driver (SJA1000) and the LCD driver.

Returns
None

Address and databus to RAM.

FSMC configuration:

  • Data/Address MUX = Disable
  • Memory Type = SRAM
  • Data Width = 16bit
  • Write Operation = Enable
  • Extended Mode = Enable
  • Asynchronous Wait = Disable

FSMC Timing configuration:

  • Clock division = 1 -> CLK = 168 MHz
  • Address setup time = 5 * 6 ns
  • Address hold time = 0 * 6 ns
  • Data setup time = 9 * 6 ns
  • Bus turn around duration = 0 * 6 ns
  • Data latency time = 0 * 6 ns
  • Access Mode A

Address and databus to display controller.

FSMC configuration:

  • Data/Address MUX = Disable
  • Memory Type = SRAM
  • Data Width = 16bit
  • Write Operation = Enable
  • Extended Mode = Enable
  • Asynchronous Wait = Disable

FSMC Timing configuration:

  • Clock division = 1 -> CLK = 168 MHz
  • Address setup time = 5 * 6 ns
  • Address hold time = 0 * 6 ns
  • Data setup time = 9 * 6 ns
  • Bus turn around duration = 0 * 6 ns
  • Data latency time = 0 * 6 ns
  • Access Mode A

Address and databus to CARME IO1 and IO2 and SJA1000 CAN controller.

FSMC configuration:

  • Data/Address MUX = Disable
  • Memory Type = SRAM
  • Data Width = 8bit
  • Write Operation = Enable
  • Extended Mode = Enable
  • Asynchronous Wait = Disable

FSMC Timing configuration:

  • Clock division = 1 -> CLK = 168 MHz
  • Address setup time = 1 * 6 ns
  • Address hold time = 8 * 6 ns
  • Data setup time = 15 * 6 ns
  • Bus turn around duration = 0 * 6 ns
  • Data latency time = 5 * 6 ns
  • Access Mode D

Definition at line 299 of file carme.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

Parameters
[in]pPortPinAssociationCARME_Port_Pin_t Port and Pin association
[in]pGPIO_InitStructGPIO_InitTypeDef GPIO init type definition
[in]sizeSize of the struct
Returns
None

Definition at line 540 of file carme.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CARME_Init ( void  )

CARME-M4 module initialization.

Returns
None

Definition at line 152 of file carme.c.

+ Here is the call graph for this function:

void CARME_LED_Green_Reset ( void  )

Reset the green LED on the CARME Module.

Returns
None

Definition at line 666 of file carme.c.

+ Here is the call graph for this function:

void CARME_LED_Green_Set ( void  )

Set the green LED on the CARME Module.

Returns
None

Definition at line 654 of file carme.c.

+ Here is the call graph for this function:

void CARME_LED_Red_Reset ( void  )

Reset the red LED on the CARME Module.

Returns
None

Definition at line 690 of file carme.c.

+ Here is the call graph for this function:

void CARME_LED_Red_Set ( void  )

Set the red LED on the CARME Module.

Returns
None

Definition at line 678 of file carme.c.

+ Here is the call graph for this function:

Variable Documentation

CARME_Port_Pin_t CARME_AGPIO_Port_Pin[]
static
Initial value:
= {
{ GPIOI, GPIO_Pin_6, GPIO_Mode_OUT },
{ GPIOI, GPIO_Pin_7, GPIO_Mode_OUT },
}
#define CARME_AGPIO_116
Definition: carme.h:108
#define CARME_AGPIO_93
Definition: carme.h:97
#define CARME_AGPIO_99
Definition: carme.h:101
#define CARME_AGPIO_13
Definition: carme.h:92
#define CARME_AGPIO_94
Definition: carme.h:98
#define CARME_AGPIO_108
Definition: carme.h:106
#define CARME_AGPIO_102
Definition: carme.h:103
#define CARME_AGPIO_103
Definition: carme.h:104
#define CARME_AGPIO_115
Definition: carme.h:107
#define CARME_AGPIO_97
Definition: carme.h:100
#define CARME_AGPIO_101
Definition: carme.h:102
#define CARME_AGPIO_21
Definition: carme.h:93
#define CARME_AGPIO_90
Definition: carme.h:95
#define CARME_AGPIO_22
Definition: carme.h:94
#define CARME_AGPIO_96
Definition: carme.h:99
#define CARME_AGPIO_105
Definition: carme.h:105
#define CARME_AGPIO_9
Definition: carme.h:91
#define CARME_AGPIO_91
Definition: carme.h:96

CARME AGPIO Port and Pin association.

Definition at line 121 of file carme.c.