# modules/blm_scalar_master/blm_scalar_master.c File Reference

`#include <mios32.h>`
`#include "blm_scalar_master.h"`

## Data Structures
union | sysex_state_t
## Defines
#define | SYSEX_DISACK 0x0e
#define | SYSEX_ACK 0x0f
#define | SYSEX_DISACK_LESS_BYTES_THAN_EXP 0x01
#define | SYSEX_DISACK_MORE_BYTES_THAN_EXP 0x02
#define | SYSEX_DISACK_INVALID_COMMAND 0x0c
#define | SYSEX_BLM_CMD_REQUEST 0x00
#define | SYSEX_BLM_CMD_LAYOUT 0x01
#define | BLM_TIMEOUT_RELOAD_VALUE 10000
#define | BLM_MAX_PACKETS 8
#define | SEND_PACKET(p)
## Enumerations
enum | sysex_cmd_state_t { SYSEX_CMD_STATE_BEGIN, SYSEX_CMD_STATE_CONT, SYSEX_CMD_STATE_END }
## Functions
s32 | BLM_SCALAR_MASTER_Init (u32 mode)
s32 | BLM_SCALAR_MASTER_MIDI_PortSet (u8 blm, mios32_midi_port_t port)
mios32_midi_port_t | BLM_SCALAR_MASTER_MIDI_PortGet (u8 blm)
blm_scalar_master_connection_state_t | BLM_SCALAR_MASTER_ConnectionStateGet (u8 blm)
s32 | BLM_SCALAR_MASTER_ButtonCallback_Init (s32(*button_callback_func)(u8 blm, blm_scalar_master_element_t element_id, u8 button_x, u8 button_y, u8 button_depressed))
s32 | BLM_SCALAR_MASTER_FaderCallback_Init (s32(*fader_callback_func)(u8 blm, u8 fader, u8 value))
s32 | BLM_SCALAR_MASTER_LED_Set (u8 blm, blm_scalar_master_element_t element_id, u8 led_x, u8 led_y, blm_scalar_master_colour_t colour)
blm_scalar_master_colour_t | BLM_SCALAR_MASTER_LED_Get (u8 blm, blm_scalar_master_element_t element_id, u8 led_x, u8 led_y)
s32 | BLM_SCALAR_MASTER_RotateViewSet (u8 blm, u8 rotate_view)
s32 | BLM_SCALAR_MASTER_RotateViewGet (u8 blm)
s32 | BLM_SCALAR_MASTER_RowOffsetSet (u8 blm, u8 row_offset)
s32 | BLM_SCALAR_MASTER_RowOffsetGet (u8 blm)
s32 | BLM_SCALAR_MASTER_NumColumnsGet (u8 blm)
s32 | BLM_SCALAR_MASTER_NumRowsGet (u8 blm)
s32 | BLM_SCALAR_MASTER_NumColoursGet (u8 blm)
s32 | BLM_SCALAR_MASTER_TimeoutCtrSet (u8 blm, u16 ctr)
s32 | BLM_SCALAR_MASTER_TimeoutCtrGet (u8 blm)
s32 | BLM_SCALAR_MASTER_ForceDisplayUpdate (u8 blm)
s32 | BLM_SCALAR_MASTER_MIDI_Receive (mios32_midi_port_t port, mios32_midi_package_t midi_package)
s32 | BLM_SCALAR_MASTER_MIDI_TimeOut (mios32_midi_port_t port)
s32 | BLM_SCALAR_MASTER_SYSEX_Parser (mios32_midi_port_t port, u8 midi_in)
s32 | BLM_SCALAR_MASTER_SendRequest (u8 blm, u8 req)
s32 | BLM_SCALAR_MASTER_Periodic_mS (void)
## Variables
u16 | blm_scalar_master_leds_green [BLM_SCALAR_MASTER_NUM_ROWS]
u16 | blm_scalar_master_leds_red [BLM_SCALAR_MASTER_NUM_ROWS]
u16 | blm_scalar_master_leds_extracolumn_green
u16 | blm_scalar_master_leds_extracolumn_red
u16 | blm_scalar_master_leds_extracolumn_shift_green
u16 | blm_scalar_master_leds_extracolumn_shift_red
u16 | blm_scalar_master_leds_extrarow_green
u16 | blm_scalar_master_leds_extrarow_red
u8 | blm_scalar_master_leds_extra_green
u8 | blm_scalar_master_leds_extra_red

## Define Documentation

#define SEND_PACKET | ( | p |  | ) |

Value:

    { \
        packets[num_packets++] = p;                 \
        if( num_packets >= BLM_MAX_PACKETS ) {      \
          BLM_SendPackets(packets, num_packets);    \
          num_packets = 0;                          \
        } \
      }