CARME-M4 BSP  V1.5
CARME IO1

CARME IO1 high level functions. More...

+ Collaboration diagram for CARME IO1:

Files

file  carme_io1.h
 CARME IO1 extension module board support package.
 
file  carme_io1.c
 CARME IO1 extension module board support package.
 

Macros

#define CARME_IO1_BUTTON0_PORT   GPIOC
 
#define CARME_IO1_BUTTON1_PORT   GPIOB
 
#define CARME_IO1_BUTTON2_PORT   GPIOB
 
#define CARME_IO1_BUTTON3_PORT   GPIOI
 
#define CARME_IO1_BUTTON0_PIN   GPIO_Pin_7
 
#define CARME_IO1_BUTTON1_PIN   GPIO_Pin_15
 
#define CARME_IO1_BUTTON2_PIN   GPIO_Pin_14
 
#define CARME_IO1_BUTTON3_PIN   GPIO_Pin_0
 

Typedefs

typedef enum _CARME_IO1_PIO_PORT CARME_IO1_PIO_PORT
 This enum contains all available Ports of the PIO device.
 
typedef enum _CARME_IO1_PIO_CONTROL CARME_IO1_PIO_CONTROL
 This contains all possible commands for the PIO device.
 

Enumerations

enum  _CARME_IO1_PIO_PORT { CARME_IO1_PORT_A, CARME_IO1_PORT_C, CARME_IO1_PORT_C_L, CARME_IO1_PORT_C_H }
 This enum contains all available Ports of the PIO device. More...
 
enum  _CARME_IO1_PIO_CONTROL {
  CARME_IO1_PORT_A_IN = 0x01, CARME_IO1_PORT_A_OUT = 0x02, CARME_IO1_PORT_C_IN = 0x04, CARME_IO1_PORT_C_OUT = 0x08,
  CARME_IO1_PORT_C_L_IN = 0x10, CARME_IO1_PORT_C_L_OUT = 0x20, CARME_IO1_PORT_C_H_IN = 0x40, CARME_IO1_PORT_C_H_OUT = 0x80
}
 This contains all possible commands for the PIO device. More...
 

Functions

void CARME_IO1_Init (void)
 CARME IO1 initialization. More...
 
void CARME_IO1_LED_Set (uint8_t write, uint8_t mask)
 Set a byte to the CARME IO1 LEDs. More...
 
void CARME_IO1_LED_Get (uint8_t *pStatus)
 Get the CARME IO1 LED status. More...
 
void CARME_IO1_SWITCH_Get (uint8_t *pStatus)
 Get the CARME IO1 switch status. More...
 
void CARME_IO1_BUTTON_Get (uint8_t *pStatus)
 Get the CARME IO1 button status. More...
 
void CARME_IO1_BUTTON_Interrupt (FunctionalState state)
 Set the CARME IO1 interrupt enable/disable. More...
 
void CARME_IO1_PIO_Write (CARME_IO1_PIO_PORT port, uint8_t data)
 Sets the PIOs in order with the input-value. More...
 
void CARME_IO1_PIO_Read (CARME_IO1_PIO_PORT port, uint8_t *data)
 Read the PIO value. More...
 
void CARME_IO1_PIO_Set (CARME_IO1_PIO_PORT port, uint8_t pio)
 Sets the PIO on the position of the input value.
For example the input value 0x4 sets the pin number 4. The other pins are not affected. More...
 
void CARME_IO1_PIO_Clear (CARME_IO1_PIO_PORT port, uint8_t pio)
 Clears the PIO on the position of the input value.
For example the input value 0x4 clears the pin number 4. The other pins are not affected. More...
 
void CARME_IO1_PIO_Control (CARME_IO1_PIO_CONTROL cmd)
 Sets the PIO Control Register. This function must be called to change the Port direction. More...
 

Variables

static __IO uint8_t * LED_Port = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x200)
 Pointer to the register which controls the CARME IO1 LEDs.
 
static __IO uint8_t * Switch_Port = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x400)
 Pointer to the register which controls the CARME IO1 Switchs.
 
static __IO uint8_t * PIO_PortA = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x800)
 Pointer to the register which controls the CARME IO1 PIO PortA Value.
 
static __IO uint8_t * PIO_PortC = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x810)
 Pointer to the register which controls the CARME IO1 PIO PortB Value. More...
 
static __IO uint8_t * PIO_Control = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x818)
 Pointer to the register which controls the CARME IO1 PIO Control Value.
 
static CARME_Port_Pin_t CARME_IO1_Port_Pin []
 CARME IO1 Port and Pin association. More...
 
static __IO uint8_t LED_Value = 0x00
 CARME IO1 current led value.
 
static __IO uint8_t PortA_Value = 0x00
 CARME IO1 current PortA value.
 
static __IO uint8_t PortC_Value = 0x00
 CARME IO1 current PortC value.
 

Detailed Description

CARME IO1 high level functions.

Enumeration Type Documentation

This contains all possible commands for the PIO device.

Enumerator
CARME_IO1_PORT_A_IN 

input Port A

CARME_IO1_PORT_A_OUT 

ouput Port A

CARME_IO1_PORT_C_IN 

input Port C

CARME_IO1_PORT_C_OUT 

output Port C

CARME_IO1_PORT_C_L_IN 

input Port C [PC0 ... PC3]

CARME_IO1_PORT_C_L_OUT 

output Port C [PC0 ... PC3]

CARME_IO1_PORT_C_H_IN 

input Port C [PC4 ... PC7]

CARME_IO1_PORT_C_H_OUT 

output Port C [PC4 ... PC7]

Definition at line 104 of file carme_io1.h.

This enum contains all available Ports of the PIO device.

Enumerator
CARME_IO1_PORT_A 

Port A [PA0 ... PA7]

CARME_IO1_PORT_C 

Port C [PC0 ... PC7]

CARME_IO1_PORT_C_L 

Port C [PC0 ... PC3]

CARME_IO1_PORT_C_H 

Port C [PC4 ... PC7]

Definition at line 93 of file carme_io1.h.

Function Documentation

void CARME_IO1_BUTTON_Get ( uint8_t *  pStatus)

Get the CARME IO1 button status.

Parameters
[out]pStatusThe current button status.
Returns
None

Definition at line 235 of file carme_io1.c.

+ Here is the call graph for this function:

void CARME_IO1_BUTTON_Interrupt ( FunctionalState  state)

Set the CARME IO1 interrupt enable/disable.

Parameters
[in]stateThe new state.
Returns
None

Definition at line 256 of file carme_io1.c.

+ Here is the call graph for this function:

void CARME_IO1_Init ( void  )

CARME IO1 initialization.

Returns
None
Examples:
dma.c.

Definition at line 163 of file carme_io1.c.

+ Here is the call graph for this function:

void CARME_IO1_LED_Get ( uint8_t *  pStatus)

Get the CARME IO1 LED status.

Parameters
[out]pStatusThe current LED status.
Returns
None

Definition at line 209 of file carme_io1.c.

void CARME_IO1_LED_Set ( uint8_t  write,
uint8_t  mask 
)

Set a byte to the CARME IO1 LEDs.

Parameters
[in]writeByte with the new LED status.
[in]maskMask which LED should be written.
Returns
None

Definition at line 182 of file carme_io1.c.

void CARME_IO1_PIO_Clear ( CARME_IO1_PIO_PORT  port,
uint8_t  pio 
)

Clears the PIO on the position of the input value.
For example the input value 0x4 clears the pin number 4. The other pins are not affected.

Parameters
[in]portPort (A or C)
[out]pioPIO to clear [0..7]
Returns
None

Definition at line 412 of file carme_io1.c.

void CARME_IO1_PIO_Control ( CARME_IO1_PIO_CONTROL  cmd)

Sets the PIO Control Register. This function must be called to change the Port direction.

Note
This function should not be interrupted from a function who access the address- and databus.
Parameters
[in]cmdSee CARME_IO1_PIO_CONTROL for allowed values.
Returns
None

Definition at line 439 of file carme_io1.c.

void CARME_IO1_PIO_Read ( CARME_IO1_PIO_PORT  port,
uint8_t *  data 
)

Read the PIO value.

Parameters
[in]portPort (A or C)
[out]dataPointer to the user pio variable
Returns
None

Definition at line 354 of file carme_io1.c.

void CARME_IO1_PIO_Set ( CARME_IO1_PIO_PORT  port,
uint8_t  pio 
)

Sets the PIO on the position of the input value.
For example the input value 0x4 sets the pin number 4. The other pins are not affected.

Parameters
[in]portPort (A or C)
[out]pioPIO to set [0..7]
Returns
None

Definition at line 385 of file carme_io1.c.

void CARME_IO1_PIO_Write ( CARME_IO1_PIO_PORT  port,
uint8_t  data 
)

Sets the PIOs in order with the input-value.

Parameters
[in]portPort (A or C)
[in]datainput value to set
Returns
None

Definition at line 323 of file carme_io1.c.

void CARME_IO1_SWITCH_Get ( uint8_t *  pStatus)

Get the CARME IO1 switch status.

Parameters
[out]pStatusThe current switch status.
Returns
None

Definition at line 222 of file carme_io1.c.

Variable Documentation

CARME_Port_Pin_t CARME_IO1_Port_Pin[]
static
Initial value:
= {
{ CARME_IO1_BUTTON0_PORT, CARME_IO1_BUTTON0_PIN, GPIO_Mode_IN },
{ CARME_IO1_BUTTON1_PORT, CARME_IO1_BUTTON1_PIN, GPIO_Mode_IN },
{ CARME_IO1_BUTTON2_PORT, CARME_IO1_BUTTON2_PIN, GPIO_Mode_IN },
{ CARME_IO1_BUTTON3_PORT, CARME_IO1_BUTTON3_PIN, GPIO_Mode_IN },
}

CARME IO1 Port and Pin association.

Definition at line 133 of file carme_io1.c.

__IO uint8_t* PIO_PortC = (__IO uint8_t *) (FSMC_CARME_EXTENSION1_BASE + 0x810)
static

Pointer to the register which controls the CARME IO1 PIO PortB Value.

Pointer to the register which controls the CARME IO1 PIO PortC Value.

Definition at line 123 of file carme_io1.c.